TGViewer
DevOps & SRE notes DevOps & SRE notes @devops_sre_notes · 13.3K subscribers
Post #2610 2.98K
The author conducts a side-by-side security experiment using Minikube to compare a standard root-privileged container against a custom non-root Alpine container. Through three distinct attack vectors, the article illustrates how non-root configurations actively block common exploitation attempts that succeed in root-privileged environments.

Key Insights:

- Tooling Denial: In a root container, an attacker can easily install missing utilities (like curl) to fetch malicious payloads. The non-root container blocks package installation and unauthorized data fetching.

- Host Path Protection: The author demonstrates that if a sensitive host directory (like /etc/kubernetes/manifests) is mounted, a root user can write to it to deploy malicious static pods (e.g., crypto miners) or read sensitive host files (/etc/passwd). The non-root user is successfully denied permission to modify these files or inject new manifests.

- Privilege Escalation Barrier: The experiment shows that standard attempts to switch users (e.g., using su) inside a non-root container fail immediately, limiting an attacker's ability to escalate privileges or move laterally without explicit sudo misconfigurations.

https://medium.com/@marcin.wasiucionek/why-is-running-as-root-in-kubernetes-containers-dangerous-e5f1a116080e
Medium A hands-on lab: Why running as root in Kubernetes containers is dangerous? Explore one of crucial Kubernetes security practices on real examples
  • 👍 5
  • ❤ 1
More from @devops_sre_notes
  1. Sep 25, 2026Post #2750
  2. Sep 24, 2026Post #2749
  3. Sep 23, 2026Post #2747
  4. Sep 22, 2026Realtime log viewer with web UI, tail -f for logs with a web interface browser. https://gi…
  5. Sep 21, 2026Securing every Kubernetes workload at scale — LinkedIn Engineering https://www.linkedin.co…
  6. Sep 18, 2026Validate environment variable usage in codebase https://github.com/Chrilleweb/dotenv-diff
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →