Skip to Content
OpenVAPTAlpha
Pre-release. Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. Free for your own use, 100% at your own risk. This website collects no data. Read MoreRead Less
Pre-release. OpenVAPT has no Stable release yet. Every build is an Alpha, Beta or Release Candidate: it may be incomplete or wrong, so use it only on test machines, 100% at your own risk. See Release Channels
Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. These are AI systems, not people or registered engineers. Free for your own personal or business use, on your own machines, 100% at your own risk. Not for sale. Not for providing services. This website collects no data. Read the Acknowledgements
Pre-release. OpenVAPT has no Stable release yet. Every build is an Alpha, Beta or Release Candidate: it may be incomplete or wrong, so use it only on test machines, 100% at your own risk. See Release Channels
Academic, non-commercial, source-available code built by AI Cybersecurity Engineers. These are AI systems, not people or registered engineers. Free for your own personal or business use, on your own machines, 100% at your own risk. Not for sale. Not for providing services. This website collects no data. Read the Acknowledgements
P9PractitionerAbout 25 minutes

Containers and Kubernetes

How container isolation really works, the configuration mistakes that break it, and how to protect the Docker and Kubernetes control planes on a host.

Read First: P1

You Will Be Able To

  • Explain why control of the Docker API equals root on the host.
  • Recognise privileged containers, host namespaces, dangerous capabilities and sensitive mounts.
  • Explain kubelet authentication and why etcd and kubeconfig files must be protected.

Containers Are Processes

A container is a set of ordinary Linux processes isolated by namespaces, cgroups, capabilities and security profiles. Each of those layers can be switched off. --privileged removes almost all of them. Host namespaces share the host's processes or network. Added capabilities such as SYS_ADMIN reopen kernel interfaces.

NIST SP 800-190 recommends running containers with least privilege, read-only where possible and as non-root users. Images should be minimal and scanned for known vulnerabilities.

The Docker Control Plane

Whoever can talk to the Docker API can start a container that mounts the host's root filesystem. That makes the docker group, the docker.sock socket and any TCP listener as powerful as root. Exposing the API over TCP without mutual TLS is a common cause of cryptomining infections. Daemon defaults such as no-new-privileges, user namespace remapping and disabled inter-container communication reduce the damage a compromised container can do.

Kubernetes on the Node

Each node runs a kubelet whose API can execute commands in its pods. It must require authentication and use Webhook authorisation, never anonymous access or AlwaysAllow. Its unauthenticated read-only port should be off. etcd stores every cluster object, including Secrets, so its data directory and the cluster's kubeconfig and CA key files must be readable only by root.

In Summary

Containers share the host kernel. Privileged containers, host mounts and extra capabilities break isolation. Kubernetes needs the same least privilege thinking at every layer.

Apply It

These OpenVAPT checks put this module into practice. Open one to see its detection logic and source code.

Printable Worksheet · Teacher Answer Key · For Teachers · Print this page with your browser's Print command for a handout.

Also available as plain Markdown for notes, scripts and AI tools. Same facts, same source, no styling.

Lab

  1. Run: openvapt demo --only HOST-CTR-,HOST-K8S-,HOST-DKR- --out p9
  2. For the vulnerable container, list every isolation layer that was switched off and the docker run flag that switched it off.
  3. On a test host with Docker: docker inspect --format '{{.HostConfig.Privileged}} {{.HostConfig.Binds}}' $(docker ps -q)

Check Yourself

Answers are checked in your browser and never stored or sent.

Question 1

1. Why is mounting /var/run/docker.sock into a container dangerous?

Question 2

2. What does --privileged do?

Question 3

3. Which kubelet setting is the hardened one?

Question 4

4. What is a container?

Question 5

5. Why must etcd's data directory be readable only by root?

Question 6

6. Which practice does NIST SP 800-190 recommend?

References

Cite This Page

If this page helped your work, please cite it. The version and web address are filled in; the access date is today's date in your browser. Every other style, and when credit is required, is on How to Cite OpenVAPT.

APA 7
OpenVAPT. (2026). P9: Containers and Kubernetes (Version 0.1.0-alpha.6). OpenVAPT Academy. Retrieved October 16, 2026, from https://openvapt.com/academy/p9.html

In text: (OpenVAPT, 2026). Accessed: the date shown is today's date from your own browser (the site's build date without JavaScript); change it to the day you read the page.

BibTeX
@misc{openvapt_p9,
  author       = {{OpenVAPT}},
  title        = {{P9: Containers and Kubernetes}},
  year         = {2026},
  howpublished = {\url{https://openvapt.com/academy/p9.html}},
  note         = {OpenVAPT Academy, version 0.1.0-alpha.6. Accessed 16 October 2026}
}

Accessed: the date shown is today's date from your own browser (the site's build date without JavaScript); change it to the day you read the page.

Citing OpenVAPT does not mean OpenVAPT endorses, approves or has reviewed your work.