Free overview · hard · Lesson 6 of 8

Images and signatures

Distroless instead of an image with a shell and utilities, cosign image signing and Kyverno signature verification against a swap under the same tag.

The sixth lesson of the hardening track: defense on the image side. In an image with a shell and utilities, an attacker who runs commands through a hole in the code has everything they need. And an image tag can be overwritten: whoever gets push access to the registry runs their code on the next rollout.

Threat model

Two attackers. The first runs commands in a Pod through a vulnerable endpoint and uses whatever is in the image. The second got write access to the registry and replaces a service image under the same tag.

Attack path

  1. Shell commands through a vulnerable endpoint: wget, nc, a package manager in the image.
  2. Your own image under an existing tag, imagePullPolicy: Always, an ordinary CI rollout.
  3. The attacker's code in a Pod next to the database password in the environment variables.

Checklist

Practice

Two labs on the shared cluster of the track. In the first you build web on a distroless image, and the /debug hole stops running commands. In the second the attack replaces the api image in the registry, and you sign the shop images with cosign and turn on signature verification in Kyverno.

Done reading?

Mark the lesson as read to move your track progress forward.

Practice

Fix a local lab. The agent checks your work and gives hints if you get stuck.

Full access to all labs

$134 $67.00 for one year −50%

One payment, no auto-renewal · Terms

Buy for $67.00