chore: block newly committed .env credentials in CI - #2
Conversation
An org-wide read-only sweep on 12 Aug walked every commit in the AfterQuery org. This repo has committed .env-shaped files (2 placement(s)) but NONE of their values matched a provider credential pattern -- so this is prevention, not remediation, and the PR says so rather than implying a leak that is not there. It still qualifies: a repo that already commits .env files and does not reliably ignore them is exactly where the next real credential lands. Its .gitignore is 1781 bytes and does not cover every .env-shaped name. A plain `git add -A` in this repo stages `.env.development`, `.env.local`, `.env.production` today. What it does: on every PR and every push to `main`, it checks the .env-shaped files a change ADDS OR MODIFIES, and fails only on a provider-matched value. Anything already committed here is untouched until someone edits it, so this lands green. Honest limit: this repo has no required-status-check ruleset (the only rule is "no force push"), so the check reports but does not block. It is detective until protection is added -- deliberately left as a repo-owner decision rather than changed here. bin/credscan.py is vendored rather than reimplemented, so this uses the SAME detector that produced the sweep's published numbers. --selftest runs in CI ahead of the check, because a detector that silently stopped matching would report "clean" forever. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Comment |
Summary
.envplacement(s) but none of their values matched a provider credential pattern — so this is prevention, not remediation, and this PR does not claim a leak that isn't there. It still qualifies: a repo that commits.envfiles and its.gitignore(1781 B) does not cover every.env-shaped name is where the next real credential lands..github/workflows/committed-env.yml— a 15th workflow alongside the 14 already here — plusbin/check-committed-env.pyand a vendored
bin/credscan.py, the same detector that produced the sweep's numbers..env-shaped files a change adds or modifies, and only on aprovider-matched value. Anything already committed here is untouched, so this lands
green.
.gitignore(1781 B) does not cover every.env-shaped name, and a plaingit add -Astages.env.development,.env.local,.env.productiontoday.Base branch is
main.What this does NOT do
only ruleset is "no force push" — so the check reports red and merges/pushes still
succeed. Adding a required check is a repo-owner decision and is deliberately not in this
PR.
Test plan
--selftestruns in CI before the check itself (18 assertions), so a detector thatstopped matching cannot pass as "clean".
.gitignore, fetched frommain, in athrowaway repo: a commit adding a provider-shaped
.envexits 1 and names the file;a commit editing only
.env.exampleexits 0; the failure output never echoes thematched value. Every repo in this wave was proved separately because their ignore rules
differ — five of them have no
.gitignoreat all..env-shaped).🤖 Generated with Claude Code