Software Supply Chain Security: SBOM, Cosign & SLSA Framework
Master software supply chain security: Software Bill of Materials (SBOM), cryptographic container signing with Sigstore Cosign, and SLSA Level 3 build provenance.
Software Supply Chain Security: SBOM, Cosign & SLSA Framework
Section titled “Software Supply Chain Security: SBOM, Cosign & SLSA Framework”Modern software systems are rarely written completely from scratch; between 80% to 90% of a production container image consists of third-party open-source libraries, runtimes, and base OS packages.
Software Supply Chain Security ensures that every stage of the software lifecycle—from the open-source dependency you import to the build runner that compiles your binary—is verified, untampered, and cryptographically proven.
1. Supply Chain Security Architecture: End-to-End Attestation Flow
Section titled “1. Supply Chain Security Architecture: End-to-End Attestation Flow”Securing the supply chain requires moving beyond basic vulnerability scans to cryptographic provenance and policy enforcement.
2. Generating Software Bill of Materials (SBOM)
Section titled “2. Generating Software Bill of Materials (SBOM)”An SBOM (Software Bill of Materials) is a machine-readable inventory listing every software component, library, compiler version, and direct/transitive dependency packaged inside your application.
Industry Standards: SPDX vs CycloneDX
Section titled “Industry Standards: SPDX vs CycloneDX”- SPDX (Software Package Data Exchange): ISO/IEC 5962:2021 standard, heavily favored for open-source licensing compliance and intellectual property audits.
- CycloneDX: OWASP-incubated standard designed explicitly for application security, vulnerability identification, and software component analysis.
Generating CycloneDX SBOM with Syft in CI:
Section titled “Generating CycloneDX SBOM with Syft in CI:”# Scan a built production Docker image and output CycloneDX JSONsyft packages production-app:v1.2.0 -o cyclonedx-json=sbom.json
# Scan with Trivy for immediate vulnerability matching against the generated SBOMtrivy sbom sbom.json --severity HIGH,CRITICAL --exit-code 13. Cryptographic Container Signing with Sigstore Cosign
Section titled “3. Cryptographic Container Signing with Sigstore Cosign”Traditional container image verification relied on long-lived private PGP keys that engineers had to securely rotate and store.
Sigstore Cosign introduces Keyless Signing, linking image signatures to the builder’s identity (such as a GitHub Actions workflow) using OpenID Connect (OIDC).
Keyless Signing Architecture:
Section titled “Keyless Signing Architecture:”- OIDC Token Vending: GitHub Actions mints a short-lived OIDC identity token proving the workflow repository, branch, and commit SHA.
- Fulcio Ephemeral CA: Fulcio verifies the OIDC token and generates a temporary, 10-minute X.509 certificate bound to the workflow’s identity.
- Rekor Transparency Log: The cryptographic signature and certificate are appended to Rekor, an immutable, append-only transparency ledger.
- OCI Registry Storage: The signature is stored in the container registry (e.g. Amazon ECR) directly alongside the image tags.
Production GitHub Actions Cosign Signing Step:
Section titled “Production GitHub Actions Cosign Signing Step:”- name: Sign container image with Sigstore Cosign env: TAGS: ${{ steps.meta.outputs.tags }} COSIGN_EXPERIMENTAL: "true" run: | # Sign using ambient GitHub Actions OIDC token (Keyless) cosign sign --yes "${{ env.TAGS }}"4. SLSA (Supply-chain Levels for Software Artifacts) Framework
Section titled “4. SLSA (Supply-chain Levels for Software Artifacts) Framework”SLSA is an OpenSSF-backed security framework designed to prevent software tampering during build and packaging:
| SLSA Level | Focus Area | Core Production Requirement |
|---|---|---|
| SLSA 1 | Build Process Documentation | Automated build process with machine-readable build provenance. |
| SLSA 2 | Tamper Resistance | Hosted build platform (e.g. GitHub Actions) with authenticated provenance. |
| SLSA 3 | Ephemeral & Isolated | Hermetic builds: isolated build environments preventing cross-build contamination and code injection. |
| SLSA 4 | Two-Party Review & Reproducibility | Multi-party code review for every commit and bit-for-bit reproducible builds. |
5. Kubernetes Admission Enforcement with Kyverno
Section titled “5. Kubernetes Admission Enforcement with Kyverno”Signing images in CI is meaningless unless your production cluster rejects unsigned images. Below is an enterprise Kyverno ClusterPolicy that intercepts Pod creation and verifies the Cosign signature before scheduling:
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata: name: check-image-signaturesspec: validationFailureAction: Enforce rules: - name: verify-sigstore-signature match: any: - resources: kinds: - Pod verifyImages: - imageReferences: - "123456789012.dkr.ecr.ap-south-1.amazonaws.com/production/*" attestors: - entries: - keyless: issuer: "https://token.actions.githubusercontent.com" subject: "https://github.com/my-org/my-repo/.github/workflows/deploy.yml@refs/heads/main"6. Real-Time Production Knowledge Checks
Section titled “6. Real-Time Production Knowledge Checks”Q1: When a critical zero-day vulnerability (like Log4j) is disclosed, how does an SBOM accelerate incident response?
Without an SBOM, teams must re-clone, re-compile, or reverse-engineer hundreds of microservice images to check if a specific nested JAR or package was included—a process taking days or weeks. With centralized SBOMs stored in an inventory database, security engineers run a single SQL/API query (SELECT image FROM sboms WHERE package = 'log4j-core') to locate every impacted container running across the fleet in seconds.
Q2: Why should container images be referenced by immutable digests (`sha256:...`) rather than mutable semantic tags (`:v1.2.0`) in production Kubernetes manifests?
Tags in container registries are mutable; an attacker with compromised registry credentials can overwrite :v1.2.0 with a malicious payload without changing the tag name. By pinning manifests to cryptographic content digests (image@sha256:4f3c...), Kubernetes cryptographically guarantees that it runs the exact image bits that were built, scanned, and signed in CI.