Insights · Cloud & Platform
A Kubernetes security baseline for regulated workloads
By the Cystem X Engineering Team - Published - 5 min read
In this article
Kubernetes is flexible by design, which means a default cluster is not a secure cluster. A baseline defines the minimum set of controls every production cluster should have, so that security does not depend on each team remembering the same details. This article outlines the baseline we apply to regulated workloads.
Secure the control plane
The API server is the front door to the cluster. Restrict network access to it, require strong authentication, disable anonymous access and enable audit logging. Keep the control plane and nodes patched, and subscribe to upstream security announcements.
Managed Kubernetes services handle some of this, but configuration choices such as endpoint exposure and authentication integration remain your responsibility.
Use least-privilege RBAC
Grant access through roles scoped to namespaces rather than cluster-wide administrator rights. Bind roles to groups from your identity provider so access follows joiner and leaver processes.
Review bindings regularly and avoid wildcard permissions. Service accounts should have only the permissions the workload actually needs, and tokens should not be mounted where not required.
A secure cluster is one where the safe configuration is the default configuration.
Control traffic with network policy
By default, pods can talk to every other pod. Adopt a default-deny policy per namespace and add explicit allow rules for known flows. This contains compromise and documents how the application is meant to communicate.
Choose a network plugin that enforces policy and supports visibility, so you can see denied traffic and tighten rules safely.
Enforce pod security standards
Prevent containers from running as root, from using privileged mode, from mounting the host file system and from gaining extra capabilities. Kubernetes Pod Security Standards define profiles for this, and admission controllers can enforce them.
Adopt the restricted profile for most workloads and document exceptions with an owner and an expiry.
Manage secrets carefully
Kubernetes secrets are base64 encoded, not encrypted by default. Enable encryption at rest, limit who can read secrets and prefer integration with an external secrets manager that provides rotation and audit.
Never bake secrets into images or commit them to repositories. Scan for them in pipelines.
Secure the supply chain
Pull images only from trusted registries, scan them for vulnerabilities, sign them and verify signatures at admission. Use minimal base images to reduce attack surface and rebuild regularly to pick up patches.
Pin versions by digest so that what you tested is what runs.
Monitor runtime behavior
Collect audit logs, node logs and workload logs centrally. Add runtime detection that alerts on unexpected process execution, shell access in containers and sensitive file access.
Measure your configuration against the CIS Kubernetes Benchmark continuously, and treat drift as a defect to be fixed.
Key takeaways
- Restrict and audit access to the API server.
- Use namespace-scoped RBAC bound to identity provider groups.
- Adopt default-deny network policy and the restricted pod security profile.
- Encrypt secrets and use an external manager for rotation.
- Sign and verify images and monitor runtime behavior against the CIS benchmark.
Sources and further reading
This article reflects general practice and publicly available guidance. Teams should consult primary sources, including the CIS Kubernetes Benchmark, the Kubernetes documentation on security and Pod Security Standards, and NIST SP 800-190 on container security, and adapt the guidance to their own environment, risk appetite and legal obligations.
Keep reading
More engineering guidance from the Cystem X team.
Cloud & Platform
Designing DevSecOps pipeline gates that developers will not bypass
Which checks belong in CI/CD, where to run them, and how to keep them fast enough to be trusted.
Read articleCloud & Platform
Software supply chain security: SBOMs, provenance and SLSA
Know what is in your software and where it came from: SBOMs, signing, provenance and SLSA.
Read articleCloud & Platform
Chaos engineering: testing resilience on purpose
Inject failure deliberately, with hypotheses and safeguards, to find weaknesses before customers do.
Read articleDevSecOps & Platform Engineering
Harden your clusters with a repeatable baseline.
Our platform engineers build and operate hardened Kubernetes environments in cloud, on-premises and air-gapped settings.
Explore DevSecOps & Platform Engineering