Initialising secure session0%
PITOWINGS — Secure Everywhere

Container Security

Kubernetes and Container Security: A Practical Hardening Checklist

Kubernetes ships optimised for getting started, not for staying secure. These are the defaults to change first.

PWPITOWINGS Research10 min read

Kubernetes makes deployment fast, and its defaults favour working over secure. A container running as root, a service account with cluster-wide rights and a flat pod network is a common starting point, and a gift to anyone who compromises a single pod.

Build: secure the image

  • Use minimal, trusted base images and rebuild them regularly.
  • Scan images for vulnerabilities and secrets in CI, and block critical findings.
  • Sign images and verify signatures at admission.
  • Never bake secrets into images or environment variables in plain text.

Deploy: secure the cluster

AreaHardening
Pod securityEnforce the restricted Pod Security Standard: non-root, read-only root filesystem, no privilege escalation
RBACLeast-privilege roles; no cluster-admin for workloads; disable automounting of service account tokens where not needed
NetworkDefault-deny network policies; allow only required pod-to-pod traffic
API serverPrivate endpoint, strong authentication, audit logging on
SecretsExternal secret store or encrypted etcd; rotate regularly

Run: detect what gets through

Runtime detection watches for behaviour that should never happen in a container: a shell spawning in a web pod, unexpected outbound connections, reads of service account tokens. Feed Kubernetes audit logs and runtime alerts into your SIEM so the SOC can see a cluster compromise as it unfolds.

Test your cluster from a compromised pod

Our container security assessments start where an attacker would: inside one workload, trying to reach the rest.

Explore container security testing

Frequently asked questions

What is the biggest Kubernetes security risk?

Over-permissive configuration: privileged containers, broad RBAC permissions and no network policies, which let one compromised pod reach the whole cluster.

What are Pod Security Standards?

Kubernetes' built-in profiles (privileged, baseline and restricted) that define how locked-down pods must be. The restricted profile is the hardened target.

Do containers need antivirus?

Traditional antivirus is a poor fit. Image scanning before deployment and runtime behavioural detection are the effective controls for containers.

PW

PITOWINGS Research

OSCP, CEH and ECES certified testers, SOC analysts and certified forensic investigators at PITOWINGS.

Talk to us
All articles