Skip to content
Back to skills

Secret Scanner

CSecurity

Pre-push API key and credential scanner - blocks git push if secrets found

  • 530 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 29, 2026
ai-agentsgojavaphpswiftbashsqlnodeawsgitapi

Works with

  • api

Security analysis

C70/100
  • highContains patterns that look like hardcoded API keys
  • highContains patterns that look like hardcoded API keys

Pro shows the line behind each finding and how to fix it

Scanned May 29, 2026

npx -y skills add vibeeval/vibecosystem --skill secret-scanner --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Secret Scanner?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Secret Scanner
[![Security: C — Skills Directory](https://www.skillsdirectory.com/api/skills/vibeeval-secret-scanner/badge)](https://www.skillsdirectory.com/skills/vibeeval-secret-scanner)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: secret-scanner
description: "Pre-push API key and credential scanner - blocks git push if secrets found"
version: 1.0.0
category: security
tags: [secrets, api-keys, pre-push, git-hooks, security]
---

# Secret Scanner

Scans your codebase for leaked API keys, tokens, and credentials. Blocks git push if secrets are found.

## Usage

```bash
# Scan current directory
vibeco secrets

# Scan specific path
vibeco secrets /path/to/project
```

## Detected Secrets (22 patterns)

| Provider | Pattern | Example |
|----------|---------|---------|
| OpenAI | `sk-proj-...`, `sk-...` | `sk-proj-abc123...` |
| Anthropic | `sk-ant-...` | `sk-ant-api03-...` |
| AWS | `AKIA...` | `AKIAIOSFODNN7EXAMPLE` |
| GitHub | `ghp_...`, `gho_...`, `github_pat_...` | `ghp_xxxxxxxxxxxx` |
| Stripe | `sk_live_...`, `pk_live_...` | `sk_live_4eC39H...` |
| Google | `AIza...` | `AIzaSyDaGm...` |
| Slack | `xoxb-...`, `xoxp-...` | `xoxb-123-456-abc` |
| SendGrid | `SG....` | `SG.xxx.yyy` |
| npm | `npm_...` | `npm_xxxxxxxxxxxxx` |
| PyPI | `pypi-...` | `pypi-AgEIcHl...` |
| Database URLs | `postgres://`, `mongodb://`, `mysql://`, `redis://` | With embedded passwords |
| Private Keys | `PRIVATE KEY-----` | PEM format |

## Auto-Setup: Git Pre-Push Hook

Add to your project's `.git/hooks/pre-push`:

```bash
#!/bin/bash
vibeco secrets "$(git rev-parse --show-toplevel)" || exit 1
```

Make it executable:
```bash
chmod +x .git/hooks/pre-push
```

Now every `git push` will scan for secrets first. If any are found, push is blocked.

## How It Works

1. Walks all source files (skips node_modules, dist, .git, lock files)
2. Matches 22 regex patterns for known API key formats
3. Skips comments and regex definition lines (avoids false positives)
4. If secrets found: prints masked values, exits with code 1 (blocks push)
5. If clean: prints success, exits with code 0

## What to Do If Secrets Are Found

1. **Remove** the secret from source code
2. **Move** to `.env` file (add `.env` to `.gitignore`)
3. **Use** environment variables: `process.env.API_KEY`
4. **If already pushed**: rotate the credential immediately (it's compromised)

## Scanned File Types

`.ts .tsx .js .jsx .mjs .cjs .py .go .java .rb .php .rs .swift .kt .json .yml .yaml .toml .env .cfg .conf .ini .sh .bash .zsh .xml .properties .gradle`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…