November 25, 2026
Learn what identity and access management (IAM) is, how it works, its core components, and best practices to secure users, cloud apps, and AI agents.

November 18, 2026
Learn how insider threat detection works: key signs, UEBA vs SIEM vs DLP, a five-step process, and how to build a program HR and legal can support.

November 17, 2026
What is data loss prevention? See how DLP finds, monitors, and blocks risky data movement, plus types, policy rules, and a four-phase rollout plan.
Container security is the practice of protecting containerized applications across their full lifecycle: build, ship, and run. It covers the images you create, the registries that store them, and the Docker and Kubernetes environments that execute them, so vulnerabilities, leaked secrets, and misconfigurations are caught before they reach production.
This matters because containers share the host's kernel, so a single weak image or over-privileged pod can expose far more than one application. NIST's Application Container Security Guide (SP 800-190) addresses this by organizing risk into five areas: images, registries, orchestrators, containers, and the host operating system. This guide follows the same lifecycle logic and covers the practical Docker and Kubernetes controls for each stage, with compliance context for teams in the GCC and worldwide.
Container security is the set of controls that protect containerized applications from the moment an image is built until the workload stops running. It covers four things: the image's contents, the registry that stores it, the orchestrator that schedules it, and the host that runs it. NIST SP 800-190 organizes container risk the same way, which makes it a useful reference for any team building a program.
The main difference is isolation. A virtual machine runs its own guest operating system on a hypervisor, so a compromised application is separated from the host by a hardware-backed boundary. Containers skip that layer. They share the host's kernel and rely on Linux namespaces and control groups to keep workloads apart, making them lighter and faster but giving them a thinner boundary.
In practice, a kernel vulnerability or an over-privileged container can let an attacker move from one workload to the host and then to every other container on it. A container running as root, with extra capabilities or a mounted Docker socket, narrows that gap further.
This changes where you invest. With VMs, much of the effort goes into patching guest operating systems and segmenting the network. With containers, it shifts toward hardening the host kernel, limiting what each container can do, and keeping images small and current. Containers are not inherently less secure than VMs, but they depend more on configuration discipline, and a default setup rarely meets that bar.

Container security is one layer of a broader program, not a standalone one. It connects to identity and access management, because every container and pipeline needs credentials. It connects to vulnerability management, because image scanning feeds the same remediation queue as everything else. And it connects to cloud security posture, since most containers run on managed cloud infrastructure where misconfigured networking or storage can undo good image hygiene.
It also overlaps with your development process. Controls such as image scanning and signing belong in the CI/CD pipeline, which makes container security a natural part of DevSecOps rather than a separate review at the end. For regulated teams, including GCC organizations under SIA, CBUAE, or VARA expectations, container controls also produce audit evidence: scan results, access logs, and policy enforcement records that show how workloads are governed.
The practical takeaway is to assign ownership. Platform teams usually own cluster and host hardening, developers own image content, and security owns policy and monitoring. Gaps tend to appear where those handoffs are unclear.
Each lifecycle stage has its own dominant risk and its own primary control. This table is the quick reference; later sections go deeper on each row.
Stage | Primary Risk | Core Control |
|---|---|---|
Build | Vulnerable base images, outdated dependencies, secrets baked into layers. | Minimal trusted base images, automated scanning in CI, secrets kept out of images. |
Ship | Tampered or unverified images, open registry access. | Image signing, registry access control, scan on push. |
Deploy | Misconfigured pods, excessive privileges, permissive cluster roles. | Admission policies, least-privilege RBAC, non-root defaults. |
Run | Container escape, malicious runtime behavior, lateral movement. | Runtime monitoring, syscall restrictions, network segmentation. |
The stages build on each other. A clean image that is deployed with root privileges is still exposed, and a hardened cluster still inherits whatever vulnerabilities its images carry. That is why container security works best as a lifecycle practice rather than a single scanning tool.

