Skip to content

chore: add top-level permissions: {} to all workflow files#521

Open
Onyx2406 wants to merge 1 commit intoaquasecurity:masterfrom
Onyx2406:fix/add-explicit-workflow-permissions
Open

chore: add top-level permissions: {} to all workflow files#521
Onyx2406 wants to merge 1 commit intoaquasecurity:masterfrom
Onyx2406:fix/add-explicit-workflow-permissions

Conversation

@Onyx2406
Copy link
Copy Markdown

@Onyx2406 Onyx2406 commented Mar 7, 2026

Summary

  • Add explicit top-level permissions: {} to all 5 GitHub Actions workflow files
  • Restricts the default GITHUB_TOKEN permissions to none, enforcing least-privilege

Motivation

Closes #499 — While each job already defines minimum required permissions (e.g. contents: read, packages: write), there is no top-level restriction. Without permissions: {} at the workflow level, any newly added job that omits a permissions block would inherit GitHub's default (read-write) token permissions, increasing the blast radius if a workflow is compromised.

Changes

Workflow Change
test.yaml Added permissions: {}
bump-trivy.yaml Added permissions: {}
sync-trivy-checks.yaml Added permissions: {}
sync-trivy-db.yaml Added permissions: {}
sync-trivy-java-db.yaml Added permissions: {}

References

Add explicit top-level `permissions: {}` to all GitHub Actions workflow
files to restrict the default GITHUB_TOKEN permissions. Each job already
defines its own minimum required permissions, but without a top-level
restriction, any newly added job would inherit GitHub's default
(read-write) token permissions.

This follows the principle of least privilege as recommended by GitHub
and OpenSSF Scorecard.

Closes aquasecurity#499
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 7, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider defining explicit GitHub Actions permissions for workflows

2 participants