Repository navigation
chore(ci): guard PR text and commits against unredacted identifiers - #392
Merged
Merged
Conversation
A recent PR body quoted a raw production log line, exposing a real Telegram group chat id. Add two layers of prevention: - AGENTS.md: hard rule that public artifacts (PR/issue bodies, commit messages, docs, comments) must redact real ids/tokens and never quote raw production logs. - privacy-guard workflow: scans PR title, body and commits for Telegram chat ids, bot tokens, OpenAI/GitHub/AWS key shapes and fails the check on any unredacted match. Re-runs on PR edit so a redacted body clears the check.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
PR Check ReportSummary
Test Results
Code Quality
Test Artifacts
LinksThis report is auto-generated by GitHub Actions |
- .githooks/pre-commit + .githooks/commit-msg: block commits whose staged content or message matches sensitive patterns (<chat_id>/<token>/<key> shapes) - .githooks/sensitive-patterns.txt: single pattern source for hooks and CI - .githooks/selftest.sh: positive/negative samples assembled from fragments so the test data itself does not trip the hooks - Directory.Build.targets: first build in a fresh clone runs 'git config core.hooksPath .githooks' (skipped when CI=true) - privacy-guard workflow: read the shared pattern file, and report only matched line numbers so a detected value is never echoed into public CI logs - AGENTS.md: document the hooks and their automatic installation
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.
Why
A recent PR body quoted a raw production log line and exposed a real Telegram group chat id. Agent-authored PRs must not publish production identifiers or secrets, and "remember to redact" is not a control.
Layers
1.
AGENTS.mdhard rule — never paste raw production logs/configs into public artifacts (PR/issue bodies, comments, commit messages, docs); redact ids, tokens, keys and internal hosts; full logs stay local.AGENTS.mdis loaded into every agent session for this repo.2. Local git hooks (
.githooks/) — block the commit before it exists:pre-commitscans staged content,commit-msgscans the commit message.githooks/sensitive-patterns.txtgit config core.hooksPath .githookson the firstdotnet build/testviaDirectory.Build.targets(skipped whenCI=true); manual fallbackgit config core.hooksPath .githooks.githooks/selftest.shproves the patterns catch leaked shapes and ignore redacted ones3. CI guard (
.github/workflows/privacy-guard.yml) — scans PR title, body and the PR's commit messages, and fails on:-100…)id:35 chars)sk-…, GitHubgh[pousr]_…, AWSAKIA…keysRe-runs on
edited, so redacting a PR body clears the check without a new push. It reports matched line numbers only and never echoes the matched content, so a detected value is not re-published in CI logs.Validation
.githooks/selftest.sh→ 5/5 leaked samples caught, redacted sample cleangit commitfail; a commit message with one is rejected bycommit-msggit config --unset core.hooksPath, adotnet buildrestorescore.hooksPath=.githooksNotes
--no-verify) and documented as not allowed.