Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
Adds the capability we'll need for #813.
Description of changes:
This should cause no functional difference on the system since we default to 'none', but will allow users to set a lockdown level. Raising the lockdown level is probably safe for most use cases, but wouldn't work with some use cases described in #813, so we can't increase it by default at the moment.
Testing done:
Unit tests pass. Migrations work locally.
Created a 1.0.3 AMI without this change, and a repo including this change marked as version 1.0.5 (to match the migration list added to Release.toml). Updated from 1.0.3 to 1.0.5 successfully. Confirmed I could run a pod OK. Confirmed that the lockdown setting showed up in the API and the restart-commands list for sysctl was updated correctly by the migration. Further testing:
Default state:
Bad values are rejected:
Good values accepted and applied:
Setting is still applied after reboot:
Applying the setting multiple times is handled safely in corndog (the kernel rejects the write):
Here's a manual run of corndog after changing the setting, and committing but not applying the changes, just to show it's happy:
You can't downgrade at runtime...
...but after a reboot, your request takes effect:
I confirmed that I could downgrade successfully to 1.0.3 and the lockdown setting was removed, and the restart-commands list was reverted.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.