feat(common)!: security context to allow CIS compliance - #5
Open
id710 wants to merge 1 commit into
Open
Conversation
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.
Solves mlflow-oidc/helm#11
Summary
Extend the
commonlibrary chart with full pod-level and container-levelsecurity context support, enabling dependent charts to meet the Kubernetes
Restricted Pod Security Standard and CIS Kubernetes Benchmark controls.
Motivation
Previously the
common.security.contexthelper only rendered four pod-levelfields (
runAsUser,runAsGroup,fsGroup,runAsNonRoot) and there was nocontainer-level security context anywhere in the rendering chain. It was
impossible to set
seccompProfileat the pod level, orallowPrivilegeEscalation,capabilities.drop, andreadOnlyRootFilesystematthe container level.
Changes
Pod-level (
common.security.context)seccompProfilesupport (passed through viatoYaml, solocalhostProfileis supported too).runAsUser: 1001,runAsGroup: 1001,fsGroup: 1001,runAsNonRoot: true).Container-level (
common.security.containerContext).Values.containerSecurityContextisset (opt-in, so existing deployments are not affected).
allowPrivilegeEscalationdefaults tofalsereadOnlyRootFilesystemdefaults totruerunAsNonRoot/runAsUserfall back to the pod-level valuesseccompProfilefalls back to the pod-level valueBumped library version
2.3.0→2.4.0.Example