diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index 73ec30a8a..8e5b51208 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -567,8 +567,7 @@ spec: runAsUser: 2016 runAsGroup: 2016 capabilities: - drop: - - ALL + drop: ["ALL"] volumeMounts: - mountPath: /var/lib/rook name: rook-config diff --git a/deploy/examples/toolbox.yaml b/deploy/examples/toolbox.yaml index 33fd4cbe0..3a0832590 100644 --- a/deploy/examples/toolbox.yaml +++ b/deploy/examples/toolbox.yaml @@ -91,6 +91,8 @@ spec: runAsNonRoot: true runAsUser: 2016 runAsGroup: 2016 + capabilities: + drop: ["ALL"] env: - name: ROOK_CEPH_USERNAME valueFrom: diff --git a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin.yaml b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin.yaml index 5acee93d1..58c86496b 100644 --- a/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin.yaml +++ b/pkg/operator/ceph/csi/template/cephfs/csi-cephfsplugin.yaml @@ -33,6 +33,8 @@ spec: # created by privileged CSI driver container. securityContext: privileged: true + capabilities: + drop: ["ALL"] image: {{ .RegistrarImage }} imagePullPolicy: {{ .ImagePullPolicy }} args: @@ -54,6 +56,7 @@ spec: privileged: true capabilities: add: ["SYS_ADMIN"] + drop: ["ALL"] allowPrivilegeEscalation: true image: {{ .CSIPluginImage }} args: @@ -123,6 +126,8 @@ spec: - name: liveness-prometheus securityContext: privileged: true + capabilities: + drop: ["ALL"] image: {{ .CSIPluginImage }} args: - "--type=liveness" diff --git a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml index e13c6d1b4..2572a205e 100644 --- a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml +++ b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml @@ -31,6 +31,8 @@ spec: # non-privileged sidecar containers cannot access unix domain socket # created by privileged CSI driver container. securityContext: + capabilities: + drop: ["ALL"] privileged: true image: {{ .RegistrarImage }} imagePullPolicy: {{ .ImagePullPolicy }} @@ -54,6 +56,7 @@ spec: capabilities: add: - SYS_ADMIN + drop: ["ALL"] privileged: true args: - "--nodeid=$(NODE_ID)" diff --git a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml index 1db1a5c80..42435494f 100644 --- a/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml +++ b/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin.yaml @@ -38,6 +38,8 @@ spec: # created by privileged CSI driver container. securityContext: privileged: true + capabilities: + drop: ["ALL"] image: {{ .RegistrarImage }} imagePullPolicy: {{ .ImagePullPolicy }} args: @@ -59,6 +61,7 @@ spec: privileged: true capabilities: add: ["SYS_ADMIN"] + drop: ["ALL"] allowPrivilegeEscalation: true image: {{ .CSIPluginImage }} args : @@ -148,6 +151,8 @@ spec: - name: csi-addons securityContext: privileged: true + capabilities: + drop: ["ALL"] image: {{ .CSIAddonsImage }} args : - "--node-id=$(NODE_ID)" @@ -188,6 +193,8 @@ spec: - name: liveness-prometheus securityContext: privileged: true + capabilities: + drop: ["ALL"] image: {{ .CSIPluginImage }} args: - "--type=liveness"