
Short answer: Container security is the practice of protecting containerized applications across their whole lifecycle: the images you build, the registry that stores them, the orchestrator that schedules them, the hosts they run on and their behavior at runtime. It combines image scanning, least privilege, hardened configuration, secrets management and monitoring, enforced automatically in the pipeline.
Related guides: Compliance as code and policy as code · Cloud security controls · Vulnerability management policy
Key takeaways
- Container security covers five layers: image, registry, orchestrator, container runtime and host. A gap in any one of them undermines the others.
- Most problems start at build time. Small base images, pinned versions and scanning in CI remove risk before anything is deployed.
- Containers should run as non-root, without privileged mode, with a read-only filesystem wherever the workload allows it.
- Admission control turns written rules into enforced rules: a workload that breaks policy never starts.
- Auditors do not ask for "container security" by name. They test vulnerability management, change management, access control and monitoring, and containers must produce evidence for each.
What is container security?
Container security is the set of controls that keep container images, the platforms that run them and the workloads inside them free from known vulnerabilities, misconfiguration and unauthorized access.
A container packages an application with its libraries and runs it as an isolated process on a shared host kernel. That design is what makes containers fast and portable, and it is also what makes their security different from virtual machines. Containers share a kernel, so a container that escapes its isolation can reach the host. Images are built from layers that other people published, so you inherit their vulnerabilities. Workloads are short lived, so patching a running container is pointless: you rebuild the image and redeploy.
The standard reference is NIST SP 800-190, Application Container Security Guide. It groups risks into five areas (images, registries, orchestrators, containers and host operating systems) and gives countermeasures for each. That structure is a practical way to organize a program, and the sections below follow it.
What are the main container security risks?
The main risks are vulnerable or untrusted images, weak registry controls, over-permissive orchestrator settings, containers running with more privilege than they need, and unhardened hosts.
| Layer | Typical risk | Example |
|---|---|---|
| Image | Known vulnerabilities, embedded secrets, untrusted base images | An image built months ago still ships a library with a published critical CVE |
| Registry | Insecure connections, stale images, weak authentication | Anyone in the company can push to the production repository |
| Orchestrator | Broad admin access, flat networking, mixed sensitivity workloads | A developer service account holds cluster-admin rights |
| Container | Privileged mode, root user, writable filesystem, unrestricted network | A container mounts the host Docker socket |
| Host | Unpatched kernel, shared kernel exposure, direct logins | Worker nodes run a general-purpose operating system that nobody patches |
Two risks deserve extra attention for small teams. The first is secrets in images: API keys copied into a layer stay in the image history even if a later layer deletes the file. The second is supply chain exposure: a public base image or package can change underneath you. Pinning images by digest and keeping a software bill of materials for each build lets you answer the question "are we affected?" quickly when a new vulnerability is announced.
How do you secure containers at each lifecycle stage?
You secure containers by placing a specific control at each stage (build, registry, deploy and runtime) so that every image is checked before it moves forward.

