Skip to content

[Feature] Add securityContext to de default deployment from the operator. #737

@BobVanB

Description

@BobVanB

Describe the solution you'd like
We use common policies in our cluster, like:

  • capabilities.drop: ALL
  • runAsNonRoot: false
  • resourceLimits: must exists
  • allowPrivilegeEscalation: false

This feature request is for adding default securityContext to the deployment that the operator makes or add a parameter in the values.yaml that will add a securityContext.

securityContext:
  capabilities:
    drop:
    - ALL

For the helm deployment we also add allowPrivilegeEscalation

securityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
    - ALL

It would be nice if the containers started with the operator are least priviliged possible, to minimize the attack surface of a container.

Describe alternatives you've considered

tridentctl
Currently we use tridentctl to deploy. But where not happy with the way of upgrading.
We have kustomize patch files for this.

Additional context

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: trident-csi
spec:
  template:
    spec:
      containers:
      - name: trident-main
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: driver-registrar
        securityContext:
          capabilities: {drop: ["ALL"]}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: trident-csi
spec:
  template:
    spec:
      containers:
      - name: trident-main
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: trident-autosupport
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: csi-provisioner
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: csi-attacher
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: csi-resizer
        securityContext:
          capabilities: {drop: ["ALL"]}
      - name: csi-snapshotter
        securityContext:
          capabilities: {drop: ["ALL"]}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions