derrickaw opened a new pull request, #41671:
URL: https://github.com/apache/beam/pull/41671
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 masking underlying defects
(false positives and noisy rules are dismissed or scoped via config rather than
code churn)
- Relevant unit tests, linters, Gemini review feedback, and live
`workflow_dispatch` runs (for workflow/action changes) have been verified
**Initiative Progress (as of `2026-11-25 15:08 UTC`)**: **`16` PRs merged so
far**, with **`~21` more PRs needed to be merged** to close out all actionable
Code Scanning findings (with `#41637` disabling `Note`-level
`zizmor/self-repository` warnings).
<details>
<summary><b>Code Scanning Remediation Context (End Goal, Scope &
Impact)</b></summary>
- **End Goal**: Drive `apache/beam`'s actionable `High` and `Medium` Code
Scanning backlog (`CodeQL` + `zizmor`) down to zero.
- **Config & Dismissals over Churn**:
- ~1,220 `Note`-level `zizmor/self-repository` warnings (~89% of all open
alerts) are handled via `.github/zizmor.yml` config (#41637) rather than
churning ~300 workflow files.
- Vendored third-party assets (e.g., Bootstrap JS), test-only helpers, and
scanner heuristics on public resource IDs are dismissed or excluded via config
rather than degrading code clarity.
- **Representative Impact So Far**:
- Archive path-traversal (`ZipSlip`) fixes in Java `ZipFiles.unzipFile`
(#41497) and Go xlang `expansionx` (#41589)
- Shell / template injection (`High`) fixes in shared CI composite actions
(#41515, #41592, #41605) and `pr-bot` (#41524)
- Least-privilege `GITHUB_TOKEN` scoping across CI and release workflows
(#41499, #41516, #41522, #41526, #41626, #41631) and dead-code removal (#41585)
</details>
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
Resolves all 51 remaining permission-only GitHub Code Scanning alerts
(`actions/missing-workflow-permissions` (`CodeQL`) and
`zizmor/excessive-permissions`) across 12 workflow files in
`.github/workflows/`:
- **Read-only CI, Docker & metrics workflows (`permissions: contents: read`
at workflow level)**:
- `.github/workflows/build_runner_image.yml` (2 alerts:
[#3](https://github.com/apache/beam/security/code-scanning/3),
[#1460](https://github.com/apache/beam/security/code-scanning/1460))
- `.github/workflows/build_wheels.yml` (15 alerts:
[#5](https://github.com/apache/beam/security/code-scanning/5),
[#10](https://github.com/apache/beam/security/code-scanning/10),
[#12](https://github.com/apache/beam/security/code-scanning/12),
[#14](https://github.com/apache/beam/security/code-scanning/14),
[#16](https://github.com/apache/beam/security/code-scanning/16),
[#20](https://github.com/apache/beam/security/code-scanning/20),
[#22](https://github.com/apache/beam/security/code-scanning/22),
[#1464](https://github.com/apache/beam/security/code-scanning/1464)–[#1467](https://github.com/apache/beam/security/code-scanning/1467),
[#1469](https://github.com/apache/beam/security/code-scanning/1469),
[#1471](https://github.com/apache/beam/security/code-scanning/1471),
[#1900](https://github.com/apache/beam/security/code-scanning/1900),
[#1901](https://github.com/apache/beam/security/code-scanning/1901);
`branch_repo_nightly` already declares job-level `contents: write`)
- `.github/workflows/playground_frontend_test.yml` (2 alerts:
[#27](https://github.com/apache/beam/security/code-scanning/27),
[#1583](https://github.com/apache/beam/security/code-scanning/1583))
- `.github/workflows/refresh_looker_metrics.yml` (2 alerts:
[#97](https://github.com/apache/beam/security/code-scanning/97),
[#1799](https://github.com/apache/beam/security/code-scanning/1799))
- `.github/workflows/reportGenerator.yml` (2 alerts:
[#96](https://github.com/apache/beam/security/code-scanning/96),
[#1800](https://github.com/apache/beam/security/code-scanning/1800))
- `.github/workflows/republish_released_docker_containers.yml` (5 alerts:
[#3531](https://github.com/apache/beam/security/code-scanning/3531)–[#3533](https://github.com/apache/beam/security/code-scanning/3533),
[#3535](https://github.com/apache/beam/security/code-scanning/3535),
[#3536](https://github.com/apache/beam/security/code-scanning/3536))
- `.github/workflows/tour_of_beam_backend.yml` (2 alerts:
[#36](https://github.com/apache/beam/security/code-scanning/36),
[#1739](https://github.com/apache/beam/security/code-scanning/1739))
- `.github/workflows/tour_of_beam_backend_integration.yml` (2 alerts:
[#39](https://github.com/apache/beam/security/code-scanning/39),
[#1745](https://github.com/apache/beam/security/code-scanning/1745))
- `.github/workflows/tour_of_beam_frontend_test.yml` (2 alerts:
[#37](https://github.com/apache/beam/security/code-scanning/37),
[#1748](https://github.com/apache/beam/security/code-scanning/1748))
- **Release workflows with job-scoped elevated permissions**:
- `.github/workflows/build_release_candidate.yml` (15 alerts:
[#4](https://github.com/apache/beam/security/code-scanning/4),
[#6](https://github.com/apache/beam/security/code-scanning/6),
[#8](https://github.com/apache/beam/security/code-scanning/8),
[#9](https://github.com/apache/beam/security/code-scanning/9),
[#11](https://github.com/apache/beam/security/code-scanning/11),
[#18](https://github.com/apache/beam/security/code-scanning/18),
[#21](https://github.com/apache/beam/security/code-scanning/21),
[#1387](https://github.com/apache/beam/security/code-scanning/1387),
[#1394](https://github.com/apache/beam/security/code-scanning/1394),
[#1788](https://github.com/apache/beam/security/code-scanning/1788)–[#1792](https://github.com/apache/beam/security/code-scanning/1792),
[#3514](https://github.com/apache/beam/security/code-scanning/3514)): sets
top-level `permissions: contents: read` and grants `actions: read` specifically
to `stage_python_artifacts` (required by `download_g
ithub_actions_artifacts.py` to download wheel/sdist workflow artifacts via the
GitHub Actions REST API; PR/release-upload jobs use `inputs.REPO_TOKEN`).
- `.github/workflows/git_tag_released_version.yml` (1 alert:
[#1550](https://github.com/apache/beam/security/code-scanning/1550)): sets
top-level `permissions: {}` and scopes `contents: write` to `generate_tags`.
- `.github/workflows/publish_github_release_notes.yml` (1 alert:
[#1600](https://github.com/apache/beam/security/code-scanning/1600)): replaces
`permissions: read-all` with top-level `permissions: contents: read` and scopes
`contents: write` to `publish_github_release_notes` (which calls `POST
/repos/apache/beam/releases` with `GITHUB_TOKEN`).
## Verification
- `zizmor --config .github/zizmor.yml` across all 12 modified workflows (`0`
findings)
- `./gradlew :beam-test-gha:preCommit` (`BUILD SUCCESSFUL`)
- Self-triggered `Tour of Beam Go integration tests` workflow on this PR +
live `workflow_dispatch` runs on `tour_of_beam_backend.yml` and
`build_runner_image.yml` (non-push dry build on PR branch);
release/email/GCS-mutating workflows are intentionally not dispatched to avoid
mutating release artifacts or emailing `[email protected]`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]