If nothing checks that code, scripts and build outputs are exactly what a trusted process produced, a single tampered artefact flows through every later stage and into production looking legitimate. OWASP lists this as CICD-SEC-9 Improper Artifact Integrity Validation in the Top 10 CI/CD Security Risks. This guide covers what the risk includes, how SLSA, Sigstore and in-toto fit together, how to roll out signing and verification without breaking delivery, what evidence proves it works, and how the controls map to NIST, CIS, ISO and MITRE ATT&CK. It is for platform and release engineers, DevSecOps teams, and anyone who owns the signing identities in a build system. For the wider provenance model, read it alongside the SLSA and Build Provenance Guide.
Key takeaways
- Every hand-off is an entry point. OWASP notes that the final artefact depends on many inputs from many contributors across many steps, and each can be tampered with.
- Sign at creation, verify before consumption. OWASP's core recommendation is to sign each resource with external signing infrastructure and validate it against the signing authority before the next step uses it.
- Signatures prove origin, not safety. SolarWinds Orion builds were tampered during the build and then signed normally; verification must cover how the artefact was built, not only who signed it.
- Verification is where the value is. SLSA states that provenance does nothing unless somebody inspects it, and GitHub states that generating attestations alone provides no security benefit.
- Signing identities are the crown jewels. Whether keys in a KMS or short-lived OIDC identities used by Sigstore, the identity that signs must be one that user-defined build steps cannot reach.
What it is and who it applies to
OWASP defines the risk as allowing "an attacker with access to one of the systems in the CI/CD process to push malicious (although seemingly benign) code or artifacts down the pipeline, due to insufficient mechanisms for ensuring the validation of code and artifacts." Once a tampered resource gets past the first gate without raising suspicion, it is likely to continue all the way to production in the guise of a legitimate resource. The impact is execution of attacker code on systems inside the CI/CD process or, worse, in production.
The OWASP references show how varied the entry points are:
- Build system tampering: in the SolarWinds supply chain compromise, SUNSPOT injected SUNBURST into Orion builds while the source repository stayed clean, and the builds were signed and shipped between March and June 2020.
- Fetched third-party scripts: in the Codecov breach the hosted uploader script was modified; a customer detected it by comparing the script's hash with the published one.
- Source tampering: malicious commits were pushed to the PHP git repository attributed to known contributors.
- Persistent build server compromise: a Webmin backdoor survived the build server's decommissioning because code was restored from a local backup rather than source control, leaving users exposed for over 15 months.
The risk applies to anyone who builds and ships software, internal or external, and to anyone who consumes artefacts: container images, packages, binaries, infrastructure as code templates and scripts piped into a shell during a build. It is closely related to OWASP CI/CD Top 10 CICD-SEC-3 Dependency Chain Abuse Guide, which covers malicious packages chosen by name; CICD-SEC-9 is about proving that what arrives is what the trusted producer made.
Structure and key requirements
OWASP recommends a collection of measures across the delivery chain. The table maps each to the tooling that implements it.
| OWASP measure | What it protects | Implementation examples |
|---|---|---|
| Code signing | Commits and tags entering the pipeline | GPG, SSH or S/MIME commit signing; branch rules that require signed commits; SLSA Source Track for source provenance |
| Artefact verification software | Build outputs and their provenance | Sigstore (Cosign, Fulcio, Rekor) for signing; SLSA provenance; in-toto attestations and layouts |
| Configuration drift detection | Deployed resources | Detect cloud resources not created from a signed infrastructure as code template; compare live state with the approved plan |
| Hash verification of third-party resources | Scripts and tools fetched during builds | Compare a calculated hash with the provider's published hash before running; pin actions to full commit SHAs; lock files with integrity hashes |
How SLSA, Sigstore and in-toto fit together
OWASP names all three, and they solve different parts of the problem.
| Project | What it is | Role in CICD-SEC-9 |
|---|---|---|
| SLSA (current version 1.2) | A framework of tracks and levels. Build L1: provenance exists. Build L2: signed provenance generated by a hosted build platform. Build L3: hardened platform that isolates runs and keeps signing material away from user-defined steps. Version 1.2 adds a Source Track (L1 to L4, with two-party review at L4) | Defines what provenance should say and how trustworthy it is; defines how consumers verify it |
| in-toto | A specification (v1.0) in which a project owner signs a layout of required steps, functionaries sign link metadata as evidence each step ran, and clients verify the chain. The in-toto Attestation Framework defines the statement format SLSA provenance uses | Proves that each required step happened, in order, by an authorised party |
| Sigstore | Cosign signs artefacts; Fulcio issues short-lived certificates bound to an OIDC identity; Rekor records signing events in an append-only transparency log. The ephemeral private key is discarded after one signing | Signs artefacts and attestations without long-lived keys, and ties each signature to a workload identity |
Decision guidance: keyless Sigstore signing suits CI systems that issue OIDC tokens (GitHub Actions, GitLab CI, cloud build services) and removes long-lived key management; the trade-off is dependence on the identity provider and, for the public instance, signing metadata written to a public log. Key-based signing in a KMS or HSM suits air-gapped builds, regulated environments that require an internal PKI, and private software where public logging is unacceptable (Cosign supports KMS, hardware keys and bring-your-own PKI). GitHub's own artefact attestations use the public Sigstore instance for public repositories and a GitHub instance without a transparency log for private repositories. Small teams on a hosted CI platform should start with the platform's built-in attestation and an admission check; large organisations with many build systems should standardise on one provenance format and one verification policy engine across them.
Identity and NHI requirements
Artefact integrity is an identity problem: a signature only means something if the signing identity is controlled. The verifier trusts a builder identity, not a file.
- Builder identity as root of trust: SLSA verification starts from a configured map of trusted builder identities to the maximum SLSA Build level each is trusted for. Keep that map short and owned.
- Workload identity for keyless signing: with Sigstore, the certificate identity is the CI workflow (for example a specific workflow file at a specific ref). Verify the exact identity and issuer, not just "signed by Sigstore". A GitHub Actions job needs
id-token: writeandattestations: writeto attest; grant them only to release jobs. - Isolate signing material: SLSA Build L3 requires that secret material used to sign provenance is not accessible to user-defined build steps. Signing in a separate job or reusable workflow that the calling workflow cannot alter is the practical pattern.
- Protect static keys like privileged credentials: where keys are unavoidable, keep them in a KMS or HSM, scope who and what can call sign operations, and rotate on staff and vendor changes. The GitHub code signing certificate theft began with a machine account's token, and the Codecov breach exposed a HashiCorp GPG signing key that sat in CI environment variables.
- Commit signers are identities too: map signing keys to accounts, remove them at offboarding, and treat bot commits (dependency updaters, release bots) as signed machine identities.
See the Code Signing Security Guide for key custody and the CI/CD Pipeline Identity Security Guide for workload identity in pipelines.
Implementation steps
- Map the chain (weeks 1 to 2). For each product, list every artefact hand-off from commit to production: source, dependencies, fetched scripts, build outputs, registries, deployment manifests. Mark where nothing is verified today.
- Close the cheap gaps first (weeks 2 to 4). Pin third-party actions to full commit SHAs, replace "curl and run" scripts with hash-checked downloads, enforce lock files with integrity hashes, and deploy container images by digest rather than tag.
- Generate signed provenance (weeks 4 to 8). Add provenance generation and signing to release builds only; GitHub notes that test builds and individual source files do not need signing. On GitHub Actions the
actions/atteststep does this and, on its own, provides SLSA Build L2. Move the build into a shared reusable workflow to move towards Build L3. - Verify in audit mode (weeks 6 to 10). At each consuming step (promotion between registries, deployment, Kubernetes admission) verify the signature, that the subject digest matches the artefact, that the builder identity is trusted, and that
buildTypeandexternalParametersmatch expectations. Log failures without blocking, using a pilot namespace or environment. - Enforce by ring. Turn on blocking for one service, then one environment, then production. For Kubernetes, the Sigstore policy-controller validates signatures and attestations at admission on namespaces opted in with the
policy.sigstore.dev/includelabel and resolves tags to digests; see the Kubernetes Admission Control Guide. - Add source and drift controls. Require signed commits on protected branches, and run drift detection that flags cloud resources not deployed from a signed template.
- Rollback and break-glass. Keep enforcement switchable per namespace or environment, with a documented break-glass exception that is time-limited, logged and reviewed. Never fix a failed verification by widening the trusted identity pattern.
Evidence and assessment
- Coverage: list of release artefacts with provenance and signatures, and which consuming steps verify them in enforce mode.
- Policy: the verifier's roots of trust (trusted builder identities and levels), the expected
buildTypeand parameters per product, and the admission or deployment policy files under version control. - Logs: verification decisions at admission or deployment, including denials and break-glass use; transparency log entries for public signing.
- Source: branch rules requiring signed commits and review; percentage of verified commits on release branches.
- Test: a periodic exercise that attempts to deploy an unsigned or re-tagged image and shows it is blocked.
Detection: alert on verification failures, deployments by tag instead of digest, signatures from an identity outside the trusted set, signing events in the transparency log for your identities that do not match a known release (Sigstore notes identity owners can monitor the log for this), unsigned commits on protected branches, and drift between deployed resources and templates.
Metrics:
- Percentage of production deployments verified against signed provenance in enforce mode.
- Percentage of release artefacts at SLSA Build L2 and at Build L3.
- Percentage of third-party scripts and actions pinned by hash or full SHA.
- Number of break-glass bypasses per month and their average duration.
- Percentage of commits on release branches that are signed and verified.
- Drift findings open longer than 7 days.
Mapping to other frameworks
| Framework | Reference | Relevance to CICD-SEC-9 |
|---|---|---|
| NIST SP 800-53 Rev. 5 | SI-7, SI-7(6), SI-7(15), CM-14, SA-10(1), SR-4, SR-11, CM-7(5) | Software integrity, cryptographic protection, code authentication, signed components, integrity verification in configuration management, provenance, component authenticity, allow-by-exception |
| NIST SP 800-218 (SSDF) | PS.1, PS.2 (PS.2.1), PS.3 | Protect all forms of code from tampering; provide a mechanism for verifying release integrity; archive and protect each release |
| NIST CSF 2.0 | PR.PS-06, PR.PS-01, GV.SC-07 | Secure development practices, configuration management, supplier risk |
| CIS Controls v8.1 | Control 16 Application Software Security; Control 2 Inventory and Control of Software Assets | Secure build and release process; only authorised software runs |
| ISO/IEC 27001:2022 Annex A | 8.25, 8.32, 8.9 | Secure development life cycle, change management, configuration management |
| MITRE ATT&CK v20 | T1195.002 Compromise Software Supply Chain; T1195.001 Compromise Software Dependencies and Development Tools; T1553.002 Code Signing; T1554 Compromise Host Software Binary | Tampered builds and tools, abuse of signing to make malicious code look trusted, modified binaries |
Common pitfalls
- Signing without verifying. Attestations that no deployment step checks give no protection; both SLSA and GitHub say so explicitly.
- Treating a valid signature as proof of safety. SolarWinds customers' signature checks passed because the tampering happened before signing. Verify provenance (builder, source, build parameters), not just the signature.
- Verifying "any Sigstore signature". Keyless verification without pinning the expected identity and issuer accepts a signature from anyone who can obtain a certificate.
- Mutable references. Deploying by tag, or calling actions by tag, lets a tag be moved after review. The tj-actions/changed-files compromise worked by repointing every version tag to a malicious commit.
- Signing keys reachable from build steps. A key in a CI variable can be stolen by any step, as the Codecov exposure of a signing key showed. Keep signing in an isolated job with a short-lived identity.
- Restoring from local copies. The Webmin case shows that rebuilding from a server backup instead of verified source can reintroduce a backdoor; rebuild from source and verify against recorded provenance.
Practitioner checklist
- Map every artefact hand-off from commit to production and mark unverified ones.
- Pin actions to full commit SHAs, hash-check fetched scripts and deploy images by digest.
- Generate signed SLSA provenance for every release artefact, aiming for Build L3 through isolated reusable build workflows.
- Verify signature, subject digest, builder identity and build parameters before promotion and deployment.
- Pin the expected signer identity and issuer in every keyless verification policy.
- Keep signing keys in a KMS or HSM, or use short-lived OIDC identities, never CI variables.
- Require signed commits and review on protected release branches.
- Roll out enforcement in rings with a logged, time-limited break-glass path.
- Monitor transparency log entries and verification denials for your identities.
- Run drift detection against signed infrastructure templates.
Standards and references
- OWASP: CICD-SEC-9 Improper Artifact Integrity Validation
- SLSA: Build Track Basics (v1.2)
- SLSA: Verifying artifacts (v1.2)
- in-toto: Specification v1.0
- Sigstore: Overview
- GitHub Docs: Artifact attestations
- NIST: SP 800-218 Secure Software Development Framework
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: SLSA and Build Provenance Guide · Code Signing Security Guide · Software Supply Chain Security Guide · OWASP CI/CD Top 10 CICD-SEC-8 Ungoverned Usage of Third-Party Services Guide · Top 10 CI/CD Security Risks