ci: add public-repo-guard (org leak gate) - #7
Conversation
|
|
Warning Review limit reached
More reviews will be available in 50 minutes and 11 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- There is a concrete medium-risk CI/security concern in
.github/workflows/public-repo-guard.yml: guard rules/scripts are fetched from an unpinnedmain, which can change unexpectedly and make the gate non-deterministic. - Given the 6/10 severity with high confidence (8/10), this is more than a minor housekeeping issue and could allow upstream regressions or tampering to affect merge decisions.
- Pay close attention to
.github/workflows/public-repo-guard.yml- pin external guard references to immutable SHAs/tags to keep the CI gate deterministic and trustworthy.
Architecture diagram
sequenceDiagram
participant GH as GitHub Actions
participant Runner as Runner (ubuntu-latest)
participant Checkout as Checkout Step
participant CentralRepo as wave-av/.github (raw)
participant GitleaksBin as gitleaks Release
participant Gitleaks as gitleaks CL
participant PolicyScript as content-policy.sh
participant OrgVars as Org Variables
GH->>Runner: Trigger workflow (PR / push / workflow_dispatch)
Runner->>Checkout: actions/checkout@v5 (fetch-depth: 0)
Checkout-->>Runner: Repository contents
alt Local .gitleaks.toml missing
Runner->>CentralRepo: curl canonical .gitleaks.toml
CentralRepo-->>Runner: Saved as .gitleaks.toml
end
Runner->>GitleaksBin: Download gitleaks v8.30.1 binary
GitleaksBin-->>Runner: Install /usr/local/bin/gitleaks
Runner->>Gitleaks: gitleaks detect --no-git --source . --config .gitleaks.toml
alt Secrets found
Gitleaks-->>Runner: Exit code 1 (fail)
else No secrets
Gitleaks-->>Runner: Exit code 0
end
Runner->>CentralRepo: curl scripts/public-repo-guard/content-policy.sh
CentralRepo-->>Runner: Script saved + chmod
Runner->>OrgVars: Read GUARD_PRIVATE_REPOS variable
OrgVars-->>Runner: Value passed via env
Note over Runner,PolicyScript: Allowlisting via # guard:allow and .guardignore
Runner->>PolicyScript: bash content-policy.sh . (with env)
alt Content policy violation
PolicyScript-->>Runner: Exit non-zero (fail)
else All clear
PolicyScript-->>Runner: Exit 0
end
alt Both checks pass
Runner->>GH: Success
else Any check fails
Runner->>GH: Failure
end
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Vendors .gitleaks.toml + content-policy.sh in-repo and checksum-verifies the gitleaks binary, so the secret-scan gate no longer fetches its policy/binary from a mutable/unverified source. Drops fetch-depth:0 (tree scan). Mirrors wave-av/.github canonical guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Vendors .gitleaks.toml + content-policy.sh in-repo and checksum-verifies the gitleaks binary, so the secret-scan gate no longer fetches its policy/binary from a mutable/unverified source. Drops fetch-depth:0 (tree scan). Mirrors wave-av/.github canonical guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Vendors .gitleaks.toml + content-policy.sh in-repo and checksum-verifies the gitleaks binary, so the secret-scan gate no longer fetches its policy/binary from a mutable/unverified source. Drops fetch-depth:0 (tree scan). Mirrors wave-av/.github canonical guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
This review was skipped because it would exceed your organization's monthly flex usage limit. Raise the limit in billing settings or wait until the next billing period resets limits.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Vendors .gitleaks.toml + content-policy.sh in-repo and checksum-verifies the gitleaks binary, so the secret-scan gate no longer fetches its policy/binary from a mutable/unverified source. Drops fetch-depth:0 (tree scan). Mirrors wave-av/.github canonical guard. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Adds the org public-repo-guard CI gate (gitleaks + content-policy.sh) to this repo. Rules are fetched from the canonical wave-av/.github at runtime, so they stay centralized. Private-repo denylist comes from the org
GUARD_PRIVATE_REPOSActions variable.Part of the org-wide pre-publication leak gate (wave-av/.github).
🤖 Generated with Claude Code
Summary by cubic
Adds a hardened, self-contained public-repo guard CI that scans the published tree for secrets and WAVE-internal content. Vendors
.gitleaks.tomlandscripts/public-repo-guard/content-policy.sh, pins and SHA-256 verifiesgitleaks, and redacts matches for a deterministic gate mirroring the org canonical guard.New Features
gitleakson the published tree with local.gitleaks.toml(no history); pins v8.30.1 and verifies checksum..gitleaks.toml: adds.git/metadata allowlist and placeholder/fixture allowlists to reduce false positives.scripts/public-repo-guard/content-policy.shfor WAVE-specific leaks (Stripe IDs/keys, Cloudflareaccount_id, private repo refs viavars.GUARD_PRIVATE_REPOS, absolute dev paths, committed.env) and extra keys gitleaks may miss (Anthropic, GitHub PAT, Supabase, AWS, private keys). Allowlist via# guard:allow <reason>and.guardignore.Dependencies
actions/checkout@v5,gitleaksv8.30.1 (version-pinned + SHA-256 verified), andripgrep.Written for commit bba8fd8. Summary will update on new commits.