ci: fix Scorecard startup_failure (missing contents:read) + presence-gate instant-sync#53
Merged
Merged
Conversation
…gate instant-sync Follow-up root fixes after #52 (which re-pinned the reusables but left two issues the re-pin alone could not resolve): - scorecard.yml: the analysis job granted only security-events:write + id-token:write, so `contents` resolved to `none`. The scorecard reusable declares top-level `permissions: contents: read`, and a reusable requesting a permission the caller did not grant fails at startup (0 jobs / startup_failure -- which persisted across the re-pin, unlike Hypatia). Add `contents: read`. - instant-sync.yml: presence-gate the repository-dispatch step on the token (job env + `if: != ''`), per Hypatia's secret_action_without_presence_gate finding; absent-token contexts now skip cleanly. NOTE: the job still needs a *valid* FARM_DISPATCH_TOKEN to go green -- the current one returns "Bad credentials" and must be rotated by the maintainer. https://claude.ai/code/session_01GJatEm2TVFSTBEkKXmserJ
🔍 Hypatia Security ScanFindings: 73 issues detected
View findings[
{
"reason": "Issue in governance.yml",
"type": "missing_timeout_minutes",
"file": "governance.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in hypatia-scan.yml",
"type": "missing_timeout_minutes",
"file": "hypatia-scan.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in mirror.yml",
"type": "missing_timeout_minutes",
"file": "mirror.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in scorecard.yml",
"type": "missing_timeout_minutes",
"file": "scorecard.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in secret-scanner.yml",
"type": "missing_timeout_minutes",
"file": "secret-scanner.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in instant-sync.yml",
"type": "secret_action_without_presence_gate",
"file": "instant-sync.yml",
"action": "peter-evans/repository-dispatch",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Repository has 5 non-main remote branch(es). Policy: single main branch only.",
"type": "GS007",
"file": ".",
"action": "delete_remote_branches",
"rule_module": "git_state",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
"type": "CSA001",
"file": "0-AI-MANIFEST.a2ml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
"type": "CSA001",
"file": "0-AI-MANIFEST.a2ml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
},
{
"reason": "Code scanning (Hypatia): hypatia/structural_drift/SD007 -- Hypatia structural_drift: SD007 -- 0 day(s) old",
"type": "CSA001",
"file": "0-AI-MANIFEST.a2ml",
"action": "review",
"rule_module": "code_scanning_alerts",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #52. After the reusable re-pins landed, I verified
main's post-merge CI and found Hypatia is now green (re-pin worked) but Scorecards stillstartup_failure— proving its cause was not the stale SHA. Root-caused and fixed here, plus the one genuinely-actionable Hypatia HIGH.Scorecard
startup_failure— real root causeThe
scorecard-reusable.ymldeclares top-levelpermissions: contents: read. But this repo's wrapper sets job-levelpermissions: { security-events: write, id-token: write }(added in #47), and a job-level permissions block sets every unlisted permission tonone— socontentsbecamenone. A reusable workflow that requests a permission its caller didn't grant fails at startup (0 jobs), which is exactly the symptom — and it persisted across the re-pin (unlike Hypatia, whose wrapper grantscontents: readat workflow level).Fix: add
contents: readto theanalysisjob's permissions (verified against the reusable's declaredpermissions:at861b5e9).instant-sync — presence gate
Per Hypatia's
secret_action_without_presence_gate(HIGH), therepository-dispatchstep is now gated on token presence (jobenv+if: ${{ env.FARM_DISPATCH_TOKEN != '' }}), so absent-token contexts skip cleanly.FARM_DISPATCH_TOKENreturnsBad credentialsand must be rotated by the maintainer — no in-repo change can mint a valid credential.Still needs a maintainer decision (surfaced, not touched — ambiguous/destructive)
.gitmodules(fs,obli-fs,transpiler,ssg,riscv-dev-kit,obli-riscv-dev-kit) — all empty, pointing at commits with no URL. Either restore a.gitmodules(if real submodules) orgit rm --cachedthem (if accidental). Needs your intent.GS007): e.g.cicd/codeql-cron-monthly,claude/codeql-actions-scan,claude/proof-debt-ledger. Branch deletion is destructive — your call.CSA001structural-drift alerts on.machine_readable/{PLAYBOOK,NEUROSYM,AGENTIC}.scm(stale prior-run code-scanning alerts) — schema work, needs context.missing_timeout_minutesflags are false positives (reusable-caller jobs cannot carrytimeout-minutes).🤖 Draft — opened for review.
https://claude.ai/code/session_01GJatEm2TVFSTBEkKXmserJ
Generated by Claude Code