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

Provides first-run custom kernel support for Focal #5518

Merged
merged 2 commits into from Sep 21, 2020

Conversation

conorsch
Copy link
Contributor

Status

Ready for review

Description of Changes

Updates the paxctl commands to use slightly different logic depending on whether the host is running Xenial or Focal. Notably this only alters the Ansible logic, and ignores the same flags in the securedrop-grsec metapackage. Therefore I'm only saying "refs #5495" since technically there's a bit more follow-up required there (possibly switching to paxctld #4134).

Also updating the package patterns so that non-grsec kernels are succesfully removed during first install. I've only tested in this in libvirt staging VMs running focal, but it's enough. More durable forcing of the hardened kernels is tracked in #5507. Therefore, closes #5508.

Testing

You must use a Linux machine with libvirt support.

make build-debs-focal # if you don't already have them
molecule converge -s libvirt-staging-focal

Confirm that the install completes without error, and the app is functional. The testinfra tests are not yet passing for Focal, so don't expect the "verify" action to work.

Deployment

The changes aim to preserve identical behavior under Xenial. Still, the CI checks for staging will confirm that the paxctl commands are not broken under Xenial. I don't think we need additional functional testing beyond that, outside of standard pre-release QA.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

If you made changes to the system configuration:

If you made non-trivial code changes:

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

If you made changes to documentation:

  • Doc linting (make docs-lint) passed locally

If you added or updated a code dependency:

Choose one of the following:

  • I have performed a diff review and pasted the contents to the packaging wiki
  • I would like someone else to do the diff review

Conor Schaefer added 2 commits September 18, 2020 18:30
For Xenial we'll continue using the C flag but under Focal we must start
using "c" instead. Provides a map in the Ansible settings so the right
flag is used depending on what OS the servers are running.

Notably we're overlooking the "securedrop-grsec" metapackage which also
has these same flags hardcoded, but we may decide to switch to paxctld
instead.

The reformatting on the "when" conditional non-functional, but silences
an Ansible deprecation warning.
The first pass on the pattern updates for Focal machines missed a few
default kernel patterns. Now that we're unblocked testing kernels in
Focal VMs, was able to identify sufficient patterns so that all
assertions pass.
@kushaldas kushaldas self-assigned this Sep 21, 2020
Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

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

This is simple and yet powerful. Works as excepted:

  • molecule converge -s libvirt-staging-focal

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.

Make sure that all non-grsec kernels are purged duing install on Focal
2 participants