Containers create different risks because they share a host kernel, multiply faster than teams can track them, and live too briefly for traditional security tools to catch. Together, these traits move the weak points from the server to the image, the configuration, and the pipeline.
A container is not a sandbox in the strict sense. It is an ordinary Linux process restricted by namespaces, which limit what the process can see, and control groups, which limit what it can consume. Every container on a host talks to the same kernel, so the isolation is only as strong as the kernel and the container runtime that enforces it.
That dependency has caused real escapes. In January 2024, researchers disclosed a set of flaws in runc, the runtime behind Docker and Kubernetes, tracked as CVE-2024-21626. A malicious image could abuse a leaked file descriptor to reach the host filesystem. The fix was a runtime patch, not an application change, which shows why host and runtime updates belong in a container security program alongside image hygiene.
Configuration widens or narrows this exposure. Docker runs container processes as root by default unless the image specifies another user. Adding privileged mode, extra Linux capabilities, or a mounted Docker socket removes much of the remaining separation. A container configured this way is closer to a root shell on the host than an isolated workload.
Containers make it easy to create software, and that ease produces volume. A single application may ship as dozens of images, each built from a base image that carries its own operating system packages and libraries. Teams pull public images, copy Dockerfiles between projects, and leave old tags in registries long after the code has moved on. Each image is a separate inventory item with its own vulnerabilities, and the list grows faster than manual review can keep up with.
Short lifespans add a second problem. A container may run for minutes before an orchestrator replaces it, so a nightly vulnerability scan or an agent installed on a long-lived server will often miss it entirely. Evidence disappears too: when a compromised container is terminated, its filesystem and process history go with it unless logging and runtime telemetry were already in place.
The fix is to move security checks to where containers are created and tracked: scan images in the build pipeline, keep an inventory of what is deployed, and ship logs off the container before it exits. A server-era control applied on a fixed schedule will not match the way containers are created and destroyed.
Container risk crosses team boundaries because the artifact moves through several hands. Developers write the Dockerfile and choose the base image, so they decide what packages and users the image contains. Platform or DevOps teams run the cluster and the build pipeline, so they decide what is allowed to deploy and with what privileges. Security teams set policy and monitor for threats, but they rarely control either of those two points directly.
Problems appear in the gaps. A developer assumes the platform blocks risky configurations, the platform assumes images were scanned upstream, and security assumes both are true. A critical vulnerability found in a running container then raises a question nobody has answered in advance: who rebuilds the image, who redeploys it, and who confirms it is fixed?
A workable split is to give image content to developers, cluster and pipeline enforcement to the platform team, and policy, exceptions, and monitoring to security, with each owner named in writing. Shared tooling helps, but only if a specific person is accountable for acting on its findings.
The most common container security vulnerabilities are outdated base images, secrets baked into image layers, excessive privileges, exposed orchestration interfaces, and weak host isolation. Most are configuration and process failures rather than exotic exploits, which makes them preventable with controls applied at build and deploy time.
Every image inherits the operating system packages and libraries of its base image, including any known vulnerabilities. A team can write clean application code and still ship dozens of unpatched packages it never chose. Full-distribution base images make this worse, because they bundle shells, package managers, and utilities the application never uses but an attacker can.
Age compounds the problem. An image built months ago and never rebuilt keeps its original vulnerabilities even after upstream patches are released. Pinning to a floating tag such as "latest" creates the opposite risk, since builds silently change underneath you. Smaller bases, such as slim or distroless images, reduce the number of packages to patch, and scheduled rebuilds keep the patched versions flowing into production.
API keys, database passwords, and cloud tokens end up in images through environment variables set in a Dockerfile, copied configuration files, or build arguments. Container images are built in layers, and deleting a secret in a later layer does not remove it from the earlier one. Anyone who can pull the image can extract it with standard tooling.
Images pushed to a public registry by mistake expose these secrets to everyone. Still, private registries are not safe either, since a compromised developer account or CI token gives the same access. The better pattern is to keep secrets out of images entirely: inject them at runtime from a secrets manager, and use build-time secret mounts when a build step genuinely needs one.
A container that runs as root, in privileged mode, or with extra Linux capabilities gives a successful attacker far more room than the application ever needed. Privileged mode in particular removes most of the isolation between the container and the host, so a single vulnerable application can become a host compromise.
The usual causes are convenience and inertia. A developer runs as root because it makes a permissions error disappear, then the setting ships to production. The safer defaults are a non-root user, dropped capabilities, a read-only root filesystem, and explicit resource limits, with exceptions reviewed rather than assumed.
Orchestrators concentrate control. Whoever reaches the Kubernetes API server, the kubelet, or a management dashboard with enough permission can run workloads, read secrets, and change the cluster. When these interfaces are left open to the internet or protected by weak or default authentication, attackers find them with ordinary scanning.
A well-known example is the 2018 Tesla incident, in which researchers at RedLock found a Kubernetes administration console exposed without a password. Attackers used it to run cryptocurrency-mining workloads in the company's cloud account. The lesson holds today: restrict network access to cluster control planes, enforce authentication, and apply least-privilege roles so that a stolen service account cannot do everything.
A container escape occurs when a process breaks out of its container and gains access to the host. Because containers share the host kernel, kernel vulnerabilities, container runtime flaws, and risky configurations like mounted Docker sockets or writable host paths can all provide the path. The runc flaw discussed earlier is one example.
Escapes matter because they turn a single compromised workload into a node-level incident, and often a cluster-level one. The defenses are layered: keep the host kernel and runtime patched, avoid privileged settings, restrict system calls with seccomp or AppArmor profiles, and run sensitive workloads on separate nodes.
MITRE maintains an ATT&CK matrix specific to containers, which helps teams describe these weaknesses in the same vocabulary as their threat detection work. The mapping below links each vulnerability class to the technique an attacker would use against it. For a broader introduction to the matrix, see our guide to the MITRE ATT&CK framework.
Vulnerability | ATT&CK Technique (ID) |
|---|---|
Vulnerable images and exposed applications | Exploit Public-Facing Application (T1190) |
Secrets in images or reachable APIs | Unsecured Credentials (T1552) |
Exposed orchestration interfaces | Container Administration Command (T1609), Deploy Container (T1610) |
Excessive privileges and kernel exposure | Escape to Host (T1611) |
Compromised or tampered images | Implant Internal Image (T1525) |
Unmonitored compute | Resource Hijacking (T1496) |
Using this matrix turns a vulnerability list into a detection and testing plan. Each technique can be paired with a monitoring rule, and each can be exercised during a security test to confirm the control actually works.

Securing the build stage means making sure every container image starts from a trusted base, is scanned before it ships, contains no secrets, and can be proven to come from your pipeline. The build is the cheapest place to fix problems, because a flaw caught here never reaches a registry or a running cluster.
It is also a target in its own right. The 2020 SolarWinds incident showed how attackers who compromise a build system can insert malicious code into software that customers then install and trust. Container pipelines carry the same risk, so the controls below protect both the image contents and the process that creates them.
Start with the smallest base image that runs your application. Every package in the base is something you must patch and something an attacker can use, so slim and distroless images, which leave out shells and package managers, reduce both burdens. For compiled languages, a multi-stage build lets you compile in a full image and copy only the finished binary into a minimal one.
Trust matters as much as size. Prefer official images, verified publishers, or an internal base image your platform team maintains and rebuilds on a schedule. Pull by digest, not by tag, because a tag like "latest" can point to different content tomorrow, while a digest identifies exactly one image. Pinning this way makes builds repeatable and makes an unexpected upstream change visible instead of silent.
A scan in the pipeline checks the image's operating system packages and application dependencies against known vulnerability databases, then fails or flags the build when findings cross a threshold. Running it on every build, rather than on a nightly schedule, means a developer sees the result while the change is still fresh.
Thresholds need judgment. Blocking on every finding stalls delivery and trains teams to ignore the tool, so most programs block on critical and high-severity issues with a fix available and track the rest with deadlines. Scanners also report vulnerabilities in packages the application never loads, so look at reachability and exploitability before treating every result as urgent.
Scan dependencies, not just the final image. Lockfile checks catch vulnerable libraries earlier, and generating a software bill of materials during the build gives you an inventory to query when a new vulnerability is announced. Rescan stored images on a schedule too, since an image that was clean when built can become vulnerable once a new CVE is published.
Builds sometimes need credentials, such as a token for a private package repository. The safe approach is to give the build access to the secret without writing it into any image layer. Docker BuildKit supports secret mounts, which expose a secret to a single build step and discard it afterward. Build arguments and environment variables do not offer this protection, because they can remain visible in the image history.
Keep the secrets themselves in a dedicated manager and issue short-lived credentials to the pipeline where you can. Add secret scanning to the pipeline and to repositories as a backstop, so a leaked key is caught before it is pushed. If a secret ever does land in an image, treat it as compromised: rotate it, because deleting the image does not undo exposure.
Signing proves an image was produced by your pipeline and was not altered afterward. A signature is created at build time with a private key, or with keyless signing through a tool such as Sigstore's Cosign, and verified before deployment. An admission policy in the cluster can then reject any image without a valid signature, which closes the gap between a trusted build and an untrusted pull.
Provenance goes a step further by recording how the image was built: which source commit, which builder, and which inputs. The SLSA framework from the OpenSSF defines levels of build integrity, and attestations in that format let a deployment check not only who signed an image but how it was made. Signing alone does not make an image safe, since a compromised pipeline can sign a bad image, so it works best alongside the hardened build practices above.

