Top 10 Container Security Risks (Docker & K8s)

Containers have revolutionized software deployment, but they introduce complex misconfiguration vectors. Unlike virtual machines, containers share the host's operating system kernel. A single misconfigured pod or vulnerable base image can compromise the entire Kubernetes cluster.

Verified by Precogs Threat Research
Analysis by Rajnish Sharma • Last Updated: March 2026
#1

Over-Privileged Containers (Privileged Mode)

Running a container with the `--privileged` flag or granting excessive Linux capabilities (e.g., `CAP_SYS_ADMIN`).

Real World Case Study

A CI/CD pipeline dynamically spun up worker pods using privileged mode to enable build-in-docker (DinD). Attackers compromised a codebase, ran a script inside the CI pipeline, and easily escaped the container by mounting the host's root filesystem `/dev/sda1`, establishing persistent host access.

The Precogs AI Fix

Precogs AI analyzes Kubernetes manifests and Helm charts, replacing Privileged security contexts with explicit, minimal Pod Security Admission (PSA) restricted policies.

#2

Exposed Docker Daemon Sockets

Mounting `/var/run/docker.sock` directly into a container, giving the container full control over the host's Docker engine.

Real World Case Study

A containerized monitoring tool required access to the Docker socket to collect container metrics. When the monitoring application suffered a command injection flaw, attackers used the mounted socket to instantiate a generic Ubuntu container with host-mounting privileges, bypassing all network isolation.

The Precogs AI Fix

Precogs AI flags socket mounts and recommends secure, socketless telemetry collection via eBPF or constrained APIs.

#3

Vulnerable Base Images

Building application containers utilizing outdated OS base images containing known, critical vulnerabilities (e.g., glibc, OpenSSL).

Real World Case Study

An enterprise deployed hundreds of microservices built on `node:14` (Debian Buster). The base image was riddled with high-severity vulnerabilities including a flaw in `libcurl`. Attackers compromised the container via SSRF and utilized the vulnerable curl version to pivot deeper into the infrastructure.

The Precogs AI Fix

Precogs AI integrates directly with the Dockerfile generation process, enforcing the use of Distroless base images (Google Distroless / Alpine) that contains zero OS package attack surface.

Notable CVEs in this Class

#4

Kubernetes API Server Exposure

Failing to secure the Kubernetes control plane, leaving the API server exposed to the public internet without strong authentication.

Real World Case Study

A misconfigured EKS cluster left the API server URL public. Although RBAC was enabled, the `system:anonymous` user was inadvertently granted read access to ConfigMaps due to a legacy helm deployment. Attackers enumerated the cluster and extracted database credentials.

The Precogs AI Fix

Precogs AI ensures cloud infrastructure code definitions bind Kubernetes API endpoints strictly to private VPC CIDR blocks and enforces OIDC SSO authentication.

#5

Insecure Secrets Management in Kubernetes

Storing sensitive credentials as plain text in Git, injecting them as plaintext Environment Variables, or relying on base64 encoded K8s Secrets without KMS encryption.

Real World Case Study

A developer hardcoded an API key into a Deployment YAML. Anyone with read access to the cluster's Deployments via `kubectl get deploy -o yaml` could read it. An attacker who gained read-only access to the cluster immediately stole production API keys and began data exfiltration.

The Precogs AI Fix

Precogs AI blocks plaintext secrets in IaC repositories and auto-generates integrations for External Secrets Operators (Vault/AWS Secrets Manager).

#6

Excessive Kubernetes RBAC Permissions

Granting overly permissive Roles or ClusterRoles (like wildcard `*` access) to application ServiceAccounts.

Real World Case Study

A log forwarding pod was granted `cluster-admin` privileges to watch all namespaces. When the pod was compromised via a deserialization flaw, the attacker inherited those privileges and deployed ransomware DaemonSets across every node in the 500-node cluster.

The Precogs AI Fix

Precogs AI analyzes Kubernetes audit logs against declared RBAC policies, instantly generating least-privilege Roles tailored exclusively to the observed API calls of each ServiceAccount.

#7

Unrestricted Network Egress / Lateral Movement

Failing to implement Kubernetes NetworkPolicies, allowing every pod to communicate with every other pod and the external internet by default.

Real World Case Study

A vulnerable PDF rendering microservice was compromised. Because there was no default-deny NetworkPolicy, the compromised pod reached out to an external Command and Control (C2) server, downloaded a cryptominer, and began scanning the internal subnet for exposed Redis instances.

The Precogs AI Fix

Precogs AI generates granular, zero-trust NetworkPolicies that enforce default-deny egress and ingress, allowing only explicitly mapped microservice dependencies.

#8

Kernel Exploits leading to Container Escapes

Exploiting memory corruption vulnerabilities in the shared Linux Host kernel from within an unprivileged container.

Real World Case Study

The 'Dirty Pipe' vulnerability allowed unprivileged container users to overwrite read-only files. Attackers inside a low-privilege container exploited this to overwrite the host's `runc` binary. When the orchestrator restarted the container, the compromised `runc` executed the payload as root on the host.

The Precogs AI Fix

Precogs AI assesses underlying node kernel versions continuously and enforces Seccomp profiles that severely restrict the syscall attack surface available to containers.

Notable CVEs in this Class

#9

Malicious Container Registries (Typo-squatting)

Pulling images from untrusted public registries or falling victim to typo-squatted image names that contain embedded backdoors.

Real World Case Study

A developer intended to pull the official `postgres:15` image but accidentally typed `postgress:15`. The attacker-controlled image booted the database perfectly but silently initiated a reverse shell back to multiple C2 servers.

The Precogs AI Fix

Precogs AI enforces Image Signature Validation (e.g., Sigstore/Cosign), ensuring Kubernetes only admits images cryptographically signed by the organization's verified CI pipeline.

#10

Exposed Kubelet API

The Kubelet runtime agent running on worker nodes exposed on port 10250 without proper authentication/authorization enabled.

Real World Case Study

An attacker who gained access to the internal network discovered Port 10250 open across all worker nodes. Without needing Kubernetes API server access, they utilized the Kubelet's `/exec` endpoint to execute a shell inside the core `kube-proxy` container, immediately compromising cluster networking.

The Precogs AI Fix

Precogs AI audits kubelet configurations ensuring `anonymous-auth=false` and Webhook authorization modes are strictly enforced across managed node groups.