Build
- Start from a minimal, trusted base image. Fewer packages mean fewer vulnerabilities and a smaller attack surface.
- Pin versions, ideally by image digest, so builds are repeatable.
- Use multi-stage builds so compilers and build tools do not end up in the final image.
- Set a non-root user in the image.
- Scan in CI for vulnerabilities, misconfiguration and secrets, and fail the build above an agreed severity threshold.
Registry
- Use a private registry with authentication and role-based push rights.
- Scan on push and rescan on a schedule, because new vulnerabilities are published against images that were clean yesterday.
- Sign images and record provenance so the deploy stage can verify what it is about to run.
- Remove stale images and tags so old, vulnerable versions cannot be deployed by accident.
Deploy
- Enforce admission policies: only signed images from approved registries, no privileged containers, resource limits required.
- Keep deployment manifests in version control and deploy through the pipeline, not by hand.
- Inject secrets at runtime from a secrets manager. Never bake them into images or commit them to manifests.
Runtime
- Run with a read-only root filesystem and drop Linux capabilities the workload does not need.
- Apply network policies so each service can talk only to the services it depends on.
- Monitor behavior: unexpected processes, outbound connections or file changes in a container are strong signals, because containers are meant to be immutable.
- Rebuild and redeploy to patch. Do not patch running containers.
How do you harden Kubernetes and the orchestrator?
You harden the orchestrator by restricting who can reach the control plane, applying least privilege through role-based access control, isolating workloads and enforcing pod-level security standards.
Kubernetes defines three Pod Security Standards that are a useful baseline:
| Profile | What it means | Typical use |
|---|---|---|
| Privileged | Unrestricted, allows known privilege escalations | System and infrastructure workloads managed by trusted admins |
| Baseline | Minimally restrictive, prevents known privilege escalations | Default for most application workloads |
| Restricted | Heavily restricted, follows current pod hardening practice | Security-critical or internet-facing workloads |
Beyond pod standards, the controls that matter most are:
- Control plane access: do not expose the API server to the internet without restriction, and require strong authentication through your identity provider.
- RBAC: grant namespace-scoped roles, avoid cluster-admin for people and service accounts, and review bindings regularly.
- Namespaces and network policy: separate environments and teams, and default to denying traffic between namespaces.
- Secrets: enable encryption at rest for secrets and prefer an external secrets manager.
- Audit logging: turn on API server audit logs and send them to central log storage.
The CIS Benchmarks include detailed configuration guidance for Docker and Kubernetes, and automated benchmark checks are an efficient way to find gaps.
How does compliance as code apply to containers?
Compliance as code means expressing your container rules as machine-readable policies that are checked automatically in the pipeline and at admission, instead of living only in a document.
Containers suit this approach because everything about them is already declared in files: the Dockerfile, the manifest, the Helm chart, the infrastructure template. A rule such as "containers must not run as root" can be tested in three places:
- In the pull request, by linting Dockerfiles and manifests before merge.
- In CI, by scanning the built image and failing the pipeline when it breaks policy.
- At admission, by a policy controller that rejects non-compliant workloads when they are submitted to the cluster.
Each check produces a record: a pipeline log, a scan report, an admission decision. Those records are evidence. Instead of collecting screenshots before an audit, you show the policy, the commit history that proves it was reviewed, and the results that prove it was enforced over the audit period. For a deeper look at the model, see our guide to compliance as code and policy as code.
How does container security map to compliance frameworks?
No major framework has a dedicated "container" requirement. Container controls satisfy the general requirements for vulnerability management, secure configuration, change control, access and monitoring.
| Framework | Relevant requirements | Container evidence |
|---|---|---|
| SOC 2 (Trust Services Criteria) | CC6.1 logical access, CC6.8 unauthorized or malicious software, CC7.1 vulnerability and configuration monitoring, CC8.1 change management | RBAC bindings, image scan reports, admission policies, pull request approvals |
| ISO 27001:2022 | Annex A 8.8 technical vulnerabilities, 8.9 configuration management, 8.25 secure development life cycle, 8.32 change management | Baseline definitions, scan and remediation records, pipeline history |
| HIPAA Security Rule | Access control and audit controls, risk management | Cluster access lists, audit logs, risk assessment covering container platforms |
| PCI DSS v4.0.1 | Requirement 2 secure configurations, Requirement 6 secure systems and software | Hardening standards, vulnerability remediation within defined timelines |
| NIST SP 800-53 Rev. 5 | CM-2 baseline configuration, CM-6 configuration settings, RA-5 vulnerability monitoring and scanning, SI-2 flaw remediation | Benchmark results, scan cadence, patch records |
In our experience, the finding auditors raise most often is not a missing tool. It is a remediation timeline in the vulnerability management policy that container images do not meet, because nobody rebuilds images that are still running.
Container security checklist
Use this as a starting baseline and adjust it to your risk level.
- Maintain an inventory of clusters, registries and the images running in production.
- Build from approved minimal base images, pinned by version or digest.
- Scan every image in CI and block builds with critical vulnerabilities that have a fix available.
- Scan for secrets in code and image layers before push.
- Store images in a private registry with restricted push rights and scheduled rescans.
- Sign images and verify signatures at admission.
- Run containers as non-root, without privileged mode, with dropped capabilities and a read-only root filesystem.
- Apply the Baseline or Restricted Pod Security Standard per namespace.
- Restrict cluster access through SSO and namespace-scoped RBAC, and review it on a schedule.
- Default-deny network traffic and allow only required paths.
- Keep secrets in a secrets manager and enable encryption at rest.
- Send API audit logs and runtime alerts to central monitoring.
- Rebuild and redeploy images on a regular cadence, even when the application code has not changed.
How SecureSlate helps
SecureSlate does not replace your image scanner or admission controller. It connects the controls you run to the frameworks you are assessed against and keeps the evidence in one place.
- Multi-framework control mapping: map container controls once to SOC 2, ISO 27001, HIPAA, PCI DSS and other built-in frameworks, or add your own custom controls for container-specific rules.
- Agentless, read-only cloud integrations: monitor cloud configuration for the accounts that host your clusters and registries, alongside cloud misconfiguration checks.
- Code security and secrets detection: catch credentials committed to repositories before they reach an image.
- Access reviews: review who holds access to cloud accounts and engineering systems on a schedule, with a record of each decision.
- Risk and audit management: track container-related risks, remediation tasks and auditor requests against the same controls.
SecureSlate does not perform audits or issue certifications. You can start a free trial to see how your current controls map.
FAQ
What is the difference between container security and Kubernetes security?
Container security covers the image, the registry, the container runtime and the host. Kubernetes security covers the orchestrator: the API server, RBAC, admission control, network policy and secrets. You need both, because a hardened image can still be deployed with dangerous settings, and a hardened cluster can still run a vulnerable image.
How often should container images be scanned?
Scan every image when it is built and when it is pushed, then rescan stored and running images on a schedule, because new vulnerabilities are disclosed continuously. Many teams rescan daily. What matters for an audit is that the cadence is written in your policy and the records show you followed it.
Should containers ever run as root?
Avoid it. A process running as root inside a container has far more options if it escapes isolation or if the container is misconfigured. Set a non-root user in the image, block privilege escalation in the pod specification and treat any workload that needs root as a documented exception with an owner.
Do we need container security for a SOC 2 audit?
If containers are part of the system in scope, yes. The auditor will test vulnerability management, change management, access control and monitoring against whatever runs your service. If that is a container platform, your evidence has to come from it.
Disclaimer (legal note)
This article is for general information only and is not legal, regulatory, or professional advice. Requirements vary by framework, industry, and jurisdiction. Consult qualified advisors for your specific obligations.
Need compliance without the complexity?
SecureSlate automates ISO 27001, SOC 2, GDPR, HIPAA, and more. Built for growing teams. See it in action.
Find compliance gaps in 30 seconds