Skip to main content

Fast CLI scanner for secrets and credentials in git staged files and directories

Project description

secret-scan-lite

PyPI Python License: MIT

Fast CLI scanner that detects secrets and credentials in git staged files before they hit your history.

Install

pip install secret-scan-lite

Usage

# Scan staged files only (git pre-commit default)
secret-scan

# Scan a specific directory
secret-scan --path ./src

# Scan entire working tree
secret-scan --all

Exit codes

Code Meaning
0 Clean — no secrets found
1 Secrets detected — git will abort the commit
2 Error (not a git repo, git not installed, etc.)

Detected patterns

Pattern Severity
AWS Access Key ID (AKIA…) HIGH
AWS Secret Access Key HIGH
Generic password / secret / token assignment HIGH
RSA / EC / OpenSSH Private Key HIGH
Telegram Bot Token HIGH
GitHub PAT (classic & fine-grained) HIGH
Slack Bot / App Token HIGH
Stripe Secret Key HIGH
Google API Key HIGH
Basic Auth in URL MEDIUM
Generic Bearer Token MEDIUM

Use as a pre-commit hook

Add to your .pre-commit-config.yaml:

repos:
  - repo: local
    hooks:
      - id: secret-scan
        name: Scan for secrets
        entry: secret-scan
        language: system
        stages: [commit]
        pass_filenames: false

Install hooks:

pip install pre-commit
pre-commit install

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

secret_scan_lite-1.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

secret_scan_lite-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file secret_scan_lite-1.0.0.tar.gz.

File metadata

  • Download URL: secret_scan_lite-1.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for secret_scan_lite-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f1673fa083bd4ba60b4a692e47988ed70cb6b821e15d48c308bec90ddda1f419
MD5 75caa39d77fc4d8fc87d708ef6b7c78d
BLAKE2b-256 f4a98f50d2b8dc431856620b1064a04e1cecf1d8f0b9dabccdf2291e016f4747

See more details on using hashes here.

File details

Details for the file secret_scan_lite-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for secret_scan_lite-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 026aeda1e5c23a09d3672f8365f7989f23e0f79509546e113fd87b366d9e94ad
MD5 830afe662747c85e055cf75352bbc2b3
BLAKE2b-256 c51f3b40c5e91e4a4cb1d07ed90d3b3da910d4c48d5768164492c591d1ae12d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page