diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bd6f8d88..4fd40a4b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ All notable changes to this project will be documented in this file. - All pods now set `securityContext.seccompProfile.type` to `RuntimeDefault` ([#1043]). - Support Vector 0.58.0 ([#1039], [#1044], [#1046]). - test: Update OPA to 1.20.2 in integration tests and docs example ([#1042]). +- The operator Deployment runs with a restricted security context and a read-only root filesystem, so it can be deployed into namespaces that enforce the `restricted` Pod Security Standard ([#1049]). ### Fixed @@ -97,6 +98,7 @@ All notable changes to this project will be documented in this file. [#1044]: https://github.com/stackabletech/kafka-operator/pull/1044 [#1046]: https://github.com/stackabletech/kafka-operator/pull/1046 [#1047]: https://github.com/stackabletech/kafka-operator/pull/1047 +[#1049]: https://github.com/stackabletech/kafka-operator/pull/1049 ## [26.7.0] - 2026-07-21 diff --git a/deploy/helm/kafka-operator/values.schema.json b/deploy/helm/kafka-operator/values.schema.json index c282f2082..9c00f09fd 100644 --- a/deploy/helm/kafka-operator/values.schema.json +++ b/deploy/helm/kafka-operator/values.schema.json @@ -115,13 +115,26 @@ "title": "Pod security context", "description": "Pod-level security context for the operator pod, for example fsGroup. Passed through to Kubernetes unchanged. Applies to the operator pod only.", "type": "object", - "default": {} + "default": { + "runAsNonRoot": true, + "seccompProfile": { + "type": "RuntimeDefault" + } + } }, "securityContext": { "title": "Container security context", "description": "Container-level security context for the operator container, for example readOnlyRootFilesystem or runAsNonRoot. Passed through to Kubernetes unchanged. Applies to the operator container only.", "type": "object", - "default": {} + "default": { + "allowPrivilegeEscalation": false, + "capabilities": { + "drop": [ + "ALL" + ] + }, + "readOnlyRootFilesystem": true + } }, "resources": { "title": "Resource requests and limits", @@ -265,14 +278,14 @@ }, "fileLog": { "title": "File logs", - "description": "Writes logs to /stackable/logs inside the container.", + "description": "Writes logs to /var/log/kafka-operator inside the container, on an emptyDir volume.", "type": "object", "additionalProperties": false, "properties": { "enabled": { "type": "boolean", "default": false, - "description": "Whether the operator also writes logs to /stackable/logs inside the container. Off by default: it needs a volume to be useful, otherwise the logs vanish with the pod." + "description": "Whether the operator also writes logs to /var/log/kafka-operator inside the container. Off by default. The logs survive container restarts but not the Pod." }, "level": { "title": "File log level", diff --git a/deploy/helm/kafka-operator/values.yaml b/deploy/helm/kafka-operator/values.yaml index 2c5947ee6..65e3636e8 100644 --- a/deploy/helm/kafka-operator/values.yaml +++ b/deploy/helm/kafka-operator/values.yaml @@ -37,16 +37,21 @@ podAnnotations: {} labels: stackable.tech/vendor: Stackable -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 +# Satisfies the restricted Pod Security Standard. +# Already standard on OpenShift. +podSecurityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + +securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + # Not part of the restricted profile. + # Anything the operator writes has to go to a mounted volume. + readOnlyRootFilesystem: true resources: limits: