Rechercher

PythonReactSEOPDF
OpenClaw

secret-detection

Git hook to detect secrets before commit.

derick0010 installations selon la source☆ 0 Étoiles du dépôtv1.0.0

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install derick001/secret-detection

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

Secret Detection

What This Does

This skill provides a git pre‑commit hook that scans staged files for common secret patterns (API keys, passwords, tokens) and blocks the commit if any are found. It helps prevent accidental leakage of secrets to public repositories.

Inputs: Git staged files (automatically scanned by the hook) or manual file paths.
Outputs: Detection report with line numbers; non‑zero exit code if secrets found.

When To Use

Use this skill when:

  • You work with repositories that may contain sensitive credentials
  • You want to prevent accidental commits of secrets
  • You need a lightweight, local secret scanner for git workflows
  • You want to enforce security checks before pushing to remote

Usage

Installation
# Install the hook in your git repository
./scripts/main.py install
Manual Scan
# Scan specific files
./scripts/main.py scan --file path/to/file

# Scan all staged files (like the hook does)
./scripts/main.py scan --staged
Hook Behavior
  • The hook runs automatically on git commit
  • If secrets are detected, the commit is blocked
  • The script prints the detected secrets with file names and line numbers
  • Exit code 0 = no secrets found; exit code 1 = secrets found

Examples

Example 1: Installing the Hook
$ ./scripts/main.py install
✓ Pre-commit hook installed at .git/hooks/pre-commit
✓ Hook will scan for secrets on every commit
Example 2: Secret Detection Blocking a Commit
$ git commit -m "Add config"
⚠️  Secret detected in config.yaml line 12: AWS_ACCESS_KEY_ID=AKIA...
⚠️  Secret detected in .env line 3: PASSWORD=secret123
✗ Commit blocked: 2 secrets found
Example 3: Manual Scan
$ ./scripts/main.py scan --staged
Scanning 3 staged files...
✓ config.yaml: clean
✓ .env: clean  
✓ src/main.py: clean
✓ No secrets found

Requirements

  • Git (for hook installation)
  • Python 3.6+ (for the scanner)
  • No external API keys or services needed

L...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/derick001/secret-detection
Version
1.0.0
Commit
e27430e5d57ba9c5eab85a90855a4f66bcd2d45d
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

README

Secret Detection Skill

A git pre‑commit hook that scans staged files for common secret patterns (API keys, passwords, tokens) and blocks commits if secrets are found.

Quick Start

  1. Install the hook (in your git repository):

    ./scripts/main.py install
    
  2. Test the scanner:

    ./scripts/main.py scan --staged
    
  3. The hook will run automatically on every git commit.

What It Detects

  • AWS Access Key IDs (AKIA...)
  • AWS Secret Access Keys
  • Passwords, secrets, tokens in variable assignments
  • GitHub Personal Access Tokens (ghp_...)
  • GitHub Fine‑Grained Tokens (github_pat_...)
  • OpenAI API Keys (sk-...)
  • Bearer tokens

Manual Usage

Scan Specific Files
./scripts/main.py scan --file config.yaml --file .env
Scan All Staged Files
./scripts/main.py scan --staged

How It Works

  1. The install command creates a .git/hooks/pre‑commit script that calls this scanner.
  2. On git commit, the hook scans all staged files using regex patterns.
  3. If any secret pattern is matched, the commit is blocked and the secrets are displayed.
  4. Clean commits proceed normally.