Container registry security means controlling who can push and pull images, scanning what is stored, preventing stored images from being silently changed, and choosing where images are hosted. The registry is the checkpoint between build and deployment, so anything that goes wrong here reaches every cluster that pulls from it.
Registries are also a target. In April 2019, Docker disclosed that an attacker had accessed a Docker Hub database, exposing data on roughly 190,000 accounts and forcing the revocation of GitHub and Bitbucket tokens tied to automated builds. Stolen credentials like these are exactly what an attacker needs to push a tampered image under a trusted name.
Apply least privilege to the registry the same way you would to a production database. Most workloads only need to pull, most pipelines only need to push to specific repositories, and very few people need administrative rights. Separate read and write permissions, scope them per repository or project, and give each pipeline and cluster its own identity instead of a shared account.
Prefer short-lived credentials over long-lived passwords. Cloud-hosted registries can issue tokens through the platform's identity system, and CI systems can use OIDC federation so no static key sits in a pipeline variable. Enforce multi-factor authentication for human users, review access on a schedule, and log every push, pull, and permission change. Those logs are what let you answer "who pushed this image?" after an incident.
Scanning on push checks an image as soon as it arrives, so a vulnerable or non-compliant image is flagged before anything pulls it. Many registries can run this natively, and some can block pulls of images that exceed a severity threshold or quarantine them for review.
Scanning at rest covers the other half of the problem. Vulnerabilities are published daily, so an image that passed last month may fail today. Rescan stored images on a regular schedule, and prioritize the ones currently deployed. When a rescan finds a new critical issue, the registry should tell you which running workloads use the affected image, so remediation starts with an actionable list rather than a raw finding count.
Retention policy supports this. Registries accumulate old images that nobody uses but that still carry vulnerabilities and still appear in scan results. Expiring unused tags and untagged layers shrinks the inventory you need to defend.
The build pipeline signs images, and the registry stores that signature and later checks it. Cosign stores signatures alongside the image in an OCI-compatible registry, and clusters can verify them at deploy time, so confirm your registry supports OCI artifacts before depending on this.
Immutability closes a quieter gap. A mutable tag, such as "v1.2" or "latest," can be overwritten so that it points to different content without anyone noticing. Enabling tag immutability prevents that, so a released version always means the same image. Deploying by digest rather than tag gives the same guarantee on the consumer side, because a digest identifies exact content.
Tag hygiene is the supporting habit. Use a consistent naming convention that ties each tag to a build or commit, avoid reusing "latest" in production manifests, and delete tags you no longer support so nobody deploys them by accident.
Public registries are convenient and widely used, but they place trust in a publisher you do not control. Anyone can publish an image, names can be imitated, and a popular image can change after you adopted it. Official images and verified publishers lower the risk but don't eliminate it.
A private registry gives you control over access, retention, and scanning, and lets you keep proprietary images off the public internet. A common and defensible pattern is to treat public registries as an upstream source only: pull approved images through a proxy or pull-through cache, scan them, copy them into your private registry, and let production clusters pull only from there.
Location matters for regulated teams too. If data residency or sovereignty rules apply, as they can for GCC financial and government workloads, check where the registry stores images and whether replication crosses borders. Cloud providers typically let you choose the region, and that choice should be deliberate and documented.

To secure Docker containers, run them as a non-root user with the fewest capabilities they need, make their filesystems read-only where possible, cap their resources, and harden the daemon and host they run on. These controls are inexpensive to apply and remove the conditions behind most Docker-related compromises.
The stakes are set by the daemon itself. Docker's own documentation warns that membership in the docker group grants root-level privileges on the host, because anyone who can start a container can mount the host filesystem into it. Docker hardening is therefore about limiting what containers and users can ask the daemon to do.
Containers run as root by default unless the image specifies another user. Set a dedicated unprivileged user in the Dockerfile with the USER instruction, or override it at runtime with the --user flag, and make that user owns sure application files so nothing needs elevated rights to run.
Then reduce Linux capabilities. Docker grants a default set that most applications never use. A sound pattern is to drop all of them with --cap-drop=ALL and add back only what the application demonstrably requires, such as NET_BIND_SERVICE for binding to a low port. Pair this with --security-opt=no-new-privileges, which stops a process from gaining extra privileges through setuid binaries. Together, these settings mean that a compromised application starts with very little to work with.
A read-only root filesystem, enabled with the --read-only flag, prevents an attacker from writing tools, scripts, or modified binaries into the container. Applications that need scratch space can get it through a tmpfs mount or a narrowly scoped volume, so the writable area stays small and visible. If the application breaks, the failure often reveals a path it was writing to without anyone realizing.
Resource limits address a different risk, which is a single container exhausting the host. Set memory with --memory, CPU with --cpus, and process count with --pids-limit. The process limit is the one most often skipped, and it is what blunts a fork bomb. Limits also contain cryptomining abuse, which tends to show up first as abnormal CPU consumption.
The daemon runs with high privilege, so protect its access paths. Do not expose the Docker API over TCP without TLS and client authentication, because an open daemon port gives remote attackers root-equivalent control. Keep the Unix socket restricted to trusted administrators, and treat the docker group like a root group when assigning membership.
Consider rootless mode or user namespace remapping, which map root inside a container to an unprivileged user on the host. Either choice means that even a successful escape lands the attacker with limited rights instead of full host control. However, some features and volume permissions behave differently, so test before adopting broadly.
The host matters as much as the daemon. Use a minimal, patched operating system, keep the kernel and Docker engine updated, and enable audit logging for Docker files and the daemon socket so administrative actions are recorded. Applying seccomp and AppArmor or SELinux profiles adds another layer. Docker's default seccomp profile blocks a set of risky system calls, so avoid disabling it for convenience.
The CIS Docker Benchmark is a consensus-developed set of configuration recommendations covering the host, the daemon, images, and container runtime settings. It gives teams an objective baseline to measure against, rather than an informal list of habits, and it also serves as audit evidence.
Docker Bench for Security, an open-source script maintained by Docker, tests a host against many of these recommendations and reports pass, warn, or fail results. Treat its output as a starting point. Some findings will not apply to your environment, and some will conflict with how a workload legitimately runs, so record each exception with a reason instead of simply dismissing it. Check that the benchmark version you use matches your Docker release, since recommendations change over time.
Two mistakes account for a disproportionate share of Docker escapes. The first is --privileged, which gives a container nearly all host capabilities and access to host devices. It is usually added to fix a permissions error, and it should be replaced by granting the one specific capability or device the application needs.
The second is mounting /var/run/docker.sock into a container. Any process with access to that socket can start new containers, including privileged ones that mount the host root filesystem, so the mount is effectively root access to the host. It is common in CI runners and monitoring tools, and if it is truly unavoidable, restrict it with a socket proxy that limits the allowed API calls and isolate that workload on dedicated nodes.
Other recurring mistakes include using the latest tag in production, publishing ports that don't need to be reachable, and storing secrets in environment variables defined in the image. Each is easy to catch with a review of Compose files and Dockerfiles before deployment.

Kubernetes container security means restricting what workloads can do and what they can reach inside the cluster, using four controls: least-privilege RBAC, pod-level security standards, network segmentation, and protection of the API server, etcd, and secrets. Kubernetes is permissive by default, so these controls have to be configured deliberately.
The network default shows why. Kubernetes documentation states that pods are non-isolated by default and accept traffic from any source until a NetworkPolicy selects them. A single compromised pod can therefore probe every other workload in the cluster unless you have set boundaries. The sections below cover only the controls that govern containers and the workloads they run in.
Role-based access control decides who and what can call the Kubernetes API. Roles define permitted actions on resources, and bindings attach those roles to users, groups, or service accounts. The practical goal is for every identity to hold only the verbs and resources it needs, scoped to a namespace wherever possible. The same least privilege principle applies to the human administrators who hold cluster-level access.
Three habits cause most RBAC problems. The first is granting cluster-admin for convenience, which gives an identity full control of the cluster. The second is wildcard rules (* for verbs or resources), which silently expand as new resource types appear. The third is neglecting service accounts. Every pod receives a service account, and a compromised pod inherits its permissions. Create dedicated service accounts per workload, and set automountServiceAccountToken: false for pods that never call the API, so a stolen container has no token to steal.
Review bindings regularly. Permissions granted for a one-time task tend to remain, and the ability to create pods, exec into pods, or read secrets deserves particular scrutiny because each can be escalated into broader access.
Pod Security Standards define three profiles: privileged, baseline, and restricted. Baseline blocks known privilege escalations such as privileged containers and host namespaces, while restricted enforces current hardening practices, including running as non-root and dropping capabilities. The built-in Pod Security Admission controller applies these profiles per namespace in enforce, audit, or warn modes, and it replaced PodSecurityPolicy, which was removed in Kubernetes 1.25.
A practical rollout starts in warn or audit mode to see which workloads would fail, fixes them, then switches to enforce. Aim for restricted in application namespaces and keep privileged workloads, such as some node agents, isolated in their own namespaces with documented exceptions.
When built-in profiles aren't specific enough, policy engines such as Kyverno or OPA Gatekeeper add custom rules through admission webhooks. Typical rules require signed images, restrict registries to approved sources, demand resource limits, and block the latest tag. This is where the signing and registry controls from earlier stages become enforceable at deployment time.
NetworkPolicies control which pods may talk to which, at the IP and port level. They only take effect if the cluster's network plugin supports them, so confirm that your CNI enforces them before relying on them.
The standard approach is default deny, which puts the zero trust principle into practice at the workload level. Apply a policy in each namespace that blocks all ingress and, ideally, egress, then add narrow allow rules for the traffic each application genuinely needs: the frontend to the API, the API to the database, and nothing else. Restricting egress matters because it limits where a compromised container can send stolen data or fetch malicious tools. It also lets you block access to the cloud metadata endpoint, a common credential-theft target.
NetworkPolicies do not provide encryption or identity-based authentication between services. If you need mutual TLS, a service mesh can add it, though that is a separate decision from basic segmentation.
By default, Kubernetes Secret objects are stored in etcd as base64-encoded values, which is an encoding rather than encryption. Anyone who can read etcd, or who has RBAC permission to get secrets, can read them in plain text. Enable encryption at rest for Secret resources through the API server's encryption configuration, ideally with a key held in an external KMS, and restrict who can read secrets at all.
etcd holds the cluster's entire state, so protect it as the most sensitive component. Limit network access to the API server only, require mutual TLS between etcd and its clients, and encrypt backups. On managed Kubernetes services, the provider operates etcd and the control plane, but you still control the encryption options, API server access settings, and RBAC.
Secure the API server itself by disabling anonymous access, requiring authentication for all requests, and restricting network exposure with private endpoints or IP allowlists. Turn on audit logging, because it records who did what and is the evidence you need after an incident. For application secrets, consider an external secrets manager with a Kubernetes integration, which keeps the source of truth outside the cluster and supports rotation.
Cluster-wide hardening, such as node configuration, full control plane benchmarking, and upgrade strategy, is outside this guide's scope. The controls above are the ones that most directly govern the containers you deploy.

Runtime container security detects and limits malicious behavior in containers while they are running, using monitoring, system call restrictions, and logging. Build-time scanning can only flag known vulnerabilities, so runtime controls catch zero-days, stolen credentials, and misused legitimate access.
The Log4Shell vulnerability (CVE-2021-44228), disclosed in December 2021, shows the gap. Images that passed every scan the day before suddenly became exploitable, and in many environments, the first sign of attack was unusual behavior from running workloads, not a scanner alert.
Scanning compares an image's contents against a database of known flaws. It says nothing about what the container does once it starts, and it cannot see anything that is not yet in the database. Runtime protection fills these gaps:
Newly disclosed vulnerabilities. A container can be exploitable between the day a flaw is published and the day your next scan or rebuild catches it.
Zero-day exploitation. Behavior-based detection can flag the effects of an attack even when no signature exists.
Stolen credentials and misused access. An attacker with a valid token generates no vulnerability finding. Their activity looks suspicious only in context.
Configuration drift. A container modified after deployment, for example by an interactive shell, no longer matches the scanned image.
Runtime and build-time controls are complementary. Scanning reduces how many problems reach production, and runtime protection limits the damage from the ones that do.
Behavioral monitoring watches what containers actually do at the system level, such as processes started, files opened, network connections made, and privileges changed, then compares that against expected activity or a rule set. Most tools rely on eBPF or kernel instrumentation to observe this without modifying the application.
Falco, an open-source CNCF project, is the best-known rules-based example. It ships with rules for patterns such as a shell spawning inside a container, a process reading sensitive files like /etc/shadow, or an unexpected outbound connection. Commercial platforms add profiling, which learns a workload's normal behavior and alerts on deviations.
Containers are well suited to this because a well-built one is predictable. A web service that has only ever run one process and talked to one database should not suddenly launch curl or connect to an unfamiliar address. The main tuning challenge is noise. Start with a small set of high-confidence rules, such as shells in production containers, writes to binary directories, and package manager execution, then expand as the team learns what is normal.
Syscall filtering is preventive rather than detective. It restricts which kernel interfaces a container can call, so an exploit that depends on a dangerous system call fails.
Seccomp filters system calls directly. Docker applies a default profile that blocks a set of risky calls, and Kubernetes can apply the runtime's default through the seccompProfile: RuntimeDefault setting in a pod's security context. Teams with mature tooling can go further and generate custom profiles from observed behavior, allowing only the calls the application uses.
AppArmor and SELinux are mandatory access control systems that restrict what files, capabilities, and resources a process can touch. Which one you use usually depends on the host distribution: AppArmor is common on Ubuntu and Debian, while SELinux is standard on Red Hat-family systems. Both can stop a compromised process from reading files outside its role even when it runs as root inside the container.
The usual trade-off is compatibility. Tight profiles can break applications in ways that are hard to diagnose, so test them in audit or complain mode first, then enforce. The built-in defaults are a strong baseline and should not be disabled to fix a permissions problem.
Containers are ephemeral, so evidence has to be collected before it is needed. When a pod is terminated or rescheduled, its filesystem, process list, and local logs disappear. Send application and system logs to a central store as they are generated, and keep Kubernetes audit logs, which record API activity, alongside container and node logs.
For response, isolation comes before deletion. Applying a restrictive network policy or label to a suspect pod cuts it off from the rest of the cluster while keeping it alive for inspection. If your tooling allows, capture a snapshot of the container filesystem and memory before it is terminated. Deleting the pod immediately feels decisive but destroys the evidence you need to learn how the attacker got in.
Plan for the full picture. A container incident usually involves the image, the node, and the cluster identity it used, so the response should cover rotating exposed credentials, rebuilding from a clean image, and checking whether other workloads share the same weakness. Include containers in your regular incident response exercises, since the steps differ from those for a traditional server.
This is a hypothetical example to show how the controls work together.
Entry. A public-facing API container runs a library with a newly disclosed remote code execution flaw. The last scan was clean because the vulnerability was published after the image was built.
Exploitation. An attacker sends a crafted request and gets a shell inside the container.
Detection. A runtime rule fires on an unexpected shell process in a production container, followed by a second alert when that shell makes an outbound connection to an unknown address. Both events reach the security team within seconds.
Containment. The responder applies a deny-all network policy to the pod. The attacker's connection drops, and the pod stays running for analysis. Because the container runs as non-root with a read-only filesystem and a restricted syscall profile, the attacker could not install tools or escalate privileges.
Investigation. Centralized logs show the request that triggered the exploit and confirm the attacker reached only this pod. The pod's service account had no permission to read secrets, so cluster credentials were not exposed.
Recovery. The team patches the library, rebuilds and rescans the image, deploys it, and then deletes the compromised pod. They rotate the one credential the container held and add a detection rule for the exploit pattern.
The layered controls turned a potentially serious breach into a contained event with a clear timeline.

