Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

12 CIS Kubernetes & Dockerfile Security Checks Every Dev Should Run Before Prod (100% Local Tool)

Most container breaches don't come from exotic zero-days — they come from shipping default Dockerfile and Kubernetes Deployment manifests straight to production. Here are the top 8 misconfigurations that show up in almo

Most container breaches don't come from exotic zero-days — they come from shipping default Dockerfile and Kubernetes Deployment manifests straight to production.

Here are the top 8 misconfigurations that show up in almost every early-stage production cluster:

  1. Running as root (USER root / missing runAsNonRoot: true) — gives any RCE full root inside the container namespace.
  2. Mutable :latest image tags — breaks reproducible rollbacks and silently pulls breaking upstream updates.
  3. Writable root filesystem — set readOnlyRootFilesystem: true and mount an emptyDir only at /tmp.
  4. Unrestricted Linux capabilities — always drop ["ALL"] and add back only what is strictly required.
  5. Hardcoded secrets in ENV or manifest value: — inject via Kubernetes Secrets, Vault, or AWS IRSA.
  6. Missing livenessProbe / readinessProbe — causes dropped traffic during rolling deploys.
  7. Missing resources.requests / resources.limits — invites noisy-neighbor OOM kills across the node.
  8. Single-stage Docker builds — ships compilers, package caches, and extra CVEs into production images.

Hardened Deployment Template (100/100 CIS Score)

securityContext:
  runAsNonRoot: true
  runAsUser: 10001
  seccompProfile:
    type: RuntimeDefault
containers:
  - name: api
    image: ghcr.io/your-org/api:1.4.2
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop: ["ALL"]

Free 100% Client-Side Auditor

Because nobody should paste private production YAML into a remote server, I built a zero-upload browser auditor that checks all 12 rules locally in 0.1 seconds:

👉 Audit your Dockerfile / K8s YAML free: https://sellerpro-calc-kr.netlify.app/k8s-audit/

If you want pre-hardened Docker, Nginx, GitHub Actions Trivy CI/CD, encrypted S3 Postgres backups, and a 35-point launch checklist, grab the full pack (20% off with PH20): https://sellerprohq.gumroad.com/l/sre-deploy-pack/PH20

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.