Skip to content

Commit 010517c

Browse files
stuggiclaude
andcommitted
Set readOnlyRootFilesystem on service operator controller-manager containers
Harden the manager container securityContext by adding readOnlyRootFilesystem: true and dropping ALL capabilities. Mount an emptyDir at /tmp to support controller-runtime cert auto-generation and Go stdlib temporary file needs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Martin Schuppert <mschuppert@redhat.com>
1 parent 65db3ba commit 010517c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎bindata/operator/managers.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ spec:
6767
memory: {{ .Deployment.Manager.Resources.Requests.Memory }}
6868
securityContext:
6969
allowPrivilegeEscalation: false
70+
capabilities:
71+
drop:
72+
- "ALL"
73+
readOnlyRootFilesystem: true
7074
volumeMounts:
75+
- mountPath: /tmp
76+
name: tmp
7177
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
7278
- mountPath: /tmp/k8s-webhook-server/serving-certs
7379
name: cert
@@ -99,6 +105,8 @@ spec:
99105
{{- end }}
100106
{{- end }}
101107
volumes:
108+
- emptyDir: {}
109+
name: tmp
102110
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
103111
- name: cert
104112
secret:

‎config/operator/managers.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ spec:
6767
memory: {{ .Deployment.Manager.Resources.Requests.Memory }}
6868
securityContext:
6969
allowPrivilegeEscalation: false
70+
capabilities:
71+
drop:
72+
- "ALL"
73+
readOnlyRootFilesystem: true
7074
volumeMounts:
75+
- mountPath: /tmp
76+
name: tmp
7177
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
7278
- mountPath: /tmp/k8s-webhook-server/serving-certs
7379
name: cert
@@ -99,6 +105,8 @@ spec:
99105
{{- end }}
100106
{{- end }}
101107
volumes:
108+
- emptyDir: {}
109+
name: tmp
102110
{{- if isEnvVarTrue .Deployment.Manager.Env "ENABLE_WEBHOOKS" }}
103111
- name: cert
104112
secret:

0 commit comments

Comments
 (0)