fix(config): harden kubernetes workload defaults#248
Conversation
There was a problem hiding this comment.
Code Review
This pull request significantly hardens the platform's security posture by implementing default-deny NetworkPolicies across core components, applying Pod Security Admission labels to namespaces, and strengthening container security contexts through non-root execution, read-only filesystems, and seccomp profiles. Additionally, it introduces resource requests/limits and health probes for several services, and transitions Traefik to non-privileged ports. Feedback highlights a potential breaking change regarding the removal of default intra-namespace traffic in managed namespaces. Further security improvements were suggested, including port-level restrictions for Traefik and Sentinel network policies and enabling a read-only root filesystem for the registry.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8202712808
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9e764f6 to
0177aaf
Compare
- Add default-deny NetworkPolicies for traefik, registry, and operator namespaces with scoped allow rules; remove broad HTTP/HTTPS egress from runtime namespace policies and add scoped sentinel + registry egress - Fix PSS labels: registry and mcp-sentinel namespaces use baseline enforce to accommodate hostPath/root-init exceptions; mcp-runtime uses restricted - Harden Traefik with non-root unprivileged ports (8000/8443), read-only rootfs, seccomp RuntimeDefault, forwardedHeaders.insecure=false, and probes - Harden registry deployment with seccomp, readOnlyRootFilesystem, drop ALL, and /tmp emptyDir volume - Add resource defaults and TCP probes to desiredDeployment; ensure same-namespace ingress is always allowed in platform NetworkPolicies - Disable trustForwardHeader on registry and sentinel forwardAuth middlewares Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0177aaf to
8851939
Compare
Summary
Validation
go test ./internal/runtimeapi -count=1fromservices/apikubectl apply --dry-run=clientfor changed raw k8s manifestskubectl apply --dry-run=client -kfor ingress base/http/prod/dev, registry base, and managergit diff --checkNotes
kube-linterwas not installed in the local environment, so that optional lint pass was not run.