derrickaw opened a new pull request, #41842:
URL: https://github.com/apache/beam/pull/41842

   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-12-01 13:28 UTC`)**: **`21` PRs merged so 
far**, with **`~7` 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
   
   Removes the unused `infra/keys/` service account key IaC management tool, 
its scheduled GitHub Actions workflow, and the coupled account-keys enforcement 
step in `infra/enforcement/`, following review feedback on #41590 
(`https://github.com/apache/beam/pull/41590#discussion_r4671708013`).
   
   Removing this dead code supersedes #41590 and resolves the 7 open CodeQL 
`py/clear-text-logging-sensitive-data` alerts (#1841, #1842, #1843, #1844, 
#1845, #1846, #1847) in `infra/keys/`.
   
   ### Why this is dead code
   
   - `infra/keys/keys.yaml` was emptied (`service_accounts: []`) in #35848 / 
#35911 (Aug 2025) when IaC management of service account keys was revoked.
   - `.github/workflows/beam_Infrastructure_ServiceAccountKeys.yml` has only 
been running with `--cron-dry-run` (discovering `0` managed secrets in 
`apache-beam-testing`, e.g. [run 
46388500438](https://github.com/apache/beam/actions/runs/46388500438)), and its 
`push` trigger pointed to the nonexistent `main` branch.
   - `infra/enforcement/account_keys.py` validates against `../keys/keys.yaml`; 
with an empty list, weekly runs of `beam_Infrastructure_PolicyEnforcer.yml` 
flagged all existing service accounts and keys as drift (generating noise on 
#39931 and #40809, which can be closed once this lands).
   
   ### Changes
   
   **Removed**
   - `infra/keys/` (`README.md`, `config.yaml`, `keys.py`, `keys.yaml`, 
`requirements.txt`, `secret_manager.py`, `service_account.py`, 
`test_secret_manager.py`, `test_service_account.py`)
   - `.github/workflows/beam_Infrastructure_ServiceAccountKeys.yml`
   - `infra/enforcement/account_keys.py`
   
   **Updated**
   - `.github/workflows/beam_Infrastructure_PolicyEnforcer.yml`: Removed the 
`Run Account Keys Policy Enforcement` step while keeping `Run IAM Policy 
Enforcement` (`iam.py`) intact.
   - `.github/workflows/README.md`: Removed the deleted workflow badge entry.
   - `infra/enforcement/config.yml`: Removed unused `service_account_keys_file: 
../keys/keys.yaml`.
   - `infra/enforcement/requirements.txt`: Removed packages only used by 
`account_keys.py` (`google-cloud-iam`, `google-cloud-secret-manager`, 
`google-crc32c`), retaining `PyYAML`, `google-cloud-resource-manager`, and 
`requests` for `iam.py` / `sending.py`.
   - `infra/enforcement/sending.py` & `infra/enforcement/test_sending.py`: 
Removed `account_keys.py`-only `report_unmanaged_keys()` / 
`resolve_unmanaged_keys()` helpers and updated the test fixture issue title to 
match `iam.py`.
   - `infra/enforcement/README.md`: Removed the Account Keys section and 
updated the workflow description.
   
   **Preserved (still active)**
   - `infra/iam/` (`beam_Infrastructure_UsersPermissions.yml`), 
`infra/enforcement/iam.py`, and `infra/security/` 
(`beam_Infrastructure_SecurityLogging.yml`) are untouched and continue running 
as before.
   
   ### Verification
   
   - `python3 -m py_compile infra/enforcement/iam.py 
infra/enforcement/sending.py infra/enforcement/test_sending.py`
   - `PYTHONPATH=infra/enforcement python3 -m unittest -v 
infra/enforcement/test_sending.py` (2/2 tests passed)
   - `zizmor --config .github/zizmor.yml --min-severity=high 
.github/workflows/beam_Infrastructure_PolicyEnforcer.yml` (0 findings)
   - `./gradlew :beam-test-gha:preCommit` (`BUILD SUCCESSFUL`)
   - Live `workflow_dispatch` (`action=print`) run on 
`beam_Infrastructure_PolicyEnforcer.yml`: pending link after branch push.
   


-- 
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]

Reply via email to