Bitzu

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

Single choice

Which resource do all containers on one host share, making a kernel vulnerability so serious?

  1. The host operating system kernel
  2. A private guest kernel per container
  3. The container image registry
  4. 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.

Select all that apply

Which settings increase the risk of container escape?

  1. Running the container in privileged mode
  2. Mounting the host Docker socket into the container
  3. Using a read-only root filesystem
  4. Dropping all Linux capabilities not needed
  5. 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

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.

Download on the App StoreGet it on Google Play

More 312-50 topics in this module