Problem
Our OpenSSF Scorecard token-permissions check is currently 0/10.
Scorecard report: https://securityscorecards.dev/viewer/?uri=github.com/chainloop-dev/chainloop
The scorecard expects workflows to follow the principle of least privilege: set restrictive permissions at the workflow level and only grant broader permissions at the job level where needed.
Reference example from the scorecard project itself: https://github.com/ossf/scorecard/blob/main/.github/workflows/scorecard-analysis.yml
Warnings from scorecard
Missing top-level permissions declaration
stale.yml:1 — No top-level permissions. Add permissions: {} at the workflow level (job-level issues: write + pull-requests: write already correct).
scm_configuration_check.yaml:1 — No top-level permissions. Add permissions: read-all at the workflow level (job-level contents: read + id-token: write already correct).
Top-level write permissions that should move to job level
build_external_container_images.yaml:8 — Has packages: write at the workflow level. Move to job level, set top-level to permissions: read-all.
Job-level write permissions (may be legitimate but flagged)
github_release.yaml:23-24 — Job-level packages: write and contents: write. These are likely necessary for release workflows but are still flagged by the scorecard.
package_chart.yaml:32 — Job-level packages: write. Likely necessary for chart publishing but still flagged.
Expected outcome
All workflows follow the two-tier permission pattern:
- Workflow level:
permissions: read-all (or permissions: {} for workflows that don't need read)
- Job level: only the specific write permissions each job needs
Fixing items 1-3 should improve the score. Items 4-5 may be acceptable warnings for release workflows.
Problem
Our OpenSSF Scorecard token-permissions check is currently 0/10.
Scorecard report: https://securityscorecards.dev/viewer/?uri=github.com/chainloop-dev/chainloop
The scorecard expects workflows to follow the principle of least privilege: set restrictive permissions at the workflow level and only grant broader permissions at the job level where needed.
Reference example from the scorecard project itself: https://github.com/ossf/scorecard/blob/main/.github/workflows/scorecard-analysis.yml
Warnings from scorecard
Missing top-level
permissionsdeclarationstale.yml:1— No top-level permissions. Addpermissions: {}at the workflow level (job-levelissues: write+pull-requests: writealready correct).scm_configuration_check.yaml:1— No top-level permissions. Addpermissions: read-allat the workflow level (job-levelcontents: read+id-token: writealready correct).Top-level write permissions that should move to job level
build_external_container_images.yaml:8— Haspackages: writeat the workflow level. Move to job level, set top-level topermissions: read-all.Job-level write permissions (may be legitimate but flagged)
github_release.yaml:23-24— Job-levelpackages: writeandcontents: write. These are likely necessary for release workflows but are still flagged by the scorecard.package_chart.yaml:32— Job-levelpackages: write. Likely necessary for chart publishing but still flagged.Expected outcome
All workflows follow the two-tier permission pattern:
permissions: read-all(orpermissions: {}for workflows that don't need read)Fixing items 1-3 should improve the score. Items 4-5 may be acceptable warnings for release workflows.