Container security testing verifies that images, configurations, and running workloads resist attack, using four complementary methods: static scanning, dynamic testing, configuration benchmarking, and manual penetration testing. No single method covers the full lifecycle, so the goal is a combination matched to each stage.
Automated results also need interpretation. CISA maintains its Known Exploited Vulnerabilities catalog because only a subset of published CVEs are ever exploited in the wild, so a long scan report does not equal long exposure. Testing is only useful when findings are weighed by what an attacker can actually reach.
These three methods look at different things, and each misses what the others catch.
Static scanning inspects images and files without running them. It works like a vulnerability assessment applied to images: it checks operating system packages and application dependencies against vulnerability databases, flags embedded secrets, and lints Dockerfiles and Kubernetes manifests for risky settings. It is fast, runs in CI, and finds known problems early. It cannot see runtime behavior or flaws in your own application logic.
Dynamic testing exercises a running workload. It sends crafted requests to exposed services, probes APIs, and observes how the container responds, which surfaces issues such as injection flaws, weak authentication, and exposed debug endpoints. It finds problems that only appear when the application is live, but it needs a deployed target and takes longer to run.
Configuration benchmarking compares settings against a defined standard. The CIS Docker and Kubernetes Benchmarks cover the daemon, hosts, and cluster components, and tools such as Docker Bench for Security and kube-bench automate the checks. This catches drift, such as an open kubelet port or a disabled audit log, that neither scanning nor dynamic testing is designed to find.
A practical split: static scanning on every build, configuration benchmarking on a schedule and after cluster changes, and dynamic testing against staging before major releases.
Penetration testing adds a human attacker's reasoning to the automated results. In a containerized environment, a tester typically starts from a foothold in one workload, then tries to escape to the node, abuse service account tokens, move laterally between namespaces, reach the cloud metadata service, and read secrets from the cluster. These chained paths are what scanners usually cannot assemble on their own.
Scope matters. Decide up front whether the test covers only the application, the cluster and its configuration, or the full path from the internet to the cloud account, and make sure the testers have the access, such as a low-privilege pod or kubeconfig, that matches the threat you are modeling.
The methodology itself is not specific to containers. For how penetration tests are structured, the main types, and what a report should contain, see our guide to penetration testing methods. If you need a specialist to test a containerized or cloud-native environment, our penetration testing services cover that scope.
A pre-production checklist should confirm that the controls described earlier in this guide work, instead of assuming they do. Priorities include:
Image contents: no critical fixable vulnerabilities, no secrets in layers, and a base image from an approved source.
Privilege settings: containers run as non-root, with dropped capabilities and no privileged mode or Docker socket mounts.
Admission and policy enforcement: an attempt to deploy a non-compliant pod, such as one running as root or using an unsigned image, is actually rejected.
Network segmentation: a test pod in one namespace cannot reach workloads it should not, and egress limits behave as designed.
Secrets handling: secrets are not exposed through environment variables in images, logs, or overly broad RBAC permissions.
Runtime detection: a simulated event, such as spawning a shell in a container, triggers the alert you expect and reaches the right team.
The last item is the one teams skip most often. A detection rule that has never been tested is an assumption, and a short purple-team exercise to trigger it is the quickest way to find out.
Scanners produce more findings than most teams can act on, and the problem is mostly context. A vulnerability in a package that is installed but never loaded, or in a function your application never calls, is technically present but not exploitable through your service. Treating it as urgent wastes remediation effort and erodes trust in the tool.
False positives also arise from version-matching. Scanners often flag a package because its version number falls in an affected range, even when the distribution has backported the fix without changing the version. Findings with no available fix, or in a component an attacker cannot reach, can be tracked and accepted rather than blocking release.
Several practices help. Prioritize by severity combined with exploitability data, such as CISA's KEV catalog or the Exploit Prediction Scoring System, and by whether the affected workload is internet-facing. Use VEX (Vulnerability Exploitability eXchange) statements to record that a vulnerability does not affect a specific product, so the same finding does not return on every scan. Reduce noise at the source by using minimal base images that carry fewer packages.
Remember what scanners cannot see: logic flaws in your own code, misconfigurations outside the image, and attack chains that span components. Scanning shows you what is known, and testing with a human attacker shows what is possible.

A container security policy is a written set of rules that defines which images, configurations, and behaviors are allowed in your container environment, and who is accountable for enforcing them. It works best when the rules are specific enough to be checked automatically, because a policy that exists only as a document is rarely followed under delivery pressure.
Most teams do not need to invent these rules from scratch. NIST SP 800-190, the Application Container Security Guide published in September 2017, remains a common baseline, and its recommendations map cleanly onto the policy areas below.
A usable policy covers the lifecycle stages already discussed in this guide, with a clear requirement and an owner for each. The core areas are:
Image rules define approved base images and registries, a maximum age before rebuild, and the vulnerability severity that blocks a release. Build rules cover secrets handling, dependency scanning, and image signing. Registry rules set who can push and pull, plus tag immutability and retention. Deployment rules specify required runtime settings, such as non-root users, dropped capabilities, resource limits, and the prohibition of privileged containers and host mounts. Network and access rules require default-deny segmentation and least-privilege RBAC. Runtime and response rules name the monitoring that must be active, the log retention period, and who responds to an alert.
Two additions make a policy workable rather than aspirational. The first is an exception process: some workloads, such as node agents, legitimately need elevated privileges, and a documented, time-limited exception is safer than teams quietly bypassing the rules. The second is named ownership. Each rule should say whether developers, the platform team, or security is responsible, because ambiguity here is where enforcement fails.
Policy-as-code turns written rules into machine-readable checks that run automatically, so compliance does not depend on someone remembering to review a manifest. The same rule can then be applied at several points: in the developer's editor, in the CI pipeline, and at the cluster's admission gate.
In Kubernetes, admission controllers evaluate every request to create or change a resource. Kyverno and Open Policy Agent Gatekeeper are the two most widely used policy engines for this. Kubernetes also includes native ValidatingAdmissionPolicy, which uses the Common Expression Language to write rules without running a separate webhook. Typical enforced rules include rejecting pods that run as root, allowing images only from approved registries, requiring resource limits, and demanding a valid image signature.
Earlier in the pipeline, tools such as Conftest can evaluate the same rules against Dockerfiles and manifests before they are deployed, giving developers faster feedback than a rejected deployment.
Roll enforcement out in stages. Begin in audit or warn mode to see what would fail, fix or except the existing violations, then switch to enforce. Turning on strict blocking in a live cluster without this step is a reliable way to cause an outage and lose organizational support for the policy.

