Skip to content

Harden API consistency reviews and scan GitHub Actions - #1310

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
chore/harden-api-consistency-review
Oct 20, 2026
Merged

Quim Muntal (qmuntal) merged 1 commit into
mainfrom
chore/harden-api-consistency-review

Conversation

@qmuntal

Copy link
Copy Markdown
Member

Purpose

Follow up to #1309 by further narrowing the permissions and execution surface of automation reached through pull_request_target. The fork dispatcher remains a small trusted entry point, while the downstream API-consistency reviewer obtains evidence through GitHub APIs instead of checking out PR code or running native shell commands.

Changes

  • Remove the fork dispatcher's unused contents: read permission; retain actions: write for dispatching the fixed review workflow.
  • Disable agent checkout, bash, the shell-based CLI proxy, editing, and persistent cache memory. Explicitly deny Copilot's native shell and write tools, including automatically approved read-only shell commands.
  • Remove the Go network ecosystem and require API evidence at the PR head SHA and specific upstream commits. Treat PR content as untrusted review data.
  • Preserve existing trust guards, honest dispatch context, review criteria, and bounded comment/label safe outputs. GitHub token selection is intentionally unchanged; the proposed explicit GITHUB_TOKEN overrides are not included.
  • Add a CodeQL Actions/none matrix leg alongside the existing Go/manual analysis. Go setup/build steps remain Go-only, and one matrix failure does not cancel the other leg.

Included gh-aw maintenance updates

  • Pin the existing v0.92.0 setup/bootstrap actions to immutable SHAs and refresh matching action metadata and skill references.
  • The regenerated weekly auto-upgrade schedule moves from Friday 03:21 UTC to Tuesday 10:19 UTC.

Trade-offs

  • Reviews cannot run local builds, tests, or shell-based investigations. API limitations must be reported rather than treated as evidence of parity.
  • No persistent cross-run review memory; repeated evidence gathering may require more API calls.
  • The additional Actions CodeQL leg adds CI work while retaining Go analysis.
  • This narrows the privileged fork-review path; it does not remove pull_request_target or weaken checkout trust checks to bypass the previous checkout failure.

Validation

  • gh aw compile go-api-consistency-review --strict --validate --no-check-update: passed with zero warnings.
  • gh aw list --json: all five authored/generated workflow pairs are synchronized.
  • actionlint v1.7.12: passed for CodeQL, the fork dispatcher, Copilot setup, and auto-upgrade workflow YAML.
  • Focused static contracts checked CodeQL matrix/build isolation and preservation of triggers, permissions, action pins, and analysis categories.
  • Confirmed the token rollback restored the exact previously reviewed source/lock content and the retained CodeQL content matches its validated hash.
  • No hosted workflow was manually dispatched.

Make API reviews API-only with explicit native tool denials and a least-privilege fork dispatcher. Add Actions CodeQL analysis alongside Go and retain the staged gh-aw maintenance updates.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner October 20, 2026 14:30
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:30
@github-actions github-actions Bot added the area:github Changes files in the github area label Oct 20, 2026
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copilot AI 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.

🔵 Needs a closer look

The privileged review path needs human validation of runtime tool restrictions and end-to-end safe-output behavior.

No open issues 🎉

What changed in this PR

Continues #1309’s automation hardening by making API-consistency reviews API-only and adding GitHub Actions security scanning.

Changes:

  • Restrict reviewer tools, checkout, network access, and persistent memory; reduce dispatcher permissions.
  • Add Actions CodeQL analysis alongside independent Go analysis.
  • Pin gh-aw setup actions and refresh generated metadata, skill references, and the upgrade schedule.
File Description
.github/​workflows/​symbolmap-maintenance-weekly.lock.yml Normalize action version metadata and comments.
.github/​workflows/​go-api-consistency-review.md Define API-only review restrictions and evidence requirements.
.github/​workflows/​go-api-consistency-review.lock.yml Regenerate restricted reviewer execution.
.github/​workflows/​go-api-consistency-review-forks.yml Remove unused contents permission.
.github/​workflows/​dotnet-port-fixes-nightly.lock.yml Normalize action version metadata and comments.
.github/​workflows/​dotnet-port-api-nightly.lock.yml Normalize action version metadata and comments.
.github/​workflows/​dotnet-code-portability-weekly.lock.yml Normalize action version metadata and comments.
.github/​workflows/​copilot-setup-steps.yml Pin setup action to an immutable SHA.
.github/​workflows/​codeql.yml Add Actions analysis with isolated Go build steps.
.github/​workflows/​agentic-auto-upgrade.yml Pin setup actions and change weekly schedule.
.github/​skills/​agentic-workflows/​SKILL.md Add workflow guidance references.
.github/​aw/​actions-lock.json Refresh action pins and version metadata.

Review effort: Balanced

@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 1b11938 Oct 20, 2026
19 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the chore/harden-api-consistency-review branch October 20, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:github Changes files in the github area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants