security-checker
Validates that no secrets or sensitive data are being committed. Use before commit or PR creation.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Security Checker
Mission: Zero Secrets Committed - this is a PUBLIC repository.
Security Scan Results (Auto-Executed)
!`python .claude/skills/security-checker/scripts/scan_secrets.py 2>&1`
Analysis
Based on the scan results above:
If SCAN PASSED ✅
## ✅ Security Check Passed
Safe to commit. No secrets detected in staged changes.
If SECRETS DETECTED ❌
For each finding:
| Severity | Action |
|---|---|
| CRITICAL | BLOCK - Must fix before commit |
| HIGH | BLOCK - Likely real secret |
Fix Steps:
- Unstage:
git reset HEAD <file> - Remove secret from code
- Use SecretManager:
manager.get_secret("SECRET-NAME") - Re-stage and scan again
What It Scans
Secret Patterns:
- AWS Keys (AKIA...)
- GitHub PATs (ghp_...)
- Anthropic/OpenAI API keys
- JWT tokens, private keys
- Database URLs with passwords
Forbidden Files:
-
.env*files -
*credentials*.json -
*.pem,*.p12keys
For full pattern list, see patterns.md
Safety Rules (CRITICAL)
NEVER:
- Print or log secret values
- Allow "temporary" commits with secrets
- Trust obfuscation (base64, etc.)
ALWAYS:
- Block commits with detected secrets
- Err on side of caution (false positive > false negative)
- Suggest SecretManager usage
False Positives
The scanner ignores:
- Files in
tests/ordocs/directories - Lines with:
example,placeholder,fake,test - Prefixes:
FAKE_,TEST_,EXAMPLE_
If legitimate code blocked, check patterns.md
Integration
Staged changes → security-checker ✅ → commit → push → CI validates
First line of defense - CI (GitLeaks) is the second.
If Secret Already Pushed
- Assume compromised - act immediately
- Rotate the secret in GCP Secret Manager
- Never try git rebase to hide (history persists)
- Document in incident report
Success Metrics
- ✅ Zero secrets in repository history
- ✅ Scan completes in < 3 seconds
- ✅ Clear remediation guidance
- ✅ Low false positive rate (< 5%)
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!