docs(standards): propose push protection standard
Merged
DO
7mo ago+1170+1170+0123456789012345678901234567890123456789-2-2-0123456789
Summary
- Add
standards/push-protection.mdproposing a defense-in-depth approach to prevent secrets, keys, and credentials from being accidentally pushed to any petry-projects repo — GitHub native secret scanning + push protection as primary enforcement, local gitleaks hooks, a complementary CIsecret-scanjob, and an incident response procedure - Cross-reference the new standard from
AGENTS.mdand add aSecurity & Analysisblock tostandards/github-settings.mddocumenting the required repo-levelsecurity_and_analysissettings
What's covered in the new standard
- Scope — every repo regardless of visibility; source, configs, workflows, agent files, fixtures, notebooks
- What counts as a secret — cloud creds, API tokens, DB strings, private keys, OAuth secrets, signing keys
- Layer 1 — GitHub push protection (primary enforcement): required org + repo
security_and_analysissettings, recommended custom secret-scanning patterns, admin-only bypass with audit - Layer 2 — Local pre-commit prevention: gitleaks via pre-commit, agent workstation rules
- Layer 3 — CI secret scanning (secondary defense): required
secret-scanjob inci.ymlrunning gitleaks in full-history mode, coordination with AgentShield - Developer practices: handling real secrets, required
.gitignoreentries, fixture conventions, branch cleanup - Push protection block response — what to do when GitHub blocks your push (no bypass without justification)
- Incident response — rotate first, history rewrite later; 7-step procedure with owners
- Application to a repo and compliance audit checks the weekly audit should add
Test plan
-
markdownlint-cli2passes on all changed.mdfiles -
shellcheck --severity=warning -x scripts/**/*.shpasses (CI globbing also fixed to recurse intoscripts/lib/) -
scripts/apply-repo-settings.shenforces the newsecurity_and_analysisflags viapp_apply_security_and_analysisfromscripts/lib/push-protection.sh -
scripts/compliance-audit.shruns the 5 push-protection checks viapp_run_all_checksfrom the same shared lib - Review the illustrative custom secret-scanning regexes before enabling them org-wide
- Follow-up: add the
secret-scanjob to thecode-qualityruleset's required checks (still needsdetect_required_checks()update inscripts/apply-rulesets.sh) - Smoke-test the apply script in
DRY_RUN=truemode against a single repo before running--all
Summary by CodeRabbit
- Documentation
- Added an org-wide push-protection standard covering prohibited secret types, enforcement layers, developer rules, CI secret-scan requirements, incident response, onboarding checklist, and compliance audit matrix.
- Updated repository security guidance to require secret scanning, push protection (including AI detection and custom/non-provider patterns), and Dependabot security updates.
- Added a secrets-focused .gitignore to ignore common credential and token artifacts.
- Updated organization standards index to reference the new push-protection standard.