feat(security): enforce restricted security context defaults for all workloads - #616
Draft
aslafy-z wants to merge 3 commits into
Draft
feat(security): enforce restricted security context defaults for all workloads#616aslafy-z wants to merge 3 commits into
aslafy-z wants to merge 3 commits into
Conversation
aslafy-z
force-pushed
the
feat/non-root-default-hardening
branch
from
August 19, 2026 15:05
4d420d8 to
bf57e11
Compare
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
aslafy-z
force-pushed
the
feat/non-root-default-hardening
branch
from
August 19, 2026 15:08
bf57e11 to
c250b4b
Compare
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.
What changed
Hardens the chart's default security posture so every workload the chart renders satisfies the Kubernetes restricted Pod Security Standard out of the box.
The restricted container security context applied by default everywhere:
Deployment
deployment.containerSecurityContext(app container) now also setsallowPrivilegeEscalation: falseand drops all capabilities.deployment.securityContext(pod level) defaults toseccompProfile.type: RuntimeDefault, inherited by all containers.additionalContainers(map and list forms) inheritdeployment.containerSecurityContextunless they define their ownsecurityContext.deployment.openshiftOAuthProxy.containerSecurityContextvalue applies the restricted context to the OAuth proxy sidecar, which previously rendered without anysecurityContext.Jobs and CronJobs
job.securityContext/cronJob.securityContext(pod level, runtime default seccomp profile) andjob.containerSecurityContext/cronJob.containerSecurityContext(restricted container context) apply to every job.securityContext/containerSecurityContextvalues override the chart-level defaults, preserving the existing per-job API.securityContext.values.schema.jsonand the README parameter table are regenerated accordingly.Why
Closes #34. The chart already defaulted to
runAsNonRoot: trueandreadOnlyRootFilesystem: truefor the app container, but as noted in the issue discussion, permissions should also be dropped by default. Jobs, CronJobs, init containers, additional containers, and the OAuth proxy sidecar previously rendered with no security context at all.User-visible effects
securityContext/containerSecurityContextfully replaces the corresponding default block, so existing customizations are unaffected.securityContextblocks are now always rendered. User-provided keys merge with the seccomp default per Helm value merging.USER, sorunAsNonRoot: truerelies on the SCC-injected UID, which is standard on OpenShift.Validation
helm unittest: 403 tests pass, including new tests covering the restricted defaults and per-container overrides for the deployment (app, init, additional, and OAuth proxy containers), Jobs, and CronJobs.helm lintpasses.