Limitations

  • Only common secret patterns are detected (custom patterns can be added by editing SECRET_PATTERNS in scripts/main.py).
  • May produce false positives (e.g., long random strings that aren't secrets).
  • Does not scan binary files.
  • Requires manual installation per repository.

For Developers

The skill is written in Python 3 and uses no external dependencies beyond the standard library.

To extend the detection patterns, edit the SECRET_PATTERNS list in scripts/main.py.

Contenu extrait

SKILL.md
# Secret Detection

## What This Does

This skill provides a git pre‑commit hook that scans staged files for common secret patterns (API keys, passwords, tokens) and blocks the commit if any are found. It helps prevent accidental leakage of secrets to public repositories.

Inputs: Git staged files (automatically scanned by the hook) or manual file paths.  
Outputs: Detection report with line numbers; non‑zero exit code if secrets found.

## When To Use

Use this skill when:
- You work with repositories that may contain sensitive credentials
- You want to prevent accidental commits of secrets
- You need a lightweight, local secret scanner for git workflows
- You want to enforce security checks before pushing to remote

## Usage

### Installation
```bash
# Install the hook in your git repository
./scripts/main.py install
```

### Manual Scan
```bash
# Scan specific files
./scripts/main.py scan --file path/to/file

# Scan all staged files (like the hook does)
./scripts/main.py scan --staged
```

### Hook Behavior
- The hook runs automatically on `git commit`
- If secrets are detected, the commit is blocked
- The script prints the detected secrets with file names and line numbers
- Exit code 0 = no secrets found; exit code 1 = secrets found

## Examples

### Example 1: Installing the Hook
```bash
$ ./scripts/main.py install
✓ Pre-commit hook installed at .git/hooks/pre-commit
✓ Hook will scan for secrets on every commit
```

### Example 2: Secret Detection Blocking a Commit
```bash
$ git commit -m "Add config"
⚠️  Secret detected in config.yaml line 12: AWS_ACCESS_KEY_ID=AKIA...
⚠️  Secret detected in .env line 3: PASSWORD=secret123
✗ Commit blocked: 2 secrets found
```

### Example 3: Manual Scan
```bash
$ ./scripts/main.py scan --staged
Scanning 3 staged files...
✓ config.yaml: clean
✓ .env: clean  
✓ src/main.py: clean
✓ No secrets found
```

## Requirements

- Git (for hook installation)
- Python 3.6+ (for the scanner)
- No external API keys or services needed

## L...
README
# Secret Detection Skill

A git pre‑commit hook that scans staged files for common secret patterns (API keys, passwords, tokens) and blocks commits if secrets are found.

## Quick Start

1. **Install the hook** (in your git repository):
   ```bash
   ./scripts/main.py install
   ```

2. **Test the scanner**:
   ```bash
   ./scripts/main.py scan --staged
   ```

3. **The hook will run automatically** on every `git commit`.

## What It Detects

- AWS Access Key IDs (`AKIA...`)
- AWS Secret Access Keys
- Passwords, secrets, tokens in variable assignments
- GitHub Personal Access Tokens (`ghp_...`)
- GitHub Fine‑Grained Tokens (`github_pat_...`)
- OpenAI API Keys (`sk-...`)
- Bearer tokens

## Manual Usage

### Scan Specific Files
```bash
./scripts/main.py scan --file config.yaml --file .env
```

### Scan All Staged Files
```bash
./scripts/main.py scan --staged
```

## How It Works

1. The `install` command creates a `.git/hooks/pre‑commit` script that calls this scanner.
2. On `git commit`, the hook scans all staged files using regex patterns.
3. If any secret pattern is matched, the commit is blocked and the secrets are displayed.
4. Clean commits proceed normally.

## Limitations

- Only common secret patterns are detected (custom patterns can be added by editing `SECRET_PATTERNS` in `scripts/main.py`).
- May produce false positives (e.g., long random strings that aren't secrets).
- Does not scan binary files.
- Requires manual installation per repository.

## For Developers

The skill is written in Python 3 and uses no external dependencies beyond the standard library.

To extend the detection patterns, edit the `SECRET_PATTERNS` list in `scripts/main.py`.

Skills associés

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

0protocol

0isone

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.

OpenClaw

0x0-messenger

eijiac24

Send and receive P2P messages using disposable numbers and PINs. No servers, no accounts. Use for human notifications, approval flows, and agent-to-agent communication.