Sign Images with cosign and Enforce Signatures at Admission
Advanced · 60 minutes · 4 tasks, checked automatically · 100 points
In this advanced security lab you will install cosign inside the toolbox, generate a key-pair, sign a container image stored in a local registry, and then deploy Kyverno as an admission controller to enforce that only signed images are allowed to run in a protected namespace. You will validate the entire chain: unsigned images are rejected, signed images are admitted. This lab covers supply-chain security fundamentals that are essential for production Kubernetes environments.
What you’ll learn
- Install cosign and a local OCI registry, then sign a container image with a generated key-pair
- Deploy Kyverno admission controller into the cluster
- Create a Kyverno ClusterPolicy that enforces image signature verification and validate that unsigned images are rejected while signed images are admitted
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: cosign, kyverno, supply-chain-security, image-signing, admission-control, security, oci, policy-enforcement, kubernetes-security
Create a free account to start this lab.
Keep going
- Harden Workloads with Pod Security Standards and SecurityContext
- Enforce Pod Security Admission at the Namespace Level
- Read-Only Root Filesystems and seccomp Profiles
- Aggregated ClusterRoles for Extensible Permissions
- Bound ServiceAccount Tokens for Workload Identity
- Issue and Auto-Renew TLS Certificates with cert-manager