Skip to content

fix(ci): verify all three scanner alert permissions - #1176

Merged
hyperpolymath merged 2 commits into
mainfrom
codex/scanner-alert-check-20261116
Nov 16, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
codex/scanner-alert-check-20261116

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

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=true for 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.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 439ef670-9e75-4bef-8cf9-b21c9644c5ad
Commits

Reviewing files that changed from the base of the PR and between a6b0706 and 115ad9e.

Files selected for processing: 1

  • .github/workflows/credential-read-check.yml

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores

    • Credential checks now verify authentication and read access to Dependabot, code-scanning and secret-scanning alerts. Results are reported separately, and the check fails if any endpoint is unavailable or returns an error.
    • The check does not indicate estate-wide coverage, confirm that no alerts exist, or verify write access.
  • Documentation

    • Updated guidance clarifies the scanning credential’s read-only scope and distinguishes it from dispatch validation, which checks identity and observation-store visibility—not dispatch or write access.

The credential check now verifies scanner identity and reads Dependabot, code-scanning and secret-scanning alerts. It reports each endpoint result and fails if any read fails. The operations guide and workflow reason describe the expanded checks, credential scope and coverage limits.

Changes: Credential alert checks

Layer / File(s) Summary
Read and report alert endpoints
.github/workflows/credential-read-check.yml
The scanner job checks Dependabot, code-scanning and secret-scanning alert endpoints. It records each result, continues after endpoint failures and fails if any read fails. The secret-scanning request sets hide_secret=true.
Document credential scope and check limits
docs/operations/credential-roles.adoc, hypatia_chora.deed
The operations guide describes the scanner token’s read permissions, endpoint checks, dispatch validation and coverage limits. The workflow reason now names all three alert endpoints.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ScannerStep as Scanner workflow step
  participant GitHubAlertAPI as GitHub alert API
  participant ActionsSummary as GitHub Actions step summary
  ScannerStep->>GitHubAlertAPI: Read Dependabot alerts
  GitHubAlertAPI-->>ScannerStep: Return read result
  ScannerStep->>GitHubAlertAPI: Read code-scanning alerts
  GitHubAlertAPI-->>ScannerStep: Return read result
  ScannerStep->>GitHubAlertAPI: Read secret-scanning alerts with hide_secret=true
  GitHubAlertAPI-->>ScannerStep: Return read result
  ScannerStep->>ActionsSummary: Record each endpoint result
  ScannerStep->>ScannerStep: Fail if any read failed
Loading
Merge Risk: Minimal · previous review a6b07

The change extends the manual credential check to cover three scanner alert endpoints and updates the related documentation. It does not affect production behavior. The CI failures reflect the credentials' current permissions, not the code change. Merge-readiness risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the credential read check now verifies the Dependabot, code-scanning and secret-scanning alert permissions. It fits the changeset and is specific enough for a teammate…
Description check Passed The description states the problem (the check only tested Dependabot), the fix (three independent alert endpoint checks with per-result reporting and failure on refusal), the documentation update, and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the credential read check now verifies the Dependabot, code-scanning and secret-scanning alert permissions. It fits the changeset and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description states the problem (the check only tested Dependabot), the fix (three independent alert endpoint checks with per-result reporting and failure on refusal), the documentation update, and the validation performed. It matches the workflow and documentation changes in the summary.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0b8e953c-ba27-4b99-af4f-799e90382ad0
Commits

Reviewing files that changed from the base of the PR and between cf1e275 and a6b0706.

Files selected for processing: 3

  • .github/workflows/credential-read-check.yml
  • docs/operations/credential-roles.adoc
  • hypatia_chora.deed

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 8

  • GitHub Check: Integration Tests
  • GitHub Check: CodeRabbit
  • GitHub Check: Rust Check & Clippy
  • GitHub Check: Container Security (Trivy) (deploy/Containerfile)
  • GitHub Check: Rust Dependency Audit
  • GitHub Check: Build AsciiDoc
  • GitHub Check: stress-test
  • GitHub Check: Build AsciiDoc
CI failures not shown inline: 4

GitHub Actions: Credential read check / 0_Dispatch authentication and store read.txt: Credential read check

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m[ -n "${GH_***REDACTED_SECRET_ASSIGNMENT*** ] || { echo '::error::HYPATIA_DISPATCH_PAT is missing'; exit 1; }�[0m
...
 shell: /usr/bin/bash -e {0}
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 gh: Bad credentials (HTTP 401)
 ##[error]Process completed with exit code 1.

GitHub Actions: Credential read check / Dispatch authentication and store read: Credential read check

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m[ -n "${GH_***REDACTED_SECRET_ASSIGNMENT*** ] || { echo '::error::HYPATIA_DISPATCH_PAT is missing'; exit 1; }�[0m
...
 shell: /usr/bin/bash -e {0}
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 gh: Bad credentials (HTTP 401)
 ##[error]Process completed with exit code 1.

GitHub Actions: Credential read check / 1_Scanner authentication and three alert reads.txt: Credential read check

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m[ -n "${GH_***REDACTED_SECRET_ASSIGNMENT*** ] || { echo '::error::HYPATIA_SCAN_PAT is missing'; exit 1; }�[0m
...
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 gh: Resource not accessible by personal access token (HTTP 403)
 gh: Resource not accessible by personal access token (HTTP 403)
 ##[error]Process completed with exit code 1.

GitHub Actions: Credential read check / Scanner authentication and three alert reads: Credential read check

Conclusion: failure

View job details

##[group]Run set -euo pipefail
 �[36;1mset -euo pipefail�[0m
 �[36;1m[ -n "${GH_***REDACTED_SECRET_ASSIGNMENT*** ] || { echo '::error::HYPATIA_SCAN_PAT is missing'; exit 1; }�[0m
...
 env:
   GH_***REDACTED_SECRET_ASSIGNMENT***
 ##[endgroup]
 gh: Resource not accessible by personal access token (HTTP 403)
 gh: Resource not accessible by personal access token (HTTP 403)
 ##[error]Process completed with exit code 1.
Additional comments: 3

.github/workflows/credential-read-check.yml: 1

17-17: LGTM!

Also applies to: 26-47

docs/operations/credential-roles.adoc: 1

3-3: LGTM!

Also applies to: 5-8, 13-13, 19-24, 26-30

hypatia_chora.deed: 1

203-203: LGTM!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T08:11:08.516947Z a6b0706 PR opened
🔒 Security Review ✅ Completed 2026-11-16T08:16:37.424657Z a6b0706 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit aa621fd into main Nov 16, 2026
99 of 101 checks passed
@hyperpolymath
hyperpolymath deleted the codex/scanner-alert-check-20261116 branch November 16, 2026 08:25
hyperpolymath added a commit that referenced this pull request Nov 16, 2026
…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.
hyperpolymath added a commit that referenced this pull request Nov 17, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants