Repository navigation
fix(security): RuntimeDefault seccomp for all AI Pod workloads (CCF-18300 FR3) - #294
kbhos-splunk wants to merge 5 commits into
Conversation
…pprof PSB SEC-RUN-ASLR (CCF-18300), FR3 and FR4. FR3: ASLR must not be disabled. The Ray head and worker pods ran with no seccomp profile (Seccomp: 0 on the splunk-ai lab), so any process in them could start a program without ASLR with "setarch -R" (personality ADDR_NO_RANDOMIZE). The raybuilder now sets the pod seccompProfile to RuntimeDefault, which rejects that call. On OpenShift the built-in anyuid SCC allows no seccomp profile, so these pods would fall through to restricted-v2 and get a random UID. The OpenShift installer now creates splunk-ai-anyuid-seccomp, a copy of anyuid that also allows runtime/default, grants it to the AI namespace, and removes it in clean-all when it created it. It keeps the anyuid priority and sorts after anyuid by name, so pods without a seccomp profile still get anyuid. FR4: no address leaks. - Delete internal/controller/debug. No code imports it; it registered the net/http/pprof handlers. - Start Splunk Operator 3.0.0 with --pprof=false. Its --pprof flag defaults to true, so removing the flag would not turn pprof off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSB SEC-RUN-ASLR (CCF-18300), FR3: ASLR must not be disabled. #293 set seccompProfile RuntimeDefault on the Ray pods only. On the splunk-ai lab every other pod that the operator creates also ran with no seccomp profile under anyuid: SAIA v1, SAIA v2, SAIA v2 worker, SAIA NGINX, the vector DB setup job, SLIM and Weaviate. In these pods any process could start a program without ASLR with "setarch -R". - New package pkg/ai/podsecurity with RuntimeDefaultSeccomp(). The Ray, SAIA, SLIM, SECA and Weaviate pod templates use it. The pod-level profile also covers init containers and injected sidecars (KubeRay autoscaler, OpenTelemetry collector). - OpenShift installer: the SCC from #293 now serves all AI workload pods, so RAY_SECCOMP_SCC and its helpers become AI_SECCOMP_SCC, ai_seccomp_scc_manifest and ensure_ai_seccomp_scc. The SCC name splunk-ai-anyuid-seccomp does not change. #293 is not released, so no installed cluster has the old ownership keys. - The OpenShift readme lists the workloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| // Propagate imagePullSecrets from AIPlatform spec | ||
| sts.Spec.Template.Spec.ImagePullSecrets = instance.Spec.Images.ImagePullSecrets | ||
| // PSB SEC-RUN-ASLR: no process in the pod can turn ASLR off. | ||
| sts.Spec.Template.Spec.SecurityContext = podsecurity.RuntimeDefaultSeccomp() |
There was a problem hiding this comment.
[P2] Preserve Weaviate's existing pod security settings
This assignment replaces the whole PodSecurityContext. Existing StatefulSets previously kept fields such as fsGroup, run-as IDs, and SELinux settings through reconciliation. In particular, dropping a custom fsGroup can take away Weaviate's write access to a preexisting PVC. Please initialize the context if needed, update only SeccompProfile, and cover preservation of an existing fsGroup in the regression test.
vvarshney-splunk
left a comment
There was a problem hiding this comment.
Reposting the CCF-18300 inline findings under my Splunk account.
| // Propagate imagePullSecrets from AIPlatform spec | ||
| sts.Spec.Template.Spec.ImagePullSecrets = instance.Spec.Images.ImagePullSecrets | ||
| // PSB SEC-RUN-ASLR: no process in the pod can turn ASLR off. | ||
| sts.Spec.Template.Spec.SecurityContext = podsecurity.RuntimeDefaultSeccomp() |
There was a problem hiding this comment.
[P2] Preserve Weaviate's existing pod security settings
This assignment replaces the whole PodSecurityContext. Existing StatefulSets previously kept fields such as fsGroup, run-as IDs, and SELinux settings through reconciliation. In particular, dropping a custom fsGroup can take away Weaviate's write access to a preexisting PVC. Please initialize the context if needed, update only SeccompProfile, and cover preservation of an existing fsGroup in the regression test.
…ants Review of #293 (CCF-18300, PSB SEC-RUN-ASLR FR3). - The installer now creates splunk-ai-anyuid-seccomp-<AI namespace>, one SCC for each AI namespace, with the grant inside the SCC. The ownership state is per AI namespace, but the SCC had one cluster-wide name, so clean-all of one installation deleted an SCC that another installation used. - If the SCC already exists, the installer compares its security settings with anyuid plus runtime/default. If they are different, the installer stops with an error and does not grant the SCC. - ensure_owned_scc_group also finds a grant in a ClusterRoleBinding to the system:openshift:scc:<scc> role. oc adm policy add-scc-to-group stores grants there (seen on the splunk-ai lab, OpenShift 4.21), so the check of only .groups marked an administrator's grant as installer owned, and clean-all removed it. - load_config keeps an explicit openshift.grantPrivilegedSCC: false. The yq "//" operator also replaces a YAML boolean false, so the documented opt-out did not work and the installer still granted the SCCs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-fr3-seccomp-all-pods Bring the review fixes of #293 into this branch: one seccomp SCC for each AI namespace, a settings check for an existing SCC, SCC grants found through RBAC, and an explicit openshift.grantPrivilegedSCC: false that is kept. The conflicts are only the names that this branch changed (AI_SECCOMP_SCC, ensure_ai_seccomp_scc, scc_ai_seccomp_*). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #294 (CCF-18300, PSB SEC-RUN-ASLR FR3). The operator updates the Weaviate StatefulSet one field at a time, and it did not set the pod security context before. The PR replaced the full context, so a reconcile removed values that an administrator set, for example an fsGroup that gives Weaviate write access to an existing PVC. The operator now sets only the seccomp profile and keeps the other fields. A new test sets fsGroup, runAsUser, SELinux options and an Unconfined profile on an existing StatefulSet: after a reconcile, only the profile changes, to RuntimeDefault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
PSB SEC-RUN-ASLR (CCF-18300), FR3: ASLR must not be disabled.
Depends on #293. This branch starts from #293, so the PR shows both commits until #293 merges. Review only the last commit,
6e0f5b6. Merge #293 first.#293 set
seccompProfile: RuntimeDefaulton the Ray pods only. On the splunk-ai lab (2026-11-26), every other pod that the operator creates also ran with no seccomp profile underanyuid. In these pods any process could start a program without ASLR withsetarch -R.pkg/ai/features/saia/impl.goanyuid, no profilepkg/ai/features/saia/impl.goanyuid, no profilepkg/ai/features/slim/impl.goanyuid, no profilepkg/ai/weaviate.goanyuid, no profilepkg/ai/features/seca/impl.goChanges
pkg/ai/podsecuritywithRuntimeDefaultSeccomp(). The Ray, SAIA, SLIM, SECA and Weaviate pod templates use it. The pod-level profile also covers init containers and injected sidecars (the KubeRay autoscaler and the OpenTelemetry collector).RAY_SECCOMP_SCCand its helpers becomeAI_SECCOMP_SCC,ai_seccomp_scc_manifestandensure_ai_seccomp_scc. The SCC namesplunk-ai-anyuid-seccompdoes not change. fix(security): Ray pods with RuntimeDefault seccomp, pprof off (CCF-18300) #293 is not released, so no installed cluster has the old ownership keys.Pods from other operators already use RuntimeDefault: the Splunk AI Operator manager, KubeRay, Splunk standalone and the Splunk Operator.
Test plan
go build ./...,go vet ./pkg/ai/...,go test ./pkg/... ./internal/... ./cmd/...pass. New tests check the pod templates of SAIA (all 5), SLIM, SECA, Weaviate and Ray.test_openshift_with_stack.sh: 343 passed, 0 failed.Lab server dry-run of all 10 AI Pod pods without the new SCC: with RuntimeDefault, every pod falls to
restricted-v2withrunAsUser: 1000760000. This shows that all of them need the SCC, not only Ray.Lab server dry-run of all 10 AI Pod pods with the SCC (splunk-ai, OCP 4.21, 2026-11-26 12:42 UTC, branch at 6e0f5b6), as the controller that creates each pod (KubeRay, ReplicaSet, StatefulSet and Job controllers): 10 passed, 0 failed. Each pod gets
anyuidwithout a profile andsplunk-ai-anyuid-seccompwith RuntimeDefault, with the image UID and the same container security settings. The test SCC was deleted after the test.Full AI Pod deployment on OpenShift (splunk-ai, OCP 4.21, 2026-11-26) with the operator built in the cluster from 6e0f5b6 (fix(security): RuntimeDefault seccomp for all AI Pod workloads (CCF-18300 FR3) #294 on top of fix(security): Ray pods with RuntimeDefault seccomp, pprof off (CCF-18300) #293; PIE build check passed):
splunk-ai-anyuid-seccompwith RuntimeDefault, UID from the imageSeccomp: 2in Ray head and workers, SAIA v1, v2, v2 worker, NGINX, SLIM and Weaviatepersonality(ADDR_NO_RANDOMIZE)(setarch -Ror Python ctypes)/gemma4_31b_it/v1/chat/completionsfrom the SAIA v2 pod: HTTP 200, answerParis, 3.1 sprivileged(it adds NET_BIND_SERVICE), not the new SCCNot covered: the SAIA chat flow through Splunk (needs a Splunk JWT), and a re-run of the vector DB setup Job (the operator does not recreate a completed Job; its template is covered by the dry-run and unit tests). After the test the lab was rolled back to v1.0, and the test SCC and build were removed.
🤖 Generated with Claude Code