Skip to content

Commit 409a561

Browse files
authored
fix(gh-attested): caller template grants packages:read for sast/trivy (#462)
fix(gh-attested): grant packages:read in caller template for sast/trivy The reusable-sast-codeql (analyze) and reusable-trivy (image) jobs declare `packages: read`. A reusable's permissions must be a subset of what the caller grants, so a caller omitting it fails at startup (whole-workflow startup_failure, no job checks — easy to miss). Grant packages:read for sast/trivy in the caller template and document the subset rule, so downstream consumers don't hit it. Also refresh the seam note: gate reusables now expose sarif-artifact / sarif-filename outputs that reusable-attest-scan consumes.
1 parent 77a8754 commit 409a561

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/skills/gh-attested/templates/quality-gates-caller.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
# This is the universal merge-time core (SAST + SCA + posture + IaC/license +
88
# pin-check). For the DEPLOY-TIME attestation seam (sign each gate's verdict and
99
# fail-closed verify before shipping), see references/attestation-seam.md and
10-
# references/enforcement.md — the seam consumes an evidence artifact, so the gate
11-
# job must upload its SARIF (or call the scan inline) before reusable-attest-scan.
10+
# references/enforcement.md — each gate reusable uploads its SARIF and exposes
11+
# sarif-artifact / sarif-filename outputs for reusable-attest-scan to consume.
12+
#
13+
# PERMISSIONS: a reusable's declared permissions must be a SUBSET of what the
14+
# caller grants, or the call fails at startup (whole-workflow, no job checks).
15+
# The sast and trivy reusables declare `packages: read` (CodeQL package
16+
# resolution; Trivy image pull), so their callers below must grant it too —
17+
# trivy's image job is conditional, but its declared permission is still
18+
# validated at startup regardless of `if:`.
1219

1320
name: quality-gates
1421

@@ -27,6 +34,7 @@ jobs:
2734
security-events: write
2835
contents: read
2936
actions: read
37+
packages: read # reusable's analyze job declares it (subset rule)
3038
uses: __org__/.github/.github/workflows/reusable-sast-codeql.yml@<sha>
3139
with:
3240
languages: 'javascript-typescript' # edit per repo; compiled langs need build-mode
@@ -55,6 +63,7 @@ jobs:
5563
contents: read
5664
security-events: write
5765
actions: read
66+
packages: read # reusable's image job declares it (subset rule)
5867
uses: __org__/.github/.github/workflows/reusable-trivy.yml@<sha>
5968
with:
6069
scan-iac: true

0 commit comments

Comments
 (0)