CI/CD Pipeline Security Interview Questions: Supply Chain Security
Reviewed by Mark Dickie · Last updated
7 questions on this page you can answer and see marked on the spot. Go to the first one
Supply-chain security in CI/CD pipelines is the set of controls that protect the build process and its dependencies from tampering, injection, and unauthorized access between code commit and deployment. Interviewers test this area because a compromised pipeline can ship malicious code to every downstream environment at once. You should know the SLSA framework levels, how artifact signing and verification work (Sigstore, Cosign, in-toto attestations), what an SBOM is and when it gets generated, and the common attack vectors like dependency confusion and poisoned build tools.
Below is a quick map of the core topics that come up in pipeline security interviews:
| Topic | What an interviewer checks |
|---|---|
| SLSA framework | Whether you can name the four levels and what each level requires (provenance, build platform, hermetic builds) |
| Artifact signing | Sigstore/Cosign signing, keyless vs key-based, verification at deploy time |
| SBOM generation | CycloneDX vs SPDX formats, where in the pipeline to generate, how to use for vulnerability scanning |
| Secrets management | Vault, cloud KMS, masked variables, avoiding secret leakage in logs and artifacts |
| Dependency confusion | Attack mechanism and defenses (scoped registries, lockfile pinning, private registry namespacing) |
| Pipeline RBAC | Least-privilege service accounts, protected branches, approval gates |
What does a CI/CD supply-chain security interview test?
Interviewers want to see that you understand the build pipeline as an attack surface, not just a delivery tool. They will probe whether you can identify where trust boundaries exist and what controls guard each one. Expect questions that mix conceptual knowledge (how does provenance work?) with practical scenario design (given a monorepo with shared runners, where do you add signing and verification?).
How should you prepare for pipeline security questions?
- Learn the SLSA levels cold: Level 1 requires documented provenance, Level 2 adds tamper-resistant provenance, Level 3 requires a hermetic, isolated build, and Level 4 adds two-party review of build changes.
- Practice explaining artifact signing end-to-end: sign at build time, store signatures in an OCI registry or transparency log, verify before promotion or deploy.
- Know how to generate and consume an SBOM: produce it during the build stage, scan it against a vulnerability database, and store it alongside the artifact for audit.
- Study the major supply-chain attack patterns: dependency confusion, typosquatting, compromised build tools, and pull-request poisoning via fork-based workflows.
- Review your secrets-management posture: rotate credentials, scope tokens to specific repositories, and never bake secrets into container images.
What are the most common pipeline security mistakes candidates describe?
A frequent interview pitfall is describing security tools without connecting them to a threat model. An interviewer asks "how would you secure this pipeline" and the candidate lists tools (Cosign, Grype, Trivy) without saying which risk each one mitigates. Tie every control to a specific attack: SBOM scanning catches known-vulnerable dependencies before they reach production; signed provenance lets a deploy step reject artifacts built outside the trusted pipeline; scoped tokens limit blast radius when a pipeline secret leaks.
Key facts
- Tarmac has 13 CI-CD Pipelines interview questions on this topic, 10 of them on this page, at difficulty 1–5 of 5.
- Tarmac tracked 2,604 job postings asking for CI-CD Pipelines in September 2026.
- Roles asking for CI-CD Pipelines advertise a median base salary of £76,920, across 1,058 job postings as of September 2026.
- Tarmac last reviewed these CI-CD Pipelines interview questions on 14 September 2026.
At a glance
| Questions | 10 shown · 13 in the bank |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | Multiple choice, True / false, Short answer, Flashcard, Multiple answer, Ordering, Find the bug, Fill in the blank |
What you'll review
- supply chain security
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
In a CI/CD pipeline, what is the primary purpose of pinning a third-party dependency to a specific, immutable version digest (e.g., a SHA-256 hash) rather than a floating tag like latest?#
Options
Show answer
Pinning a dependency to an immutable version digest ensures the same reviewed artifact is used in every build, preventing a compromised or altered upstream update from silently entering the pipeline. Unlike a floating tag such as latest, a content hash cannot be republished with different bytes, giving you reproducible and tamper-evident builds.
Floating tags like latest can be republished or updated by the maintainer (or an attacker who compromises the package) at any time, meaning a build that passed review today could pull a different, malicious artifact tomorrow. Pinning to a cryptographic digest ensures the exact bytes that were reviewed are the ones used in every subsequent build, which is the core idea behind supply-chain integrity in CI/CD. The other options describe unrelated concerns: caching, cost, and compatibility are not guaranteed by digest pinning.
True or false: pinning a third-party GitHub Action in your CI workflow to a full-length commit SHA (for example, uses: actions/checkout@<40-character-sha>) protects you from the action's upstream version tag (such as v4) being moved to point at different, malicious code.#
Options
Show answer
Pinning a third-party CI action to a full-length commit SHA does protect against its version tag being repointed to malicious code. Git tags are mutable references that a compromised account or a force-push can move, while a commit SHA identifies one exact, unchangeable snapshot of the code.
Git tags are mutable references: whoever has write access to the repository, including an attacker who compromises a maintainer account, can force-push a tag like v4 to a different commit. A full-length commit SHA identifies one exact snapshot of the content and cannot be repointed, so a workflow pinned to a SHA keeps running the code that was reviewed even if the tag is later moved. The statement is therefore true.
Your team's CI/CD pipeline automatically restores third-party package dependencies on every build from a public registry. An attacker publishes a malicious package with the same name as one of your internal-only packages to that public registry. Which practice most directly prevents the pipeline from pulling the attacker's package instead of your internal one?#
Options
Show answer
Pin dependency versions with a lockfile and fail the build when the lockfile is out of sync with the manifest. A lockfile records the exact resolved versions (and integrity hashes) from a prior trusted build, so the pipeline restores those vetted packages instead of dynamically resolving names from a public registry where an attacker could publish a same-named malicious package — the classic dependency-confusion attack.
A dependency-confusion attack exploits a pipeline that resolves package names against a public registry before (or instead of) a private one. A lockfile records the exact resolved versions and integrity hashes of every dependency from a prior trusted build; restoring from the lockfile and failing when it is out of sync with the manifest ensures the pipeline fetches the same vetted package versions rather than resolving names dynamically and pulling a newly published malicious package. Branch protection, artifact storage, and parallel test execution do not address dependency resolution or supply-chain integrity.
Your CI workflow uses a third-party GitHub Action referenced as uses: some-org/build-action@v4. Security guidance recommends pinning it instead to a full 40-character commit SHA, such as uses: some-org/build-action@<40-hex-sha>. In one or two sentences, explain why a version tag like @v4 is a weaker reference than a commit SHA from a supply-chain security standpoint.#
Show answer
A tag such as v4 is a mutable Git reference: the action's maintainer, or an attacker who compromises the repository or a maintainer account, can force-push the tag to point at different, malicious code, and the workflow will silently run it on the next build. A full commit SHA is an immutable, content-addressed identifier, so it always resolves to exactly the code that was reviewed.
The key point is that a Git tag is just a movable pointer, so its meaning can change after you reviewed it. Whoever controls the repository, including an attacker who has compromised it, can repoint v4 to new code, and a workflow referencing @v4 will pull that code without any change to the workflow file. A 40-character commit SHA names one specific snapshot of the source tree and cannot be redirected to different content, which is why pinning to a SHA is the recommended mitigation for third-party actions.
According to the SLSA v1.0 framework, what security property distinguishes Build Level 2 from Build Level 1?#
Options
Show answer
SLSA v1.0 Build Level 2 requires that build provenance be generated by a hosted build service in a way that resists forgery or tampering by the build's own users. At Level 1, provenance merely needs to exist and can be self-reported by the build script, so it is trivially forgeable. The Level 2 guarantee is non-falsifiable provenance produced by a trusted platform — not signing (a mechanism), build isolation (Level 3), or dependency pinning (a source-track concern).
Under SLSA v1.0, Build Level 1 only requires that build provenance exists — it may be self-reported by the build script itself, so an attacker who controls the build can forge it. Build Level 2 introduces the requirement that provenance is produced by a hosted/managed build service in a way the build's users cannot tamper with, making the attestation non-falsifiable by the party running the build. The claim that build provenance attestations must be cryptographically signed by the build platform's key management service describes a possible implementation mechanism for non-falsifiability, but cryptographic signing by a KMS is not itself the stated Level 2 requirement. The claim that builds must be fully isolated from one another, running in separate hardened environments with no shared infrastructure describes a Build Level 3 requirement (hardened, isolated builds). The claim that all transitive build dependencies must be pinned and verified against a cryptographically locked dependency manifest concerns dependency/source integrity, which SLSA addresses through separate source-level tracks, not the build-level distinction between L1 and L2.
In CI/CD supply-chain security, what is a software bill of materials (SBOM), and why does a pipeline generate one?#
Show answer
An SBOM is a machine-readable inventory of every component (libraries, transitive dependencies, base images, and their versions and licenses) that makes up a build artifact. Pipelines generate one at build time so teams can quickly determine whether a newly disclosed vulnerability affects a given artifact, verify licenses, and audit what is actually shipped rather than what was assumed.
An SBOM is the inventory that answers the question 'what is inside this artifact?' It is generated from the actual build so it reflects the real dependency graph, including transitive dependencies and base images. This lets responders scope exposure to a CVE across deployed artifacts without rebuilding or guessing, which is the core reason pipelines emit SBOMs alongside build outputs.
Which of these measures meaningfully harden a build pipeline against software supply-chain attacks? Select all that apply.#
Options
Pick every one that applies.
Show answer
Pinning third-party actions and dependencies to an immutable commit SHA prevents tag-repointing attacks, and generating signed provenance or attestations (SLSA, in-toto) lets consumers verify an artifact came from your trusted build. Both are real supply-chain hardening. Granting the broadest token permissions and removing network-egress restrictions do the opposite — they widen the blast radius of a compromised step and ease secret exfiltration, violating least privilege.
Supply-chain hardening is about provenance and least privilege. Pinning dependencies and actions to an immutable commit SHA stops an attacker who repoints a mutable tag (a common attack) from injecting code into your build. Signed provenance/attestations let downstream consumers verify an artifact really came from your trusted build, the core idea behind SLSA. The two distractors are the opposite of hardening: broad token permissions widen the blast radius of any compromised step (least privilege is the rule), and unrestricted egress lets a malicious step exfiltrate secrets or pull attacker-controlled payloads. 'Make it never fail' and 'let it reach anything' are convenience choices that trade away security.
A team wants a CI/CD pipeline where every production container image can be traced back to reviewed source and verified before it runs. Put these pipeline steps in the order they must occur, from first to last.#
Put these in order
Show answer
The secure supply-chain order is: check out source at a pinned commit, install hash-verified locked dependencies, build in a hermetic runner to get a digest, generate SBOM and provenance for that digest, sign it, verify the signature at admission, and only then deploy. Each step consumes the output of the one before it, so the order is fixed.
Each adjacent pair is a true data or trust dependency. The source must be pinned before dependencies are resolved from the lockfile, because the lockfile belongs to that commit. Dependencies must be present before the hermetic build runs. The build produces the image digest, which is the subject that the SBOM and provenance attestation must reference, so attestations come after the build. The signature covers the digest and its attestations, so signing comes after both are generated. Admission verification can only check a signature that exists, so it follows signing and precedes scheduling. Rollout of the image happens last, once it has passed verification.
This GitHub Actions workflow on a public repo is meant to build and test pull requests from forks. A security researcher reports it can be used to steal the deploy key. What's the vulnerability?#
on:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: npm install && npm test
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}Options
Show answer
pull_request_target runs with the base repo's secrets, but the job checks out and executes the fork's untrusted PR code (head.sha) — that code can read DEPLOY_KEY and exfiltrate it
pull_request_target runs in the context of the base repository, so it has access to repository secrets even for a pull request from a fork — unlike the normal pull_request trigger. The fatal combination here is then checking out and running the PR's own code (github.event.pull_request.head.sha) with npm install && npm test: an attacker opens a PR with a malicious package.json script or test that reads secrets.DEPLOY_KEY from the environment and ships it to an attacker server. GitHub's own guidance is to never check out or execute untrusted PR code in a pull_request_target workflow that holds secrets. Pinning checkout, using npm ci, or the runner image are red herrings — the bug is executing untrusted code with secret access.
A CI job signs a container image keylessly with Sigstore's cosign. The short-lived X.509 signing certificate is issued by the Sigstore certificate authority _____ after the job's OIDC identity token is verified, and the resulting signature entry is appended to the Sigstore tamper-evident transparency log _____. Give the name of each Sigstore component in the order the blanks appear.#
Show answer
A CI job signs a container image keylessly with Sigstore's cosign. The short-lived X.509 signing certificate is issued by the Sigstore certificate authority Fulcio after the job's OIDC identity token is verified, and the resulting signature entry is appended to the Sigstore tamper-evident transparency log Rekor. Give the name of each Sigstore component in the order the blanks appear.
In keyless Sigstore signing, cosign obtains an ephemeral key pair and sends the public key plus an OIDC identity token to Fulcio, the certificate authority that verifies the identity and issues a short-lived certificate binding that identity to the key. The signature is then recorded as an entry in Rekor, an append-only transparency log built on a Merkle tree, so verifiers can later confirm the signature existed while the certificate was valid. Cosign is the client tool that drives this flow rather than either service, so it is not the answer to either blank.
Related interview questions
Job market
See ci-cd-pipelines salaries and hiring demand from live job postings.
The other 3 questions
This page shows 10 and marks what you pick. That's as far as a page can go. A free account opens the other 3 and keeps every answer. What you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 marked answers per 30 days · written feedback on the paid plan