Skip to content
s1ns3nz0 | Known Unknowns
Go back

Securing Workflows in CI Pipelines - Integrity of Evidence Generation During Software Updates

6 min read

Table of contents

Open Table of contents

Overview

Main Idea: Even if the process of creating and signing evidence is itself under attack, design the system so that an attacker cannot erase the update history or make a forged updated appear legitimate

TUF(The Update Framework)

Overview

Roles and Metadata

Role-Key Mapping

Root role
├─ offline key A
├─ offline key B
└─ offline key C
   threshold: 2 of 3

Targets role
├─ release approver key A
├─ release approver key B
└─ release approver key C
   threshold: 2 of 3

Snapshot role
└─ controlled automation key

Timestamp role
└─ short-lived online automation key

Required Workflow

Build workflow

Generate the artifact, SBOM, and provenance

Policy workflow

OPA evaluates test results, vulnerability findings, environment evidence, and approval evidence

Approval through a protected signing environment

Signing using an HSM/KMS or GitHub OIDC-based identity

Generate TUF targets metadata

Threshold approval

Publish snapshot and timestamp metadata

Store evidence in immutable storage

Workflow Principles

What to be signed

Preventing Evidence Deletion and Tampering

Ensure to store attestation securly

Github Attestations

Sigstore Bundle

Download Attestation Bundle

Files saved in Immutable Storage

evidence/
└── example-payment-service/
    └── sha256-<artifact-digest>/
        ├── artifact/
        │   └── application.tar.gz
        ├── digests/
        │   ├── artifact.sha256
        │   ├── sbom.sha256
        │   └── environment-predicate.sha256
        ├── attestations/
        │   ├── provenance.sigstore.json
        │   ├── environment.sigstore.json
        │   └── sbom.sigstore.json
        ├── metadata/
        │   ├── build-manifest.json
        │   ├── environment-predicate.json
        │   └── release-manifest.json
        ├── policy/
        │   ├── build-policy-result.json
        │   └── promotion-policy-result.json
        ├── approvals/
        │   └── release-approval.json
        └── verification/
            ├── provenance-verification.json
            ├── environment-verification.json
            └── verification-record.json
Generate the artifact

Calculate the artifact’s SHA-256 digest

Generate provenance, SBOM, and environment attestations

Store the attestations in the GitHub Attestations API

Download the attestation bundles

Create an evidence package for each artifact digest

Upload the evidence package to WORM/Object Lock storage

Recalculate and verify the digest of the uploaded object

Record the storage receipt

During promotion, verify the artifact, attestations, and storage evidence

Share this post:

Previous Post
Securing Workflows in CI Pipelines - Secure Code Commits
Next Post
Securing Workflows in CI Pipelines - Secure Pull-Push Operations on Repositories