Skip to content

bugfix: special-case workflow_call in excessive-permissions - #473

Merged
woodruffw merged 5 commits into
mainfrom
ww/fix-472
Jan 19, 2025
Merged

woodruffw merged 5 commits into
mainfrom
ww/fix-472

Conversation

@woodruffw

@woodruffw woodruffw commented Jan 19, 2025 •

Copy link
Copy Markdown
Member

This tweaks the excessive-permissions audit in the following ways:

  1. When a workflow is purely a reusable workflow (i.e. has workflow_call and no other triggers), we emit pedantic findings instead of regular ones. In effect, we assume that the caller workflow sets the right permissions when calling the reusable workflow.
  2. We now check permissions: for reusable job calls, and emit a regular finding if a reusable call does not explicitly set permissions. This effectively covers (1) by checking the caller workflow.

If I'm thinking about this correctly, this combination should strike a reasonable balance between signal and noise: reusable workflow callers should always be setting permissions explicitly, and reusable workflows themselves shouldn't be flagged unless other conditions are satisfied (e.g. there are other triggers besides workflow_call).

Fixes #472.

@woodruffw woodruffw added the bugfix Fixes a known bug label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a known bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: excessive-permissions - false positive when permissions are set in reusable workflow parent caller

1 participant