312-50 ยท Cloud computing security
Container and Kubernetes security
Docker and Kubernetes components, image and registry risks, container escape, exposed APIs, runtime protection.
Key points
- Containers share the host kernel: a kernel flaw or privileged container can enable escape to the host.
- Risks: vulnerable or untrusted images and registries, secrets in images, exposed Docker socket.
- Exposed Kubernetes API server (6443) or kubelet (10250), weak RBAC, permissive pod settings.
- Defenses: scan and sign images, non-root with minimal capabilities, network policies, RBAC, admission control, runtime monitoring.
Source: https://kubernetes.io/docs/reference/networking/ports-and-protocols/
Practice questions
Which resource do all containers on one host share, making a kernel vulnerability so serious?
- The host operating system kernel
- A private guest kernel per container
- The container image registry
- The application source repository
Show answer
Answer: A. The host operating system kernel
Containers isolate processes with namespaces but all use the host kernel; VMs each have their own kernel. Images and filesystems are per-container.
Which settings increase the risk of container escape?
- Running the container in privileged mode
- Mounting the host Docker socket into the container
- Using a read-only root filesystem
- Dropping all Linux capabilities not needed
- Running as a non-root user
Show answer
Answer: A. Running the container in privileged mode, B. Mounting the host Docker socket into the container
Privileged mode and a mounted Docker socket give near-host control. Read-only root filesystem and dropped capabilities reduce risk.
True or false: an image pulled from a public registry is safe to deploy if it has many downloads.
Show answer
Answer: False
False. Popularity says nothing about integrity or vulnerabilities; images should be scanned, pinned by digest and preferably signed.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
