Repository navigation
Description
Describe the bug
A pull_request_target job that checks out the pull request head and is gated to trusted authors is judged two different ways by two controls:
- ISSUE-802 (dangerous triggers,
policies/dangerous_triggers.rego) treats a trustedauthor_associationallowlist as a guard:author_association == 'OWNER'|'MEMBER'|'COLLABORATOR', orcontains(fromJSON('[...]'), ... author_association). The job passes. - ISSUE-804 (
policies/pull_request_target_head_checkout.rego) only recognizes same-repository and non-fork guards (fork_guard_patterns). The same job is reported as an unguarded CRITICAL.
The same if: is a guard for one control and nothing for the other. With the Critical malus the repository is capped at 30 points for as long as the job exists. This is filed as an inconsistency between the two rules, not as a claim that 804 is wrong: either reading is defensible, the two disagreeing on one job is not.
To Reproduce
name: trusted-pr-tests
on:
pull_request_target:
jobs:
test:
runs-on: ubuntu-latest
if: ${{ contains(fromJSON('["COLLABORATOR", "OWNER"]'), github.event.pull_request.author_association) }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- run: npm test
env:
PRIVATE_REGISTRY_TOKEN: ${{ secrets.PRIVATE_REGISTRY_TOKEN }}plumber analyze reports no ISSUE-802 on the job and a CRITICAL ISSUE-804 on the same job.
Expected behavior
ISSUE-804 accepts the same trusted author_association allowlist as ISSUE-802. The property 802 relies on (the code that runs was authored by a trusted collaborator) is the same property that makes the head checkout acceptable.
Screenshots
Not applicable.
Relevant versions and configuration files
- OS: Windows 11 (binary
plumber-windows-amd64) - Platform: GitHub (github.com)
- Plumber version: first seen on 0.5.1, re-checked against the rule sources at 0.5.20 (
fork_guard_patternsstill carries only the same-repository and non-fork shapes) .plumber.yaml: none, built-in default configuration
Relevant logs
Not applicable, the two findings above are the whole output for this job.
Additional context
Projects that need privileged data to test pull requests from trusted collaborators working in forks (a private dependency, a paid test service) use pull_request_target plus a head checkout by design, gated to trusted authors. Today the only way to record that decision is pullRequestTargetMustNotCheckoutHead.enabled: false, which also stops 804 from protecting any workflow added later.
Note: If you submit a PR for this bug, please keep "Allow edits from maintainers" enabled so we can collaborate on the fix more easily.
Activity