SECURITY ENGINEERING · PART 9 · DEVSECOPS AND SUPPLY CHAIN · SUPPLY CHAIN · 127 OF 229

Sigstore, Cosign and SLSA: Sign What You Ship

If you cannot prove where an artifact came from, an attacker can swap it for their own. This episode covers signing and provenance: why signing images and artifacts matters, how Sigstore and Cosign make keyless signing practical, build provenance and the SLSA framework for a trustworthy pipeline, verifying signatures before deploy, and how this stops the supply-chain attacks of the next episode.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 10

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Sign artifacts, SBOMs and provenance
  • keyless with Sigstore/Cosign
  • verify at deploy, pin the signer
  • SLSA levels

Notes

Why sign

Signing applies the digital signatures from Part four to the things you ship. A signature on an artifact proves two things: integrity, that it has not been altered since build, and provenance, that it came from your pipeline and not an attacker. Once you sign, you can do the powerful thing: refuse to run anything not signed by you. This applies to container images, binaries, SBOMs and deployment charts. It is how you make the registry something you can trust rather than just storage.

What signing gives you
  • integrity: the artifact has not been altered
  • provenance: it came from your pipeline, not an attacker
  • you can then REFUSE to run anything unsigned
  • applies to: container images, binaries, SBOMs, Helm charts
  • the Part 4 signatures, applied to your builds

Sigstore and Cosign

For years, the reason teams did not sign was key management: signing needed long-lived private keys stored and rotated safely, enough friction that most people skipped it. Sigstore removed that with keyless signing. You sign using a short-lived identity from an OIDC provider, such as your pipeline's, so there is no long-lived key to protect, and the signature is recorded in a public transparency log called Rekor. Cosign is the command-line tool for container images. Keyless signing made artifact signing mainstream.

Why keyless changed things
  • old problem: signing needed long-lived keys, stored safely, so nobody bothered
  • Sigstore: sign with a short- lived identity (OIDC), no key to keep
  • signature recorded in a public log (Rekor)
  • Cosign: the CLI for signing and verifying images

Verify before deploy

Signing achieves nothing unless something verifies it, and the place is at deploy. In Kubernetes, an admission controller checks every image's signature and the signing identity before allowing it to run, using Kyverno, the Sigstore policy controller or Connaisseur. The crucial detail, as with signatures in Part four, is to pin who may sign, your pipeline's identity, not merely that the image is signed by someone. And verification must fail closed: if it cannot verify, it does not deploy.

The enforcement point
  • verify at deploy: admission controller checks signature and identity
  • reject images not signed by your pipeline identity
  • tools: Cosign, Kyverno, policy-controller, Connaisseur
  • pin WHO may sign, not just "is it signed"
  • fail closed on verify failure

Provenance

Signing proves who released an artifact; you often want more: how and where it was built. That is provenance, a signed statement describing the build, recording the source repository and commit, the builder, the build steps and the inputs. With it, you verify that an artifact was built from your code, in your pipeline, without tampering, rather than built on a laptop and uploaded. The standard format is in-toto attestations, and they travel alongside the artifact like the SBOM.

Build provenance
  • provenance = a signed statement about HOW the artifact was built
  • records: source repo and commit, builder, build steps, inputs
  • lets you verify: built from our code, in our pipeline, not tampered
  • standard format: in-toto attestations

SLSA

SLSA, supply-chain levels for software artifacts, puts numbers on how trustworthy a build is. It is a ladder. At level one, provenance exists. At level two, the provenance is signed and the build runs on a hosted service, not a laptop. At level three, builds are hardened and isolated so the provenance cannot be forged even by someone tampering with the build. You use SLSA to set a target, say level three for critical services, and to measure where you stand today. It is a shared vocabulary for build integrity.

SLSA, in levels
  • Supply-chain Levels for Software Artifacts
  • a ladder of build-integrity guarantees
  • L1: provenance exists
  • L2: signed provenance, hosted build
  • L3: hardened, isolated builds; provenance cannot be forged
  • use it to set a target and measure your pipeline

