Skip to content

feat(gitleaks,lychee): flag stateless App tokens and skip api.github.com in online checks - #915

Merged
kyle-sexton merged 1 commit into
mainfrom
feat/gitleaks-lychee-excludes
Oct 30, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
feat/gitleaks-lychee-excludes

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #830
Closes #831

Summary

Gitleaks' default rules miss GitHub's stateless App installation tokens (ghs_<appid>_<jwt>), and the online lychee run fails with 403 on api.github.com REST URLs that docs cite on purpose.

Fix

  • .gitleaks.toml (the root-canonical source per distribution/sync-manifest.yml): add the github-app-installation-token rule from gitleaks: add a rule for GitHub stateless App installation tokens (ghs_<appid>_<jwt>) #830, ghs_[A-Za-z0-9._-]{36,}, after [extend] useDefault = true.
  • lychee.toml (also root-canonical; feat(lychee): exclude api.github.com endpoints from the online link check #831 names components/lychee/lychee.toml, which does not exist): add '^https://api\.github\.com/' to exclude.
  • components/gitleaks/README.md: the config now adds one rule, so the sentence saying it adds nothing is updated.
  • Tests: a stateless-token case in components/gitleaks/gitleaks.test.sh (token built from parts at run time, checked detected and redacted in output and report) and an api.github.com case in components/lychee/lychee.test.sh with a line in Exclusions.md.

Verification

  • harness/shell/run-tests.sh components/gitleaks/gitleaks.test.sh: pass.
  • harness/shell/run-tests.sh components/lychee/lychee.test.sh: pass.
  • The new gitleaks case fails against the previous .gitleaks.toml (no github-app-installation-token finding) and passes with the rule.
  • markdownlint-cli2 on the touched markdown: 0 issues.

Related

Found in melodic-software/claude-code-plugins#8855. Once this syncs, claude-code-plugins can drop its repo-local .lycheeignore entries for the six URLs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VcupojYKhHyDni9LuAXBuX

…com in online checks

Add a github-app-installation-token rule to the canonical .gitleaks.toml
covering ghs_<appid>_<jwt>, and exclude the api.github.com host from the
online lychee run in the canonical lychee.toml. Tests cover both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojYKhHyDni9LuAXBuX
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 30, 2026 19:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T19:12:20.968590Z 5296b5c Draft marked ready
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

claude-security-review reviewed 5296b5c08786da6508bc15cfad5493daa41d8bff: 0 finding(s), 0 as inline comments.

No security findings. I read the full diff with gh pr diff and wrote no inline comments.

critical-findings: 0

  • .gitleaks.toml: This adds one detection rule, github-app-installation-token. The regex is ghs_[A-Za-z0-9._-]{36,} and is linear, so it has no backtracking risk. It only widens what gets flagged. There is no allowlist, no path exclusion and no change to the inherited default ruleset. The rule can be wrong in one direction only: it might miss a token format, which is no worse than before.
  • components/gitleaks/gitleaks.test.sh: The test token is a placeholder built from parts, so the test file itself doesn't match the rule. The test also checks that the value is redacted in the output and in the report.
  • lychee.toml: The new ^https://api\.github\.com/ exclude only affects the online link-checker. It makes lychee skip those URLs. It touches no token, scope, trust control or merge hold, and it grants nothing.
  • Fixtures and docs: The lychee fixture, the lychee test and the gitleaks README have no security surface.
  • Trust controls: None of the listed trusted paths, hold paths, plugin manifests or instruction-surface files changed. The diff removes no standing instruction.
  • Manifest lines: No manifest <field> items apply, because no plugin.json or marketplace.json is in the diff.

@kyle-sexton
kyle-sexton merged commit febcfdd into main Oct 30, 2026
26 checks passed
@kyle-sexton
kyle-sexton deleted the feat/gitleaks-lychee-excludes branch October 30, 2026 19:12
@github-actions

Copy link
Copy Markdown

claude-review reviewed 5296b5c08786da6508bc15cfad5493daa41d8bff: 0 finding(s), 0 as inline comments.

No findings on 5296b5c. I read the full diff and the PR context, and checked the changes against both closing issues (#830 and #831).

  • gitleaks: add a rule for GitHub stateless App installation tokens (ghs_<appid>_<jwt>) #830 (gitleaks rule): .gitleaks.toml adds github-app-installation-token with the regex and keywords the issue proposes. It sits after [extend] useDefault = true and uses its own id, so it adds to the default github-app-token rule instead of replacing it. The new test case in components/gitleaks/gitleaks.test.sh builds the token from parts at run time. It checks exit 1, that the report names the rule, and that the token is redacted in both the output and the report. That meets the issue's "detected" and "redacted" criteria, and the test would fail if the rule were removed.
  • feat(lychee): exclude api.github.com endpoints from the online link check #831 (lychee exclude): lychee.toml adds '^https://api\.github\.com/' to exclude. The PR body notes that components/lychee/lychee.toml does not exist and that the root lychee.toml is the canonical file. A fixture line in Exclusions.md and a dump-based assert_not_contains in lychee.test.sh cover the exclusion. maintenance-audit-link-check-excludes is the only audit workflow that touches excludes. It checks the private-repo inventory and not host-level entries, so it is unaffected.
  • Doc reconciliation: I grepped for other statements that the gitleaks config adds nothing. The .gitleaks.toml header and components/gitleaks/README.md were the only ones, and the PR updates both.
  • Plugin manifests: the diff changes none, so no manifest <field> lines apply.
  • Not run: I did not run the gitleaks or lychee test suites, because the sandbox required approval for that command. The Verification section's pass results are author-claimed and unverified by me.
  • Minor, not reported: one rewrapped comment line in .gitleaks.toml runs past the file's usual wrap width. That is style only.

kyle-sexton added a commit that referenced this pull request Oct 30, 2026
Closes #779

## Summary

Justify verdict (`/overengineering:justify`, attended, inline) on the
App-token half of `maintenance-audit-link-check-excludes`: **RETIRE**.
With that half gone, the scheduled job only repeats the PR lane's
public-visibility check, so the whole workflow is consolidated onto that
lane.

- **Reason when built:** the private-repo inventory drifted twice by
hand ([#212](#212),
[#483](#483)).
[#497](#497)
(2026-08-28) made the inventory generated, added a PR-lane `check` for
"an excluded repo went public", and added this scheduled App-token read
for "a new private sync target is missing".
- **Catches since then:** none. `gh run list --workflow
maintenance-audit-link-check-excludes.yml` shows 27 runs from 2026-10-05
to 2026-10-30, all `success`, and no failed run under any path of this
workflow.
- **The one real gap it was built for was outside its reach.**
[#767](#767)
(2026-10-11) added agent-automations, architecture and azure-iac. Its
own body says this workflow "could not catch it: it reads only the
standards-sync App installation, and none of the three is a sync
target". A manual online run found the gap as a 404, which is the
control that actually catches this drift.
[standards#779](#779)
cites a 16-clone sweep that found one link into an uninventoried private
repository.
- **Carry cost:** a daily job that loads the standards-sync App private
key (an App that holds contents, pull_requests, issues and workflows
write elsewhere) to read repository names, plus a third input mode in
`private-repo-inventory.sh` with its tests. A miss costs one false 404
in a non-blocking online run that names the repository, fixed by
`private-repo-inventory.sh generate --write`.

Options considered: keep (no catch on record, and blind to non-sync
repos); simplify to the public half on a schedule (duplicates the
PR-lane `check`, which runs on every standards pull request and push to
main); retire (this PR).

## Fix

- Delete `.github/workflows/maintenance-audit-link-check-excludes.yml`.
- `components/lychee/private-repo-inventory.sh`: drop
`--installation-list` and the code that only it fed. Drop its two test
cases from `private-repo-inventory.test.sh`.
- `components/lychee/README.md`, `lychee.toml` (the generated-inventory
comment, outside the lines #915 touched), `pr-require-checks.yml`, root
`README.md`, `components/code-review-rules/README.md`, and the cron
comments of three maintenance workflows now say what covers each
direction, or stop naming the workflow.
- `vocabulary.json`: the `check-links` purpose no longer names the
workflow. The `audit-link-check-excludes` slot stays, because
`rename-map.json` still lists it as a rename target and
`naming-lint.test.mjs` requires every rename target to pass the
vocabulary.
- ADR 0007, which mentions the workflow under its old name, is left as
written.

## Verification

- `bash harness/shell/run-tests.sh
components/lychee/private-repo-inventory.test.sh`: passed.
`components/lychee/lychee.test.sh`: passed.
- `bash components/lychee/private-repo-inventory.sh check --config
lychee.toml`: OK.
- `npm run lint:github-actions-conventions`: 0 findings. `node --test
components/github-actions-conventions/naming-lint.test.mjs`: 14 pass.
`lint:concurrency-policy` and `lint:runner-policy`: passed.
- `actionlint` on every workflow: clean. `shellcheck` on both scripts:
clean. markdownlint on the three READMEs: clean.

## Related

- The `STANDARDS_SYNC_APP_*` secrets in the `standards-sync` environment
are still used by the sync workflow. Nothing to remove there.
- Separate from
[#923](#923) (#778 and
#780), which edits a different paragraph of
`components/lychee/README.md`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01VcupojYKhHyDni9LuAXBuX

Co-authored-by: Claude Opus 5.5 <[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

1 participant