Skip to content

[Feature]: Provide good securityContext by default #2533

Closed

Description

@jemag

Describe the current problem

Currently the problem is twofold:

  1. Some securityContext are not configurable by the helm chart.
  2. Several default values for securityContext are not as secure as they should be

For example, the deployment for the gpu-operator has no configurable securityContext and, by default, it is left empty.
It is doubtful that this deployment needs full capabilities, privilege escalation, etc. Hence it would make sense to provide a good security posture out of the box.

Describe the solution you'd like

Allow configuring securityContexts of the different pods that can be deployed through this helm chart. (partially discussed here #2070)
Provide good default for the various securityContext (aka stricted possible while allowing the container to fulfill its role), e.g.:

  securityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
      - ALL
    readOnlyRootFilesystem: true
    runAsGroup: 2000
    runAsNonRoot: true
    runAsUser: 2000
    seccompProfile:
      type: RuntimeDefault

What is the added value?

This would improve the default security out of the box for helm chart users. If the containers currently support it, there isn't much downside to improving the default security.

It also helps clarifying to the end-user that these values are officially supported and will not cause any problem with the containers (e.g.: readOnlyRootFilesystem: true could for example cause problems for containers expecting to write to specific directories). By having them already specified, the end-user does not need to do extensive testing to ensure it does not cause any issue.

Activity

  1. added
    feature
    needs-triage
    on Jun 11, 2026
  2. vishalanarase commented on Jun 29, 2026

    @vishalanarase
    Contributor

    Happy to pick this up.
    /assign

  3. added
    good-first-issue
    enhancement
    help wanted
    and removed
    feature
    needs-triage
    on Aug 31, 2026
  4. rajathagasthya commented on Aug 31, 2026

    @rajathagasthya
    Contributor

    Should probably also the ability to set dnsConfig.

  5. dundysm commented on Sep 1, 2026

    @dundysm

    I'll take this. The June assign looks stale (no PR), so I'm going to:

    • Make securityContext configurable for the operator Deployment and the other chart workloads that still lack it
    • Tighten defaults to the least privilege that still lets each container run (drop ALL, no privilege escalation, read-only root where it actually works, RuntimeDefault seccomp)
    • Add dnsConfig as mentioned above

    I'll open a PR with chart values, templates, and notes on any daemonset that still needs extra capabilities.

  6. added 2 commits that reference this issue on Sep 1, 2026
    4286580
    e29dd96
  7. added 3 commits that reference this issue on Sep 11, 2026
    19ed550
    09022df
    acf5b99
  8. added a commit that references this issue on Sep 14, 2026
    9ca2260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood-first-issuehelp wantedlifecycle/frozen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions