dongjoon-hyun opened a new pull request, #710: URL: https://github.com/apache/spark-kubernetes-operator/pull/710
### What changes were proposed in this pull request? Add a `SecurityContextDecorator` that sets each container's `securityContext.allowPrivilegeEscalation` to `false` when it is unset, and apply it to the operator-created Pods: - driver Pod (`SparkApplication`) in `SparkAppResourceSpecFactory` - master/worker `StatefulSet`s (`SparkCluster`) in `SparkClusterResourceSpecFactory` It only fills in the value when null, so a value the user set explicitly is preserved. Executor Pods (created by the Spark driver, not the operator) are out of scope. ### Why are the changes needed? An unset `allowPrivilegeEscalation` is treated as `true` by Kubernetes, which violates the Pod Security Standards "restricted" profile. Defaulting it to `false` hardens operator-created Pods by default. ### Does this PR introduce _any_ user-facing change? Yes. Driver/master/worker containers now get `securityContext.allowPrivilegeEscalation: false` when the user did not set it. An explicitly set value (e.g. `true`) is kept. ### How was this patch tested? Added `SecurityContextDecoratorTest` (unset, partially-set, explicit-value-preserved, init containers, `StatefulSet`, non-Pod no-op). `gradle build` passes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
