feat: Port kargs hardening scripts to Python#1509
Merged
RoyalOughtness merged 8 commits intosecureblue:livefrom Nov 7, 2025
Merged
feat: Port kargs hardening scripts to Python#1509RoyalOughtness merged 8 commits intosecureblue:livefrom
RoyalOughtness merged 8 commits intosecureblue:livefrom
Conversation
81194e4 to
50ba340
Compare
3 tasks
files/system/usr/libexec/secureblue/kargs_hardening_common/__init__.py
Outdated
Show resolved
Hide resolved
* Port `ujust set-kargs-hardening` and `remove-kargs-hardening` to Python. * Better formatting and user input checking for `set-kargs-hardening`. * `ujust set-kargs-hardening` now *removes* optional kernel arguments in the classes not selected by the user (e.g. `nosmt=force` is removed if already present if the user selects "no" for its prompt). * Centralize the list of kernel arguments: the default kargs are now only in `/usr/lib/bootc/kargs.d`, everything else (including the audit script) reads from there. This should make modifying the list of kargs less error-prone as we don't have to ensure the lists stay in sync. * Sort kargs lexicographically in `kargs.d`. * Make Nvidia kargs ujust scripts Nvidia-only. Signed-off-by: Daniel Hast <[email protected]>
This centralizes the list of Nvidia-specific kargs as well, so the list is only present in `/usr/lib/bootc/kargs.d` and both the scripts read the list from there.
This allows kargs to be set non-interactively from other Python code.
RoyalOughtness
approved these changes
Nov 6, 2025
EsseLowNitro
approved these changes
Nov 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ujust set-kargs-hardeningandremove-kargs-hardeningto Python.set-kargs-hardening.ujust set-kargs-hardeningnow removes optional kernel arguments in the classes not selected by the user (e.g.nosmt=forceis removed if already present if the user selects "no" for its prompt)./usr/lib/bootc/kargs.d, everything else (including the audit script) reads from there. This should make modifying the list of kargs less error-prone as we don't have to ensure the lists stay in sync.kargs.d.kargs.d.