chsh-sk-security-scan

Detect credentials, tokens, and private keys in git staged files, tracked files, or directory trees.

1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/chshzh/claude --skill chsh-sk-security-scan-chshzh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chsh-sk-security-scan
Source: https://github.com/chshzh/claude/tree/main/skills/chsh-sk-security-scan
Command: npx skills add https://github.com/chshzh/claude --skill chsh-sk-security-scan-chshzh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? It prevents accidental commits of secrets such as API tokens, private keys, and hardcoded passwords by scanning files before they enter a git repository, and it can redact leaked credentials in place. ## Core Features & Use Cases - Multi-mode scanning: Scan staged changes, all tracked files, a directory tree, or a single file, with exit codes 0 (CLEAN), 1 (BLOCK), and 2 (WARN) for gating commits. - Pattern-based detection: Regex rules catch GitHub/GitLab/AWS/npm tokens, PEM private keys, long hex credentials, hardcoded passwords, and warn on private IPs or Bearer tokens, with placeholder and lab-IP suppression to reduce false positives. - Sanitize mode: Redact BLOCK-level findings in place while preserving JSON keys and quoting structure, then re-scan to confirm the file is clean. - Use Case: Before committing a config backup, run the sanitize mode to strip embedded credentials, then commit the sanitized file safely. ## Quick Start Ask Claude to run the security scan on your staged git changes and report any leaked credentials before committing.

Frequently Asked Questions about chsh-sk-security-scan

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan git staged files for secrets before committing?

Run python3 scripts/scan.py staged from inside the target repository. It reads staged content via git show, applies credential patterns, and exits 1 on BLOCK findings so the commit can be stopped.

How do I redact leaked credentials from a file automatically?

Use sanitize mode: python3 scripts/scan.py sanitize <filepath>. It replaces BLOCK-level values with <REDACTED> while preserving JSON keys and quotes, then re-scans the file to confirm it is clean.

What types of secrets does the scanner detect?

It detects PEM private keys, GitHub and GitLab tokens, AWS access key IDs, npm tokens, long hex credentials in JSON or assignment form, and hardcoded passwords. WARN patterns flag private IPs and Bearer or Authorization headers.

Why does the scanner report false positives on placeholder values?

Lines containing placeholders like <token>, $ENV_VAR, {{template}}, or your-password are auto-suppressed by OK-line patterns. Private IPs in lab documentation paths such as skills/, wiki/, and agents/ are also suppressed.

Can the scanner check an entire directory instead of a git repo?

Yes, run python3 scripts/scan.py dir <path> to recursively scan every file under a directory tree from any location. Binary files are skipped silently when decoding fails.