Container Virtual Registry
Container image provenance with Cosign in GitLab CI/CD

Container image provenance with Cosign in GitLab CI/CD

9/4/2024 · João Pereira

What this post added

This post introduces the integration of Cosign into GitLab CI/CD pipelines for container image provenance. It details a `.gitlab-ci.yml` configuration that automates building, signing, and annotating Docker images using Cosign and the GitLab container registry. Key technical contributions include setting up Docker-in-Docker, using OIDC tokens for keyless signing, installing Cosign, logging into the GitLab registry, building and pushing images, retrieving image digests, signing images with specific annotations (e.g., user name, pipeline ID, job URL, commit SHA), and verifying signatures with annotations and certificate identity checks.

Read the original post ↗