feat(security-suite): single source of truth for scanner configs (phase 1: betterleaks base + pinact dedup)#102
Merged
Merged
Conversation
…eline Give the reusable secret-leak check the same config-resolution contract as reusable-pinact-check.yml, so it works as a truly reusable, ruleset-enforced Security Suite gate. - reusable-secret-leak-check.yml: add a "Resolve betterleaks config" step with priority order: explicit config-path input, repo-local .betterleaks.toml (or .github/.betterleaks.toml), centralized baseline fetched from config-repo (default geolonia/.github), then built-in defaults. Adds config-repo / config-ref inputs; each source is logged. Under ruleset enforcement callers cannot pass inputs, so a committed repo-root file is the per-repo customization surface. - .betterleaks.toml: org-wide baseline. useDefault = true keeps every detector on; a narrowly scoped allowlist suppresses Mapbox public (pk.) tokens, which are client-side and safe by design. Secret (sk.) tokens are not allowlisted. Validated against the pinned betterleaks v1.6.1 image: the baseline parses, suppresses a pk. token (caught by generic-api-key by default), and still catches a GitHub PAT.
WalkthroughAdds a canonical Betterleaks baseline with dynamic workflow resolution and updates pinact configuration guidance. The pinact directory configuration is removed, while documentation now describes the repository-root fallback and helper files. ChangesConfiguration governance
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActionsWorkflow
participant LocalRepository
participant GitHubAPI
participant Betterleaks
GitHubActionsWorkflow->>LocalRepository: Check explicit and repository-local config
GitHubActionsWorkflow->>GitHubAPI: Fetch centralized .betterleaks.toml when needed
GitHubAPI-->>GitHubActionsWorkflow: Return config content or failure
GitHubActionsWorkflow->>Betterleaks: Run scan with resolved config path
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
🛡️ Security suite
Note All security checks passed. Updated for |
…up pinact One source of truth per scanner for the Security Suite. - .betterleaks.toml: expand into the single canonical base. Absorb the allowlist entries currently in betterleaks/default.toml (doc placeholders, example UUIDs, minified-bundle paths, client_id:client_secret, truncated-JWT) alongside the Mapbox pk. entry, with useDefault = true and generic-api-key left ON. This is the per-PR fallback and the base the weekly audit will extend (the audit disables generic-api-key as a one-line delta). Validated on betterleaks v1.5.0 and v1.6.1: Mapbox pk. and placeholders are suppressed, a GitHub PAT still fires. - Delete pinact/.pinact.yml, a stale 45-line duplicate missing the geolonia/* @v1 float exemption that the canonical root .pinact.yml carries. Repoint the docs to the root .pinact.yml, which the Action Pinning Check already fetches as its fallback, so copying it is now optional.
dkastl
marked this pull request as ready for review
July 24, 2026 02:59
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/workflows/pinact-check.md`:
- Around line 36-39: Update the setup guidance in the documentation so only
.github/dependabot.yml is described as required; consistently label .pinact.yml
as optional wherever the page lists or instructs users to copy the root files,
while preserving its fallback-fetch behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6d3c306a-37e1-478a-acd8-dbf5a12d1585
📒 Files selected for processing (5)
.betterleaks.toml.github/workflows/reusable-secret-leak-check.ymldocs/github-actions-pinning.mddocs/workflows/pinact-check.mdpinact/.pinact.yml
💤 Files with no reviewable changes (1)
- pinact/.pinact.yml
…po-level A real, in-use token exception is a repository-level decision the maintainers own, not a silent org-wide exemption baked into the public config. The repo-local .betterleaks.toml auto-detect (already in this PR) is how a repo makes and owns that call. - .betterleaks.toml: remove the Mapbox pk. allowlist. The base now carries only universal, non-secret false-positive patterns (doc placeholders, build artifacts). The header now says project-specific token exceptions, even public client tokens, must live in the owning repo, not here. - docs/workflows/pinact-check.md: make setup guidance consistent. Only .github/dependabot.yml is required (Dependabot reads it in-repo); .pinact.yml is optional since the check fetches the canonical file as its fallback (addresses CodeRabbit).
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.
Phase 1 of the Security Suite single-source-of-truth consolidation (tracking issue: geolonia-operations#236).
Goal
One canonical config per scanner in
geolonia/.github, fetched as the fallback; every other location fetches it or is drift-checked; repos carry no copy (exceptdependabot.yml, which Dependabot can only read in-repo). This PR does thegeolonia/.githubside for betterleaks + pinact.Changes
betterleaks
reusable-secret-leak-check.yml: add config resolution mirroring pinact --config-pathinput, then repo-local.betterleaks.toml/.github/.betterleaks.toml, then centralized fetch fromconfig-repo(defaultgeolonia/.github@main), then built-in defaults. Newconfig-repo/config-refinputs; each source logged. Under ruleset enforcement callers cannot pass inputs, so a committed repo file is the per-repo knob..betterleaks.toml: the single canonical base.useDefault = true(every detector on) plus universal, non-secret false-positive patterns (doc placeholders, generated build artifacts, lifted frombetterleaks/default.toml). This is the per-PR fallback and the base the weekly audit will extend.No org-wide token exceptions here (by design). Project-specific token exceptions, even public client tokens (e.g. a Mapbox
pk.token), are a repository-level decision: the owning repo commits its own.betterleaks.tomlso its maintainers own the call and it is not granted org-wide. This repo is public, so an org-wide token exception would also expose that decision. The repo-local auto-detect above is the mechanism for it. The header documents this so no one re-adds one.pinact
pinact/.pinact.yml: a stale 45-line duplicate missing thegeolonia/* @v1float exemption that the canonical root.pinact.ymlcarries. Repoint the docs to the root file, which the Action Pinning Check already fetches as its fallback, so copying it is now optional (only.github/dependabot.ymlis required in-repo).Validation
Against the pinned betterleaks v1.6.1 (per-PR) and v1.5.0 (audit) images: the base parses on both, suppresses the doc placeholders, and still catches a GitHub PAT; a Mapbox
pk.token in keyword context is flagged again (no org exception); ansk.token still fails.[extend] path+disabledRuleschaining (the future audit delta) verified on both versions.minmap unblock
minmap-image-export-apiis a private repo; it unblocks via its own repo-local.betterleaks.toml(PR #6, which matches on the account substring, not the key value), auto-detected by the reusable. No org-wide exception, nothing published in this public repo.Follow-up phases (issue #236)
geolonia-operationsweekly audit: fetch this base + dropgeneric-api-keyas a one-line delta; align image to v1.6.1; fix the stale "per-PR consumes this" comment.geolonia-backstagetemplates: fetch canonicaldependabot.yml; stop bundling.pinact.yml; reconcile hand-syncedzizmor.yml.geolonia/.github: delete now-unusedbetterleaks/default.toml; add a drift-check.Summary by CodeRabbit