Skip to content

Security in CI/CD Pipelines: CNPA practice questions

A CI/CD pipeline is a privileged system: it reads source code, holds credentials, builds the artifacts that will run in production and often has the power to deploy them. Securing it serves two goals, finding vulnerabilities early and proving that what runs in production is exactly what was built from reviewed source.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Security in CI/CD Pipelines covers in CNPA

A CI/CD pipeline is a privileged system: it reads source code, holds credentials, builds the artifacts that will run in production and often has the power to deploy them. Securing it serves two goals, finding vulnerabilities early and proving that what runs in production is exactly what was built from reviewed source.

The first goal is what DORA's pervasive security capability calls shifting left: integrating security objectives into daily work instead of testing at the end, when flaws are expensive to fix. In a pipeline that means static analysis of code, scanning dependencies and container images for known vulnerabilities, checking infrastructure and Kubernetes manifests against policies, and failing the build when a rule is broken. The Platforms White Paper lists static analysis of code and artifacts, runtime analysis and policy enforcement among a platform's security services, so teams inherit these checks through the golden-path pipeline rather than each wiring them up.

The second goal is supply chain integrity. SLSA is a set of incrementally adoptable guidelines for supply chain security, established by industry consensus, useful both to producers and to consumers deciding whether to trust a package. Its build track defines levels: Build L0 offers no guarantees, Build L1 means provenance exists showing how the package was built, Build L2 means signed provenance generated by a hosted build platform, and Build L3 means a hardened build platform. Sigstore makes signing practical. A client such as Cosign signs an artifact, Fulcio issues a certificate tied to an OpenID Connect identity, and the signing event is recorded in Rekor, an append-only transparency log, which allows keyless signing without long-lived key pairs. Kubernetes signs its own release artifacts with cosign keyless signing and publishes a Software Bill of Materials (SBOM) that users can verify; an SBOM lists the components inside an artifact so that newly disclosed vulnerabilities can be matched against it later.

Deployment completes the chain. Admission policies, for example Kyverno's image verification, can require that only signed images from approved registries run. Images should be referenced by digest, because a digest is an immutable hash of the content while a tag can be moved. GitOps reduces exposure as well: when an agent inside the cluster pulls changes, the CI system no longer needs credentials for the production cluster.

Pipeline hygiene matters as much as tools. Secrets belong in a secret manager and are injected at run time with the narrowest scope, never committed or printed to logs. Build jobs get only the permissions they need, third-party components and base images are pinned, and changes to pipeline definitions are reviewed like any other code.

Misconceptions include treating a vulnerability scan as complete supply chain security, assuming a signed image is safe (a signature proves origin, not the absence of flaws), and believing a private registry makes provenance unnecessary.

At associate level, expect questions on SLSA build levels, what each Sigstore component does, what an SBOM is for, where in the pipeline a control belongs, and why digests are safer than tags.

Key points

  • Shifting left builds security checks into the pipeline instead of testing at the end.
  • SLSA build levels run from L0 (no guarantees) through L1 provenance, L2 signed hosted provenance, to L3 a hardened build platform.
  • Sigstore: Cosign signs, Fulcio issues identity-bound certificates, Rekor records signatures in a transparency log.
  • Reference images by digest; tags are mutable, digests are not.

Three sample questions

8 CNPA questions on Security in CI/CD Pipelines, 8 with explanations. How practice works

Question 1

Which SLSA Build level (spec v1.2, unchanged from v1.0) adds the requirement that provenance is signed and generated by a hosted build platform?
  1. A.Build L3
  2. B.Build L1
  3. C.Build L0
  4. D.Build L2

Correct answer: D

The SLSA build track (v1.2, the current version; the levels are the same as in v1.0) defines Build L0 (no guarantees), Build L1 (provenance exists, showing how the package was built), Build L2 (signed provenance, generated by a hosted build platform, which protects against tampering after the build) and Build L3 (a hardened build platform, protecting against tampering during the build). Why the other options are wrong. "Build L3": L3 adds a hardened build platform against tampering during the build; signed provenance from a hosted platform is already L2. "Build L1": L1 only requires that provenance exists; it does not require signing by a hosted platform. "Build L0": L0 provides no guarantees.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), SLSA v1.2: Build track basics

Question 2

A CI pipeline signs container images with Sigstore's keyless signing. Which statement describes how that works?
  1. A.Signatures are stored only inside the image layers, so no external log is ever involved.
  2. B.Fulcio issues a short-lived certificate for the OIDC identity, and Rekor logs the signing.
  3. C.The registry signs every image automatically with its own key when the image is pushed.
  4. D.A long-lived private key is generated once and stored in the repository as a CI secret.

Correct answer: B

Sigstore's overview describes keyless signing: the client makes a certificate request to Fulcio with an OIDC identity token, signs the artifact, and records the digest, signature and certificate in Rekor, an immutable append-only transparency log that verifiers check. Why the other options are wrong. "Signatures are stored only inside the image layers, so ...": The transparency log Rekor is a central part of verification. "The registry signs every image automatically with its own ...": Signing is done by the Sigstore client (for example cosign) with the signer's identity, not by the registry. "A long-lived private key is generated once and stored ...": Keyless signing avoids long-lived keypairs.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Sigstore: Overview

Question 3

Why would a platform team make its build pipeline produce a software bill of materials (SBOM) for every artifact?
  1. A.To record a nested inventory of the components inside the software, for supply chain risk work.
  2. B.To replace vulnerability scanning, because generating an SBOM fixes vulnerable components.
  3. C.To speed up later builds by caching every dependency that the build had to download from public registries.
  4. D.To sign the artifact cryptographically so that any later tampering with it can be detected.

Correct answer: A

CISA describes an SBOM as a nested inventory, a list of ingredients that make up software components, and as a key building block in software security and software supply chain risk management. Why the other options are wrong. "To replace vulnerability scanning, because generating an SBOM fixes ...": An SBOM is an inventory; it does not fix anything, though it helps find affected components. "To speed up later builds by caching every dependency ...": An SBOM is a record of components, not a build cache. "To sign the artifact cryptographically so that any later ...": Signing is done with tools such as Sigstore; an SBOM lists components.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), CISA: Software Bill of Materials (SBOM)

Practice this topic

Focus mode keeps every question on Security in CI/CD Pipelines until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CNPA practice across all topics.

Sources

The explanation above was checked against these official documents.