From 86794533c5f00b25fa27d59176f1c776186a4350 Mon Sep 17 00:00:00 2001 From: SabaTech-coder Date: Wed, 10 Jun 2026 13:54:48 +0000 Subject: [PATCH 1/2] feat(ci): add SLSA L1 provenance attestation (OWASP A03) - Add provenance.yml workflow with attest-build-provenance action - Add verify-provenance.yml for PR verification - Rename artifact 'package' to 'dist' in ci-cd.yml for consistency - Add permissions to ci-cd.yml for artifact uploads - Implements SLSA L1 supply chain security requirement --- .github/workflows/ci-cd.yml | 6 +++- .github/workflows/provenance.yml | 42 +++++++++++++++++++++++++ .github/workflows/verify-provenance.yml | 32 +++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/provenance.yml create mode 100644 .github/workflows/verify-provenance.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 772c02d1..4915841f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -9,6 +9,10 @@ on: # Run tests daily at 2 AM UTC - cron: '0 2 * * *' +permissions: + contents: read + actions: read + env: PYTHON_VERSION: "3.12" POETRY_VERSION: "1.7.1" @@ -540,7 +544,7 @@ jobs: - name: Upload package uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: package + name: dist path: dist/ # ============================================================================= diff --git a/.github/workflows/provenance.yml b/.github/workflows/provenance.yml new file mode 100644 index 00000000..2a4a1070 --- /dev/null +++ b/.github/workflows/provenance.yml @@ -0,0 +1,42 @@ +# ============================================================================= +# SLSA L1 — Provenance Attestation (OWASP A03: Supply Chain) +# Generates signed provenance for build artifacts +# ============================================================================= + +name: SLSA Provenance Attestation + +on: + push: + branches: [main, develop] + +permissions: + contents: read + id-token: write # Required for OIDC signing + attestations: write + +jobs: + provenance: + name: Generate Provenance Attestation + runs-on: ubuntu-latest + needs: [ci-cd] + steps: + - name: Checkout code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist + + - name: Attest build provenance + uses: actions/attest-build-provenance@v2 + with: + subject-path: dist/* + + - name: Upload provenance artifact + uses: actions/upload-artifact@v4 + with: + name: provenance + path: .attestation/ + retention-days: 90 diff --git a/.github/workflows/verify-provenance.yml b/.github/workflows/verify-provenance.yml new file mode 100644 index 00000000..a372047b --- /dev/null +++ b/.github/workflows/verify-provenance.yml @@ -0,0 +1,32 @@ +# ============================================================================= +# SLSA L1 — Verify Provenance Attestation (OWASP A03: Supply Chain) +# Verifies that build artifacts have valid provenance +# ============================================================================= + +name: Verify Provenance + +on: + pull_request: + branches: [main, develop] + +permissions: + contents: read + attestations: read + id-token: write + +jobs: + verify: + name: Verify Source Provenance + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Verify attestation + run: | + # List attestations for this commit + gh attestation verify "${{ github.sha }}" \ + --owner ${{ github.repository_owner }} \ + --predicate-type https://slsa.dev/provenance/v1 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d4eb6adf0355d8ef9e959349b9ed51557937026f Mon Sep 17 00:00:00 2001 From: Joker Date: Wed, 10 Jun 2026 14:01:59 +0000 Subject: [PATCH 2/2] fix(ci): remove cross-workflow job dependency in provenance.yml - provenance.yml runs independently on push to main/develop - Removed 'needs: [ci-cd]' which referenced job in different workflow - Verified with actionlint --- .github/workflows/provenance.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/provenance.yml b/.github/workflows/provenance.yml index 2a4a1070..b014cc8d 100644 --- a/.github/workflows/provenance.yml +++ b/.github/workflows/provenance.yml @@ -18,7 +18,6 @@ jobs: provenance: name: Generate Provenance Attestation runs-on: ubuntu-latest - needs: [ci-cd] steps: - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683