Mapping your policy to recognized standards helps in two ways: it shows the rules rest on accepted guidance, and it lets one set of controls serve several audits.
NIST SP 800-190 organizes risks and countermeasures around five areas: images, registries, orchestrators, containers, and host operating systems. Use it as the structure for deciding what the policy must address. The CIS Docker and Kubernetes Benchmarks supply the specific configuration checks, such as daemon settings and API server flags, that turn a general rule into a testable one.
ISO 27001:2022 does not mention containers by name, but several Annex A controls apply directly. The table in the next subsection shows the mapping most teams use as a starting point.
For regulated organizations in the GCC and elsewhere, this mapping also serves as an audit aid. A policy tied to named controls, with scan results, admission logs, and exception records behind it, gives assessors evidence of how container risk is governed, not just a statement of intent. If you are building toward certification, our ISO 27001 services page explains how these controls fit into a wider management system.
This outline is a starting point. Adjust the thresholds to your risk tolerance and regulatory requirements.
Policy Area | Example Requirement | Enforced By | Related References |
|---|---|---|---|
Base images | Use only approved, minimal images from the internal registry; rebuild at least monthly. | CI check, admission policy | NIST SP 800-190 (images); ISO 27001 A.8.8, A.8.9 |
Vulnerability management | Block release on critical or high findings with an available fix; rescan stored images on a schedule. | CI scan, registry scan | NIST SP 800-190 (images, registries); ISO 27001 A.8.8 |
Secrets | No secrets in images or environment variables; use a secrets manager. | Secret scanning, review | ISO 27001 A.5.17, A.8.24 |
Image integrity | Deploy only signed images, referenced by digest. | Admission policy | NIST SP 800-190 (registries); ISO 27001 A.8.25 |
Registry access | Least-privilege push and pull, MFA for users, tag immutability. | Registry configuration | NIST SP 800-190 (registries); ISO 27001 A.5.15 |
Runtime configuration | Non-root, dropped capabilities, read-only filesystem, resource limits, no privileged mode. | Admission policy | CIS Benchmarks; ISO 27001 A.8.9 |
Access control | Dedicated service accounts, no wildcard roles, restricted cluster-admin. | RBAC review, policy engine | ISO 27001 A.5.15, A.8.2 |
Network segmentation | Default-deny network policies per namespace. | Admission policy, CI check | ISO 27001 A.8.20, A.8.22 |
Logging and detection | Central log collection, audit logging enabled, runtime alerts tested. | Platform configuration, exercises | ISO 27001 A.8.15, A.8.16 |
Exceptions | Written approval, named owner, expiry date. | Exception register | ISO 27001 A.5.1 |
A table like this is only the start. The policy becomes real when each row has an owner, an automated check, and a review date.
Container environments are not exempt from compliance frameworks. Most regulations are technology-neutral, so assessors apply existing requirements for access control, vulnerability management, logging, and change control to containers and expect evidence that those controls work. Few frameworks mention containers by name, so translating rules into container controls is your responsibility.
The PCI Security Standards Council addressed this directly in its 2022 information supplement on containers and container orchestration tools. It confirms that PCI DSS applies to container environments in scope and explains how to interpret its requirements for them. The same pattern holds across the regions below.
PCI DSS applies to any container, node, or orchestration component that stores, processes, or transmits cardholder data, or that can affect the security of the cardholder data environment. A container that never touches card data can still be in scope if it shares a cluster, network, or credentials with one that does.
The practical question is segmentation. If you want to reduce scope, you must be able to show that out-of-scope workloads cannot reach in-scope ones. In Kubernetes this typically means dedicated namespaces or clusters, default-deny network policies, separate node pools, and tightly separated RBAC, all backed by test results. Namespaces alone are a logical boundary rather than a hard one, and assessors will want to see how you validated the isolation.
Other requirements map to controls covered earlier in this guide. Vulnerability management applies to images and hosts, which is why scanning and rebuild schedules matter. Secure configuration points to hardened baselines and benchmarks. Logging and monitoring requirements apply to the orchestrator and the workloads, and ephemeral containers make centralized log retention essential. Change control becomes evidence from your pipeline and admission policies.
PCI DSS v4.0.x added several newly mandatory requirements after March 2025, so confirm which version your assessor is working to and read the council's container supplement alongside it.
The regulators in this region generally set outcome-based expectations, such as access control, secure configuration, vulnerability management, logging, and incident response, rather than prescribing container-specific controls. Your task is to show how your container program delivers those outcomes.
UAE national requirements. The UAE Information Assurance Regulation, issued by the Signals Intelligence Agency (SIA, formerly NESA), sets security controls for critical sector entities. Container workloads running in scope systems fall under the same control families as any other infrastructure, including asset management, access control, and monitoring. Our guide to UAE cybersecurity regulations covers the framework in more detail.
Financial sector. Banks, insurers, and other firms regulated by the Central Bank of the UAE (CBUAE) are expected to manage technology, outsourcing, and operational resilience risks. For container platforms, that usually means documented ownership, controlled change processes, tested recovery, and oversight of any cloud or managed Kubernetes provider.
VARA-regulated platforms. Many Dubai virtual asset firms run exchange, wallet, and custody services on Kubernetes. VARA's Technology and Information Rulebook sets cybersecurity expectations for licensed entities, and these apply to the infrastructure beneath the application, including its containers. Key management, access control, logging, and testing are the areas where cluster design most often comes under scrutiny. Our VARA cybersecurity requirements checklist walks through those expectations.
Saudi Arabia only. Organizations operating in Saudi Arabia answer to different frameworks: the SAMA Cyber Security Framework for financial institutions under SAMA's supervision, and the National Cybersecurity Authority's Essential Cybersecurity Controls and Cloud Cybersecurity Controls for government and critical national infrastructure entities and cloud use. Treat these as separate obligations rather than extensions of the UAE rules. Data residency is a recurring issue, so check where your registries, clusters, logs, and backups are located.
Across all of these, cross-border hosting deserves early attention. Where container images, secrets, and logs are stored can have legal consequences, and region selection in a managed Kubernetes service should be a documented decision.
Assessors want proof that controls operate consistently, not just policy documents. Container platforms can generate much of this evidence automatically, provided you retain it. The most useful artifacts are:
Inventory: a current list of images, running workloads, clusters, and owners, with the registry source for each image.
Vulnerability records: scan results per build and per stored image, with remediation timelines and approved exceptions.
Build and provenance records: pipeline logs, signatures, and software bills of materials showing what shipped and where it came from.
Configuration evidence: benchmark reports against CIS or similar baselines, plus the admission policies in force.
Access records: RBAC role bindings, registry permissions, and periodic access reviews.
Admission and audit logs: records of rejected deployments and Kubernetes API activity showing who did what.
Runtime alerts and response: detection logs and incident records showing alerts were triaged and closed.
Test results: penetration test reports and the evidence that findings were fixed.
Retention is the part teams forget. Ephemeral containers leave nothing behind, so logs and records must be exported to central storage with a retention period that matches your regulatory requirement. If your compliance work spans several frameworks, our compliance services team can help map one evidence set to multiple audits.

