Repository navigation
Description
Turn chant's CI security rules into a tool that audits any repo's pipelines — including hand-written YAML chant did not generate.
Why
chant already ships a deep CI security rule set: 58 GHA rules (github), 44 WGL rules (gitlab), and forgejo reuses github's set. Today those rules only run during a chant build, so they only see workflows chant generates. Epic #296 named this exact gap in its Out of scope note:
Whole-repo coverage of hand-written workflows — post-synth only sees workflows chant generates. For non-generated YAML, run a dedicated auditor on the output.
chant audit is that dedicated auditor. It reads existing .github/workflows/*.yml, .gitlab-ci.yml, and .forgejo/workflows/*.yml, runs the real post-synth security checks against them, and emits a tiered report.
Goals
- Library + CLI —
chant audit <path>on any repo, no chant adoption required. Primary near-term deliverable. - Tiered findings — separate merge-worthy security findings (worth a PR to the target) from report-only hygiene, with external-authority citations (OSSF Scorecard / GitHub hardening) so a finding isn't just chant's opinion.
- Shareable report — a markdown artifact suitable for outreach or a PR description.
- Hosted tool (portfolio piece) — a paste-a-URL web service wrapping the same library, scale-to-zero, rate-limited. Phase 2; ships only after the library is solid.
Design spine (read before picking up a child)
- Post-synth checks (
lexicons/<lex>/src/lint/post-synth/*.ts) are sync, auto-discovered viaplugin.postSynthChecks(), and read the emitted YAML fromctx.outputs(Map<string, string | SerializerResult>). Seepackages/core/src/lint/post-synth.ts(PostSynthContext,runPostSynthChecks,getPrimaryOutput). - The auditor therefore needs no import-to-chant-model step for the security tier. It constructs a synthetic
PostSynthContextwhoseoutputsmap isfilePath → rawYAML(entities empty, env undefined) and runs the target lexicon's checks. Checks that iteratefor (const [, output] of ctx.outputs)handle one-doc and cross-file checks alike. - No LLM anywhere in the audit or the hosted service. Findings are deterministic lint rules (zero inference, no API key). Fixes split by
fixKind(see feat(audit): rule catalog — tiering, authority citations, remediation #351): deterministic fixes (addpermissions: contents: read; pin@v4→@shavia a git API lookup, not a model) may be auto-applied/diffed (feat(audit): round-trip proof of minimal change per finding #358); guidance fixes (right-sized scopes, injection rewrites, pwn-request redesigns) are report text only, never auto-applied. Any LLM-assisted apply is a separate, optional, local bring-your-own-key step — never run or paid for by the service. This keeps remote cost ~\$0. - Known limitation: any check that reads
ctx.entities(chant model) instead ofctx.outputs(YAML) will not fire on audited YAML. The security tier is YAML-based, so this is acceptable — document per-rule in the catalog. - The existing
chant importCLI is not reused: it gates onJSON.parse(import.ts:201) and rejects YAML before reaching the YAML parser. The auditor calls the lexicon parsers / post-synth checks directly.
Phasing
Phase 1 — library + CLI (do first)
- feat(audit): core audit library — run CI security checks on arbitrary YAML #354 — Audit core library
- feat(audit): rule catalog — tiering, authority citations, remediation #351 — Rule catalog: tiering + authority citations + remediation
- feat(audit): chant audit CLI command #353 —
chant auditCLI command - feat(audit): markdown report generator #352 — Markdown report generator
- feat(audit): round-trip proof of minimal change per finding #358 — Round-trip proof of minimal change (defer-friendly)
Phase 2 — hosted tool (good-problem-to-have)
- feat(audit): remote fetch — audit a git URL (host allowlist + caps) #355 — Remote fetch: audit a git URL (host allowlist + caps)
- feat(audit): hosted service — serverless handler + static frontend + deploy #356 — Hosted service: serverless handler + static frontend + deploy
- feat(audit): rate limiting & abuse / SSRF hardening (public-launch blocker) #357 — Rate limiting & abuse / SSRF hardening (public-launch blocker)
Cold-start conventions
Each child is self-contained: target files, the approach, tests, and a Definition of done. Shared rules: npx vitest run stays green; new code lives under packages/core/src/audit/; no network or fs in the pure core (fetch is isolated to its own module); rerun docs codegen if rule metadata is surfaced in docs.
Unlinked sub-issues (attached 2026-08-23)
- Export audit findings in a standard interchange format for external review surfaces #442 Export audit findings in a standard interchange format for external review surfaces
- Detect exposed secrets and credentials in scanned files #443 Detect exposed secrets and credentials in scanned files
- Add an efficiency finding dimension for wasteful configuration #444 Add an efficiency finding dimension for wasteful configuration
- Expand GitHub workflow supply-chain and token-scoping audits #445 Expand GitHub workflow supply-chain and token-scoping audits
- Extend audit coverage to configuration formats the engine cannot currently parse #446 Extend audit coverage to configuration formats the engine cannot currently parse
Activity
feat(audit): clickable rule IDs + generated rules reference page (#387)
docs(audit): example render — markdown sample + linked HTML sample (#388
audit(#687 phase 1): add the auditCatalog seam + resolveAuditCatalog …
feat(audit): GitHub workflow supply-chain and token-scoping rule expa…
lex00 commentedon Aug 26, 2026
Status sweep (2026-08-26). All five unlinked sub-issues closed today: #443 (secrets detection, SEC001–SEC010, PR #1969), #445 (supply-chain/token-scoping, GHA059–GHA062, PR #1975), #444 (efficiency dimension + GHA063–GHA068/WGL049–WGL050, PR #1976), #442 (SARIF completion — tier/category properties, remediation help, ajv schema validation, PR #1974), #446 (spike-gated format coverage — Wrangler TOML, WRG001–WRG006, PR #1978; nginx follow-up filed as #1979). Also landed adjacent: search-first fetch discovery for large repos (#520, PR #1971).
Phase 2 disposition — #356 held back, #357 status: per this epic's own comments, #357's hardening layers are implemented and tested in the private INTENTIUS/blacklight service repo (per-IP + global rate limits over KV, fail-closed Turnstile, SSRF host-allowlist, resource caps), env-gated off by default; #356's handler + tier-first SPA are built and E2E-verified there, and #431 (npm publish) has since closed, removing the file:-deps deploy blocker. What remains is deploy-time work tracked in the blacklight repo (blacklight#1 deploy, #2 CORS lock to Pages origin, #3 counters, #4 optional DO) plus flipping the gates on for prod. Those are outward-facing launch actions in another repo — deliberately left for the maintainer; nothing further blocks them from this repo's side.
lex00 commentedon Sep 2, 2026
Every phase is shipped, so closing the epic.
Phase 1 (library + CLI) — #354/#351/#353/#352/#358, all long merged.
Phase 2 (hosted tool) — #355 merged; #356 shipped as INTENTIUS/blacklight (live at blacklight.intentius.workers.dev); #357, the public-launch gate, closed today with a full review: rate limiting live-verified (5/min → 429), SSRF live-verified (metadata IP → 400), exact in-flight concurrency via a Durable Object (blacklight#26), resource caps and reject-reason logging in place. The one remaining human step — enabling Turnstile with account credentials — is documented in blacklight's README and deliberately not automated.
Since the epic was filed, coverage also grew past its original scope: secrets (SEC), Wrangler config (WRG, #446), and today nginx (NGX, #1979) — all lexicon-independent, all running on both the local CLI and the hosted path. Dogfooding the hosted bump surfaced and fixed three engine regressions this week (#2055 edge-cleanliness, #2056 candidate collection, #2057 lockfile noise), which is the epic's model working as intended: the hosted tool is now the audit engine's best integration test.
Current live state: chant 0.54.2 on npm, blacklight deployed against it, 65 audits / 2014 findings on the anonymous counter.