Images, runtime privileges, network policies and secrets. The six settings that deliver the most protection in a containerised environment.
A container is not a security boundary. Worth establishing up front, because many decisions rest on the opposite assumption: container isolation is materially weaker than a virtual machine's, and container escape is a real risk.
This list focuses on what covers the most common mistakes.
A base image containing a full distribution brings hundreds of packages with their own vulnerabilities, none of which the application needs.
latest tagWe covered this in detail in our software dependencies article.
By default the process in a container is root. If an escape vulnerability exists, it becomes root on the host too.
runAsNonRoot: true with a specific userallowPrivilegeEscalation: falseFour lines of configuration covering most of the escape risk.
By default in Kubernetes every pod reaches every pod. This is the same flat network problem as in traditional infrastructure, at smaller scale.
Deny by default, then permit at namespace and application level. Restricting egress matters too, because it impedes command-and-control channels.
A secret baked into the container or passed via environment variables is visible in several places: image layers, the process list, logs.
The answer is an external secrets manager the container reads at runtime. Kubernetes' built-in secret object is only base64-encoded rather than encrypted by default, so encryption at rest must be enabled separately.
The Kubernetes API is the most valuable target: every resource is reachable from it.
cluster-admin for everyonekubeconfig files handled as strictly as any admin credentialThe admission controller is the last gate between build and runtime: here you can prevent privileged containers, unsigned images or pods without resource limits from starting.
First in audit mode to see what would fail, and only then blocking.
Host hardening. Containers use the host kernel. If that is not in order, neither is the container. Our Linux hardening article applies here too.
Resource limits. Without limits a runaway container takes down the whole node. This is an availability and a security question.
Logging. Containers are short-lived; logs must outlive them. Without central collection there is nothing to investigate after an incident.
Our IT security services include reviewing the security of containerised environments.
SSH configuration, privileges, service minimisation and logging. The eight steps that deliver the most…
Most of a modern application is third-party code. How to know what is in it, and what to do when a…
You do not need a full DevSecOps programme. Which five steps deliver the most protection in development,…
Our specialists are happy to discuss what this means in your organisation's environment.