A container security program matures in three phases: quick wins that remove the most obvious exposure in the first week, foundational controls that build repeatable enforcement over the first quarter, and advanced controls that harden and verify the environment over time. Sequencing matters more than completeness, because a few well-enforced basics reduce more risk than a long list of half-implemented tools.
The NSA and CISA reached a similar conclusion in their Kubernetes Hardening Guidance, first published in August 2021, which centers on a short set of high-impact measures: scan images, run with least privilege, segment networks, and enforce strong authentication and logging. The checklist below applies that prioritization to the full container lifecycle.
These actions need little tooling and no architectural change. Their purpose is to find out what you have and close the most dangerous gaps.
Inventory every cluster, registry, and running image, and assign an owner to each.
Run an image scan across everything currently deployed, and list critical findings with an available fix.
Search images, repositories, and pipeline variables for exposed secrets, and rotate any you find.
Replace latest tags in production manifests with specific versions or digests.
Find containers running as root, in privileged mode, or with the Docker socket mounted, and fix or document each one.
Remove public access from registries, the Kubernetes API server, and dashboards that do not need it.
Turn on audit logging for the cluster and registry, and send the logs somewhere that outlives the containers.
Remove cluster-admin bindings from anything that does not require them.
By the end of week one, you should know your exposure, even if you haven't fixed all of it yet.
Foundational controls turn one-time cleanup into automatic enforcement, so improvements persist as teams keep shipping.
Scan every build in CI and set a blocking threshold, such as critical and high findings with a fix available.
Standardize on minimal, approved base images served from a private registry, with scheduled rebuilds.
Move secrets into a secrets manager, and enable encryption at rest for Kubernetes Secrets.
Apply Pod Security Standards in audit mode, fix violations, and move application namespaces to enforce at the baseline or restricted level.
Deploy default-deny network policies in each namespace, then add the specific allow rules each workload needs.
Create dedicated service accounts per workload, and disable token auto-mounting where the API is not used.
Apply registry access controls with least privilege, MFA for users, and tag immutability.
Benchmark hosts and clusters against the CIS Docker and Kubernetes Benchmarks, and record exceptions with reasons.
Write the container security policy, with owners and an exception process, and map it to the standards your auditors use.
This phase is mostly about consistency. By its end, a developer who tries to deploy a root container from an unapproved registry should be stopped automatically instead of by a review comment.
Once the basics are enforced, the work shifts to verification and depth. These controls take longer to adopt and need regular tuning.
Sign images in the pipeline and require valid signatures at admission, with build provenance attached.
Generate and store a software bill of materials for each image so new vulnerabilities can be matched to deployments quickly.
Deploy runtime detection with a small set of high-confidence rules, then expand as you learn normal behavior.
Apply seccomp, AppArmor, or SELinux profiles beyond the defaults for sensitive workloads.
Isolate high-risk or regulated workloads on dedicated nodes or clusters.
Restrict egress traffic and consider mutual TLS between services where the threat model justifies it.
Test detection and response with simulated incidents, and include containers in your incident response exercises.
Commission a penetration test of the containerized environment, and track fixes through to verification.
Review RBAC, exceptions, and policy rules on a fixed schedule, and retire anything no longer needed.
Maturity here is measured by evidence rather than tooling. Ask whether you can show that each control works, who owns it, and when it was last tested.
Container security works when you treat it as a lifecycle practice, not a single tool. Start with the controls that remove the most risk for the least effort: run containers as non-root, scan images in the pipeline, keep secrets out of images, and enforce default-deny networking and least-privilege access. Then add signing, runtime detection, and a written policy that your platform can check automatically.
The most useful next step is to find out where you stand. Inventory your images and clusters, fix the week-one items from the maturity checklist, and test whether your controls hold up against a realistic attacker. If you want an outside view, our team can assess your containerized and cloud-hosted environments through our penetration testing services, and review your cluster and cloud configuration against the benchmarks covered above. Contact Femto Security to scope an assessment.
In most environments, the biggest risk is misconfiguration, not a sophisticated exploit. Containers running as root, in privileged mode, or with exposed orchestration interfaces give attackers easy paths to the host or cluster. Vulnerable images and leaked secrets follow closely, which is why least-privilege settings and admission policies deliver the largest risk reduction early on.
Not inherently, but they isolate less strongly. Containers share the host kernel, so a kernel flaw or an over-privileged container can expose the host, while a virtual machine adds a hypervisor boundary. Well-configured containers can be run securely, and sensitive workloads can use sandboxed runtimes or dedicated nodes for added separation.
Partly. Docker applies sensible defaults, such as a default seccomp profile and namespace isolation. However, containers still run as root unless the image sets another user, and the daemon runs with high privileges. Docker's own documentation treats docker group membership as root-equivalent, so hardening the configuration and access is still necessary.
Scan every image on every build, and rescan stored and deployed images on a regular schedule, ideally daily for production. New vulnerabilities are published constantly, so an image that was clean at build time can become vulnerable later. Pair scheduled rescans with alerts that identify which running workloads use an affected image.
Image scanning inspects an image before it runs and flags known vulnerabilities, secrets, and risky settings. Runtime security monitors what containers actually do while running, such as unexpected shells, file changes, or network connections. Scanning prevents known problems from shipping, while runtime security detects zero-days, stolen credentials, and attacks scanning cannot see. Most programs need both.
Not to start. Native controls and open-source tools cover the basics: CI image scanning, Pod Security Admission, network policies, RBAC, and rules-based runtime detection such as Falco. A dedicated platform becomes worthwhile at scale, when unifying findings, reducing alert noise, and producing audit evidence across many clusters outweighs the operational cost.