12 Kubernetes & Dockerfile Security Misconfigurations That Slip Past Code Review (Free 100% Local CIS Auditor)
Most container security incidents don't start with exotic kernel zero-days — they start with a copied Deployment YAML that still has allowPrivilegeEscalation left true by default, a Dockerfile running as root with :lates
Most container security incidents don't start with exotic kernel zero-days — they start with a copied Deployment YAML that still has allowPrivilegeEscalation left true by default, a Dockerfile running as root with :latest, or a debug hostNetwork: true flag forgotten before production.
Sending private internal Kubernetes manifests or Dockerfiles to random third-party SaaS scanners during pre-PR checks defeats the whole point of security hygiene. Instead, you can scan manifests 100% locally in your browser (zero server uploads) using the K8s & Docker Security Auditor.
Here are the 12 checks that catch the vast majority of real-world misconfigurations before they hit CI or your cluster.
Part 1: Kubernetes Pod & Container Spec Guardrails
-
runAsNonRoot: truemissing or overridden: Without an explicit non-rootsecurityContext, base images built withUSER rootrun as UID0inside the container namespace. -
allowPrivilegeEscalation: falseomitted: Unless explicitly disabled, Linuxsetuidbinaries inside a compromised container can escalate effective privileges. -
readOnlyRootFilesystem: trueabsent: Makes runtime binary tampering or dropping web shells significantly harder (pair withemptyDirmounts for/tmp). -
privileged: trueleft enabled: Grants near-full host device and kernel capability access — almost never justified outside specialized CNI/CSI DaemonSets. -
hostPID: true,hostIPC: true, orhostNetwork: true: Breaks pod-level isolation and exposes host processes or node loopback services. -
capabilities.drop: ["ALL"]missing: Drop all Linux capabilities by default and add back only minimal caps (NET_BIND_SERVICE) when required. -
Missing
resources.requestsandresources.limits: Unbounded CPU/memory lets a single leaky pod trigger noisy-neighbor throttling or node OOMKills. -
automountServiceAccountToken: falseignored on public workloads: Workloads that don't query the Kubernetes API shouldn't carry a mounted ServiceAccount JWT at/var/run/secrets/kubernetes.io/serviceaccount/token.
Part 2: Dockerfile Hygiene Checks
-
Floating
:latestor unpinned base tags: Breaks deterministic builds and introduces silent supply-chain drift between staging and prod. -
No
USERinstruction beforeCMD/ENTRYPOINT: Leaves Node/Python/Go runtimes executing asroot. -
curl | shor unverified remote installers inRUNlayers: Increases image blast radius and bloat when package managers or multi-stageCOPY --fromsuffice. -
Plaintext
.envor secret-likeENVkeys baked into layers: Anyone withdocker historyor registry pull access can inspect build layers forever.
Free 100% Client-Side DevSecOps & Cloud Toolkit (Zero Telemetry)
All tools below run purely inside your browser (0 backend requests):
- K8s & Docker CIS Security Auditor (12 Instant Checks): K8s & Docker Audit
-
.env→ KubernetesSecret/ExternalSecretConverter: Env → K8s Secret - Multi-Doc YAML ↔ JSON & K8s Validator: YAML ↔ JSON Tool
- Local JWT Security Inspector (Zero Secret Leakage): JWT Decoder
- SRE SLO Burn-Rate Generator & Cron / CIDR / Chmod Calcs: Solo Founder Toolkit
Open-source GitOps reference architecture (ArgoCD + Kustomize + Terraform): cloudpulse-gitops-platform.
Also running local AI models privately in Docker? Check hardware sizing on localaihardware.dev — or grab our hardened production packs (20% off with code PH20):
-
SaaS Deploy & SRE Starter Pack 2026 (
$15.20withPH20): Ko-fi Direct | Gumroad (PH20) -
Local LLM & Ollama Self-Hosting Kit 2026 (
$11.20withPH20): Gumroad (PH20)
Which check catches the most PRs in your repo (allowPrivilegeEscalation, :latest, or missing limits)?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.