Repository navigation
fix(ci): verify all three scanner alert permissions - #1176
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
…es (#1178) A successful scanner check in Hypatia does not validate the separate Actions secret stored in gitbot-fleet. Make the existing no-checkout read check callable by a consumer with an explicitly passed HYPATIA_SCAN_PAT, using the same fixed Hypatia API targets and suppressed response bodies. Reusable calls default to scanner_only=true and skip the separate dispatch job. Manual runs preserve the existing two-role default and offer a scanner-only checkbox. The dispatch secret is optional for reusable calls and required by the check only when that role is explicitly selected. Document that this validates the caller's stored value against Hypatia endpoints, not estate-wide access. Validation: actionlint and canonical lock synchronization passed. The probe shell and pinned action are unchanged from #1176, whose seven failure controls and live three-endpoint read have passed. Hosted qualification will include a scanner-only manual run and the fleet caller; no reusable execution is claimed yet. This adds no credential grants and changes no saved secret.
… one GraphQL query (#1196) ## Summary `hypatia-remediation-sweep` has dispatched nothing for weeks. First its token returned 401. Since #1176 moved the query to `HYPATIA_SCAN_PAT`, the query itself fails: one GraphQL request asked for 100 repositories × 100 open alerts each per page, and GitHub answered with **HTTP 502**. It did so twice in a row, in run 43988746284 and its re-run. The query step now lists the owner's repositories and then reads each one's open Dependabot alerts from the REST endpoint (`repos/{owner}/{repo}/dependabot/alerts?state=open`). - **Downstream unchanged.** Each repository line keeps the shape the GraphQL query produced, so the floor filter, `targets.jsonl`, the summary table and the dispatch step stay as they were. REST names severities `low/medium/high/critical`, so `medium` becomes `MODERATE`. - **No silent "clean" result.** A repository whose alerts can't be read is listed as unreadable, with a warning and a list in the step summary. The step fails if no repository could be read. - Credentials, harden-runner (`egress-policy: block`, `api.github.com:443` plus the artifact service) and `uses:` are untouched, so `actions.lock` and the deed's egress entry don't change. ## How has this been verified? - **Live dry run of this branch, run 43994805488:** green under harden-runner `block`. It logged `Read Dependabot alerts for 361 repositories; 0 could not be read.` The artifact upload succeeded, which also covers the egress allow-list end to end. The dispatch step is skipped in dry-run mode and calls the same host. - **Offline equivalence test:** the jq programs were extracted from this workflow file. The same three alerts, written as REST JSON and as GraphQL JSON, produce byte-identical targets at all four severity floors, and a repository with no alerts drops out as before. - **Negative control:** removing the `MEDIUM → MODERATE` mapping makes the outputs differ. - **actionlint 1.7.7 with shellcheck:** only the three SC2129 style notes main already has. - **Cost:** about one call per repository plus the repo listing, roughly 470 REST calls per run, well inside the 5,000/hour PAT limit. ## Notes - `ci-health-sweep` and this workflow's dispatch step still use `HYPATIA_DISPATCH_PAT`, which still returns 401 (run 43988750312, today). Rotating it is an owner action and outside this PR. --- _Generated by [Claude Code](https://claude.ai/code/session_01J4QvDfStHgMdZGTeqaBgM1)_ Co-authored-by: Claude <[email protected]>



The credential read check could pass after a scanner-token replacement while Code scanning alerts or Secret scanning alerts were still inaccessible: it tested only Dependabot. Check all three Hypatia alert endpoints independently, report each result, and fail if any read is refused or unavailable. Keep authentication first, API bodies suppressed, and request
hide_secret=truefor secret-scanning responses. Document the full read-only permission set, resource-owner boundary and separate fleet secret store.Validation: actionlint, ShellCheck, Bash syntax, seven offline controls (success, missing token, authentication failure, each alert permission refusal, unavailable endpoint), canonical lock synchronization and the five-caller standards integration contract passed. Action refs are unchanged, so no lock regeneration is needed. The offline controls do not validate a live credential; the manual workflow will supply that separate evidence. No token value is included or changed by this PR.