[WIP] Make FIPS activation runtime-conditional on fips=1 kernel param#908
Open
sparrc wants to merge 1 commit into
Open
[WIP] Make FIPS activation runtime-conditional on fips=1 kernel param#908sparrc wants to merge 1 commit into
sparrc wants to merge 1 commit into
Conversation
Move FIPS-related systemd units and drop-ins from the release-fips subpackage into the base release package so they ship in all variants. These units already use ConditionKernelCommandLine=fips=1 or depend on fipscheck.target, so they are no-ops on non-FIPS boots. Replace the unconditional Environment=GODEBUG=fips140=on drop-in with an EnvironmentFile=-/run/fips-go.env approach: a new service copies the env file into /run only when fips=1 is set. Similarly, replace the tmpfiles-based /etc/system-fips creation with a conditional service. The bootconfig snippet and FIPS binary overlay mounts remain in the fips subpackage since they require build-time binary selection. Assisted-by: Cline:anthropic.claude-opus-4-6-v1 Signed-off-by: Cameron Sparr <sparrc@users.noreply.github.com>
sky1122
reviewed
May 5, 2026
| @@ -0,0 +1,13 @@ | |||
| [Unit] | |||
Contributor
There was a problem hiding this comment.
can you add a comment on why do we need this /etc/system-fips marker file?
like the one include in here
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.
The overall purpose of this change is to include most FIPS logic in all BR variants, and to standardize on all of the systemd services only being activated with
ConditionKernelCommandLine=fips=1, as some already are:bottlerocket-core-kit/packages/release/check-kernel-integrity.service
Line 9 in 748058e
This gets closer to the "standard" BR AMI being able to be used in FIPS environments, only needing a runtime switch to activate FIPS mode like the following userdata:
Description of changes:
Move FIPS-related systemd units and drop-ins from the release-fips subpackage into the base release package so they ship in all variants. These units already use ConditionKernelCommandLine=fips=1 or depend on fipscheck.target, so they are no-ops on non-FIPS boots.
Replace the unconditional Environment=GODEBUG=fips140=on drop-in with an EnvironmentFile=-/run/fips-go.env approach: a new service copies the env file into /run only when fips=1 is set. Similarly, replace the tmpfiles-based /etc/system-fips creation with a conditional service.
The bootconfig snippet and FIPS binary overlay mounts remain in the fips subpackage since they require build-time binary selection.
Assisted-by: Cline:anthropic.claude-opus-4-6-v1
Testing done:
WIP
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.