Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mokutil check to detect SecureBoot status before installing #5879

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

zenmonkeykstop
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop commented Mar 25, 2021

Status

Ready for review

Description of Changes

Fixes #5871.

Adds a raw command check in the prepare_servers ansible role, to see if SecureBoot is enabled. If it is, the install exits early with an informative error. The check runs mokutil --sb-state, and fails iff the output includes SecureBoot enabled:

  • mokutil will error out if noefi is set in kernel boot args (as it is for the current grsec kernel) - this is ignored and the check passes
  • if mokutil isn't present (it is present for UEFI installs on 16.04.6 and 20.04) the check passes (because this is probably a Legacy boot setup)
  • if the response is SecureBoot disabled, it obviously passes :)

Testing

On prod hardware,

  • before installing, enable SecureBoot in the app server BIOS and disable it for the mon server
  • complete the OS install and initial setup/sdconfig using this branch
  • run ./securedrop-admin --force install entering the server password when prompted
    • verify that the secureboot check fails for the app server and passes for the mon server, and that the install playbook exits immediately after.
  • disable SecureBoot for the app server and rerun the install command
    • verify that the secureboot check passes for both servers and that the installation completes without issues.
  • after installation and tailsconfig, run ssh mon sudo apt remove mokutil to remove the utility from the mon server.
  • run ./securedrop-admin --force install again
    • verify that the app server check fails with an EFI variables are not supported message
    • verify that the mon server check fails with mokutil: not found
    • verify that the failures are ignored and the installation completes without issues.

Deployment

Deployed when workstation is updated. No implications for older systems IMO

Checklist

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

Choose one of the following:

  • I have opened a PR in the docs repo for these changes, or will do so later
  • I would appreciate help with the documentation
  • These changes do not require documentation

@zenmonkeykstop zenmonkeykstop added this to the 1.8.1 milestone Mar 25, 2021
@kushaldas
Copy link
Contributor

As I mentioned in yesterday's standup, I don't have access to the prod hardware right now, so I will not be able to review this PR.

@emkll emkll self-assigned this Mar 30, 2021
On Ubuntu Focal installed from ISO, the "mokutil" package wasn't
installed by default. Let's add it early in the prepare-servers role, so
we can use it to check for SecureBoot status before proceeding with
installation.
Copy link
Contributor

@conorsch conorsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested on prod server hardware, but I did test on Focal Qubes HVMs. Added a commit to make sure that mokutil is present. As you say, the check passes when it's not (which is appropriate), but it seems reasonable to install the tool in order to verify the system state.

Inside Qubes HVMs, I see EFI variables are not supported on this system, which still passes the check.

@conorsch conorsch merged commit e6fd7fe into develop Mar 30, 2021
@rmol rmol deleted the secureboot_check branch June 23, 2021 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check for Secure Boot setting during install process
4 participants