Skip to content

feat: Port kargs hardening scripts to Python#1509

Merged
RoyalOughtness merged 8 commits intosecureblue:livefrom
HastD:set-kargs
Nov 7, 2025
Merged

feat: Port kargs hardening scripts to Python#1509
RoyalOughtness merged 8 commits intosecureblue:livefrom
HastD:set-kargs

Conversation

@HastD
Copy link
Copy Markdown
Collaborator

@HastD HastD commented Oct 21, 2025

  • 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, and also port them to Python and make them read from the corresponding file in kargs.d.

@HastD HastD requested a review from RoyalOughtness as a code owner October 21, 2025 23:15
@HastD HastD force-pushed the set-kargs branch 2 times, most recently from 81194e4 to 50ba340 Compare November 5, 2025 16:58
HastD added 4 commits November 6, 2025 12:40
* 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.
@HastD HastD requested a review from RoyalOughtness November 6, 2025 20:38
@RoyalOughtness RoyalOughtness enabled auto-merge (squash) November 7, 2025 20:18
@RoyalOughtness RoyalOughtness merged commit 2154bbb into secureblue:live Nov 7, 2025
18 checks passed
@HastD HastD deleted the set-kargs branch November 7, 2025 20:20
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.

3 participants