Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/osv-scanner-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ concurrency:
cancel-in-progress: true

permissions:
# Upload SARIF to Security > Code Scanning. See github/codeql-action#2117.
# Scorecard Token-Permissions (alert #41): keep the workflow-level token
# read-only. SARIF upload needs security-events:write, but the osv-scan job
# below already grants it at job scope, so it is redundant (and over-broad)
# here.
actions: read
contents: read
security-events: write

jobs:
cancel-closed-pr-runs:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pr-review-fix-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ concurrency:
group: central-pr-review-fix-scheduler-${{ inputs.target_repository || vars.PR_REVIEW_FIX_TARGET_REPOSITORY || github.repository }}
cancel-in-progress: true

# Scorecard Token-Permissions (alert #8): declare a least-privilege default at
# the workflow level. The dispatch-review-fixes job declares its own elevated
# permissions block; the default token stays read-only.
permissions:
contents: read

jobs:
dispatch-review-fixes:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pr-review-merge-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ concurrency:
github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' }}

# Scorecard Token-Permissions (alert #9): declare a least-privilege default at
# the workflow level. The scan-pr-queue job that actually needs write access
# declares its own elevated permissions block; every other job (and the default
# token) stays read-only.
permissions:
contents: read

jobs:
cancel-closed-pr-runs:
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ concurrency:
group: security-scan-${{ github.event.pull_request.base.repo.full_name || github.repository }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

# Scorecard Token-Permissions (alert #42): workflow-level token stays
# read-only. Every job that uploads SARIF (osv-scan, trivy-fs, scorecard)
# already declares security-events:write at job scope, so granting it here as
# well is redundant and over-broad.
permissions:
actions: read
contents: read
security-events: write

jobs:
cancel-closed-pr-runs:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/strix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ concurrency:
# commit. Closed PR events only cancel older runs for the same PR/head group.
cancel-in-progress: ${{ github.event_name == 'pull_request_target' && github.event.action == 'closed' }}

# Scorecard Token-Permissions (alert #43): keep the workflow-level token
# read-only and grant the id-token/statuses writes only on the job that needs
# them (the strix scan job below and the publish-manual-pr-evidence-status job).
permissions:
actions: read
contents: read
id-token: write
models: read
statuses: write

jobs:
cancel-closed-pr-runs:
Expand All @@ -117,6 +118,15 @@ jobs:
# the time. Fail-closed: hitting the cap fails the run, never passes it.
timeout-minutes: 60
runs-on: ubuntu-latest
# Least-privilege token scoped to this job (Scorecard alert #43): the scan
# exchanges an OIDC token (id-token) and posts a commit status
# (statuses:write); all other scopes stay read-only.
permissions:
actions: read
contents: read
id-token: write
models: read
statuses: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
Expand Down
Loading