Skip to content

feat(security-context): add drop-all-and-add helper with RuntimeDefault seccomp - #229

Merged
AndreyPavlovFlant merged 1 commit into
mainfrom
feat/container-security-context-drop-all-and-add-runtime-default
Oct 28, 2026
Merged

AndreyPavlovFlant merged 1 commit into
mainfrom
feat/container-security-context-drop-all-and-add-runtime-default

Conversation

@tarabrind

Copy link
Copy Markdown
Member

What

Adds helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default.

It returns the same securityContext as helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add, plus seccompProfile: RuntimeDefault:

securityContext:
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop:
    - ALL
    add: [...]
  seccompProfile:
    type: RuntimeDefault

Why

Containers that must run as root with extra capabilities currently have no helper that also sets the RuntimeDefault seccomp profile:

  • *_drop_all_and_add has no seccompProfile, so modules append it by hand after the include.
  • *_pss_restricted_flexible sets seccompProfile, but for root (runAsNonRoot: false) it sets allowPrivilegeEscalation: true, which weakens the context.
  • A pod-level seccompProfile cannot be combined with the pod security context helpers, as each of them emits its own securityContext block.

The first user is hubble-relay in the cilium-hubble module of Deckhouse (root with DAC_OVERRIDE).

Changes

  • The helper in charts/helm_lib/templates/_module_security_context.tpl.
  • A unit test in tests/templates and tests/tests.
  • charts/helm_lib/README.md regenerated with make doc/build.
  • Chart version 1.72.32 -> 1.72.33.

Testing

make tests/unit: 88 suites, 457 tests passed, including the new one.

…lt seccomp

Add helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default.
It returns the same securityContext as the existing *_drop_all_and_add helper
plus seccompProfile RuntimeDefault, for containers that must run as root with
extra capabilities, where pss_restricted_flexible would allow privilege escalation.

Modules no longer have to append seccompProfile by hand after the include.

Signed-off-by: Denis Tarabrin <denis.tarabrin@flant.com>
@tarabrind
tarabrind marked this pull request as ready for review October 28, 2026 13:09
@AndreyPavlovFlant
AndreyPavlovFlant merged commit 3b5cebc into main Oct 28, 2026
4 checks passed
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.

2 participants