Skip to content

Disable zizmor self-repository rule in .github/zizmor.yml - #41637

Merged
damccorm merged 1 commit into
masterfrom
codescan/gha-zizmor-disable-self-repo
Nov 24, 2026
Merged

damccorm merged 1 commit into
masterfrom
codescan/gha-zizmor-disable-self-repo

Conversation

@derrickaw

Copy link
Copy Markdown
Collaborator

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR remediates confirmed, live Code Scanning finding(s) (CodeQL / zizmor) on master without altering intended public API or workflow semantics
  • The fix is minimal, idiomatic, and avoids suppressing alerts or masking underlying defects
  • Relevant unit tests, linters, and CI checks have been verified

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Summary

Selectively disables the Note-severity zizmor/self-repository audit rule in .github/zizmor.yml while keeping all other zizmor security audits (including Note-level artipacked and template-injection checks) active:

  • Why disable self-repository (~1,230 open Note alerts across ~300 workflows):
    • self-repository recommends replacing uses: ./.github/actions/... ($GITHUB_WORKSPACE) with uses: $/.github/actions/... (apache/beam@<workflow_sha>).
    • That distinction only affects privileged pull_request_target or workflow_run workflows that explicitly check out an untrusted fork PR's HEAD into $GITHUB_WORKSPACE before invoking ./.github/actions/....
    • Audited all pull_request_target and workflow_run workflows in .github/workflows/ (cancel.yml, gemini_code_review.yml, label_prs.yml, pr-bot-pr-updates.yml): none check out an untrusted PR ref before invoking local composite actions (gemini_code_review.yml and label_prs.yml have no checkout; pr-bot-pr-updates.yml checks out ref: master with zero local actions; cancel.yml checks out default master).
    • On standard pull_request, push, schedule, and workflow_dispatch workflows (~99%+ of Beam workflows), $GITHUB_WORKSPACE and $ resolve to the identical commit, so migrating ~300 workflow files across ~20+ PRs adds review churn without meaningful security benefit.
  • Preserves real signal: Keeps High / Medium rules (template-injection, dangerous-triggers, github-env, excessive-permissions, dependabot-cooldown) as well as actionable Note rules (artipacked, low-confidence template-injection) enabled.

Verification

  • Verified locally with zizmor --config .github/zizmor.yml --persona=pedantic that self-repository findings are suppressed while excessive-permissions and template-injection (High and Note) continue to report normally.
  • ./gradlew :beam-test-gha:preCommit

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR disables the Note-severity self-repository rule in .github/zizmor.yml to reduce alert noise from workspace-relative local composite action references (./.github/actions/...). The configuration syntax and security rationale are sound, as none of the privileged pull_request_target or workflow_run workflows check out untrusted PR refs before invoking local composite actions.

🔍 General Feedback

  • The zizmor.yml rule configuration (disable: true under rules.self-repository) is valid and well-documented with inline comments explaining the security trade-offs.
  • Note that Uses_::Self ($/.github/actions/...) does not exist in GitHub Actions syntax; zizmor's self-repository audit actually flags explicit self-repo references (apache/beam/...) vs local paths (./...), or vice-versa depending on persona, so disabling this pedantic rule is an appropriate choice for the repository.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@github-actions github-actions Bot added the size/xs XS: <10 lines changed label Nov 24, 2026
@derrickaw derrickaw added ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review and removed ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review labels Nov 24, 2026
@derrickaw
derrickaw marked this pull request as ready for review November 24, 2026 18:46
@derrickaw
derrickaw requested a review from damccorm November 24, 2026 18:47

@damccorm damccorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants