IGN-15040: Enhance Security Context Defaults#9
Merged
thirdgen88 merged 4 commits intoApr 20, 2026
Merged
Conversation
previous isSubset assertions could allow additional leaked values to pass the tests where that wasn’t the intent.
Functionally equivalent for our Docker image (which is already defaulting to UID 2003/2003).
Member
Author
|
With 9e25f82 in place, this deploys successfully on OpenShift Local within the default |
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.
📖 Background
The existing defaults for the Ignition Helm Chart already enforced non-root execution, but it didn't harden container-level security context configuration any further. As a result, custom values overrides were required to successfully deploy into namespaces with "restricted" Pod Security Standards profile.
Since most use cases will fall under the constraints of "restricted" profile, let's adjust the defaults.
⚙️ Changes
This PR refactors the existing application of pod-level security context configuration to a shared helper template to reduce duplication. We also introduce
gateway.securityContextandgateway.preconfigure.securityContextvalues that default to the following (via another new shared helper template):The shared helper templates also introduce the ability to omit the
securityContextfields altogether by overriding the associated values definitions to "null". This shouldn't ever be needed but was simple enough to add as a capability along with unit test coverage.A fix was applied to the Gateway Network and Web Server TLS certificate rotation jobs where a custom
podSecurityContextvalues override was in place. The previous configuration produced incorrectly indented YAML in this configuration and errored out. Unit tests for the aforementioned CronJob resources were added.Finally, during implementation, I noticed that many of the unit tests were using
isSubsetinstead ofequalassertions. This could allow extra unintended values to slip past the tests. Thankfully, I was able to change them out via a7217f9 without any actual Helm Chart changes. These tests are now hardened up for the future.📝 Reviewer Notes
The primary changes are in 928b63b and 774758b. As mentioned above, a7217f9 is just unit test hardening and doesn't impact the Helm Chart rendering at all.
☑️ QA Notes
We'll want to test a standard install to make sure that the defaults still run as expected.
For testing the new compatibility with "restricted" Pod Security Standards profile, create a dedicated namespace with enforcement enabled, e.g.:
Installing the existing version of the chart will fail to create the pods. Upgrading or fresh install of the PR build chart should work as expected.
@thirdgen88 can also spin this up in an OpenShift Local cluster and make sure there are no surprises there either.
Fixes IGN-15040