The whole chain

Put together, the pieces form an unbroken chain. You build in a hardened pipeline, generate the SBOM and provenance, sign the artifact, the SBOM and the provenance with keyless signing, and push everything to the registry. At deploy, an admission gate verifies the signature, the signing identity and the provenance, and runs only what passes. This chain closes the gap supply-chain attackers exploit, where a clean-looking artifact is quietly replaced between build and run.

Putting it together
  • build in a hardened pipeline
  • generate SBOM + provenance
  • sign artifact, SBOM, provenance (Cosign, keyless)
  • push all to the registry
  • at deploy: verify signature, identity and provenance
  • run only what passes
  • this closes the gap attackers exploit

Common mistakes

Mistakes. Signing artifacts but never verifying them at deploy, doing the work and skipping the benefit. Checking only that something is signed, not who signed it, so an attacker's valid signature passes. Verification that fails open on error, silently allowing the deploy. Long-lived signing keys left on build machines, the exact problem keyless signing solves. A signature but no provenance. And signing the image while leaving its SBOM and provenance unsigned, so those can be swapped.

Avoid these
  • signing but never verifying
  • checking "is it signed", not WHO signed
  • verification that fails open
  • long-lived signing keys left on build machines
  • no provenance, only a signature
  • signing the image but not the SBOM and provenance

Say it like this

In the interview: I sign artifacts, their SBOMs and build provenance with Sigstore and Cosign, keyless so there is no long-lived key to leak. I generate provenance as in-toto attestations and target a SLSA level for the service, aiming for hardened, isolated builds on critical ones. At deploy, an admission controller verifies the signature, pins the signing identity to our pipeline, and fails closed. That gives an unbroken chain of trust from source to running workload.

In the interview
  • "Sign artifacts, SBOMs and provenance with Sigstore and Cosign, keyless so there is no key to leak. Generate in-toto
  • provenance and target a SLSA
  • level. Verify at deploy with an admission controller that pins
  • the signing identity and fails
  • closed. That gives an unbroken
  • chain from source to running."

Interview questions

Q1Why should you sign software artifacts?

A signature proves an artifact's integrity, that it has not been altered, and its provenance, that it came from your pipeline. With signing in place you can refuse to run anything that is not signed by a trusted identity, preventing attackers from substituting their own artifact.

Q2What is Sigstore and keyless signing?

Sigstore is a project that makes artifact signing easy by using short-lived identities from an OIDC provider instead of long-lived private keys, and recording signatures in a public transparency log (Rekor). Removing key management is what made signing widely adopted.

Q3What is Cosign?

The Sigstore command-line tool for signing and verifying container images and other artifacts, including keyless signing and attaching attestations such as SBOMs and provenance. It integrates with registries and admission controllers.

Q4What is build provenance?

A signed statement describing how an artifact was produced: the source repository and commit, the builder, the build steps and the inputs. It lets consumers verify that an artifact was genuinely built from the claimed source in the expected pipeline, commonly as in-toto attestations.

Q5What is SLSA?

Supply-chain Levels for Software Artifacts: a framework of graduated levels describing build-integrity guarantees, from provenance existing (L1) to signed provenance and hosted builds (L2) to hardened, isolated builds whose provenance cannot be forged (L3). It is used to set and measure targets.

Q6Why is verifying signatures as important as signing?

Signing alone achieves nothing if nothing checks it. Verification at deploy, typically via an admission controller, must confirm the signature and that the signer is the expected pipeline identity, and must fail closed, so unsigned or wrongly signed artifacts are refused.

Q7Why pin the signing identity rather than just checking a signature exists?

Because any party, including an attacker, can produce a valid signature with their own key. Verification must require that the signature comes from the specific trusted identity, such as your build pipeline, not merely that the artifact is signed by someone.

Q8How do signing and provenance defend against supply-chain attacks?

They create an unbroken, verifiable chain from source to deployment. If an attacker substitutes or tampers with an artifact between build and run, it will not carry a valid signature from the trusted pipeline identity and valid provenance, so verification at deploy rejects it.