Skip to content

SecretSweep v1.0.0

Choose a tag to compare

@RahilSahu RahilSahu released this 14 Nov 08:10
· 3 commits to main since this release

First release of SecretSweep, an offline secrets scanner written in Rust.

What is included:

  • 94 pattern rules for known providers and formats: AWS, GCP, Azure, GitHub, GitLab, Slack, Stripe, OpenAI, Anthropic, npm, PyPI, database connection strings, private key blocks, generic credential assignments, and more. Run secretsweep --list-rules for the full registry.
  • A heuristic entropy engine (Shannon entropy over quoted strings and assignment values, charset-aware thresholds, UUID and hash-digest exclusions) that labels its findings as heuristic.
  • Worktree scanning that respects .gitignore, skips binaries and oversize files, and still scans lockfiles and dotfiles such as .env.
  • Git history scanning via the git CLI (--git), which finds secrets that were committed and later removed, with the commit hash attached. Merge commits are not covered; see the README limitations.
  • Baselines (fingerprints only, no secret values are stored) and a TOML allowlist by rule, path glob or fingerprint.
  • Text, JSON and SARIF 2.1.0 reports. Reports never print a full secret: at most a four character preview plus a hash fingerprint.
  • Exit codes designed for CI: 0 clean, 1 findings at or above --fail-on (default high), 2 usage or runtime error.
  • A pre-commit hook example and a .pre-commit-hooks.yaml for the pre-commit framework.

Testing: 152 tests pass locally and in CI (per-rule positive and negative cases for all 94 rules, entropy behaviour, scanner integration on temporary trees, a git history integration test that commits and then removes a documented example key, baseline suppression, report shape, and CLI exit codes). CI also enforces cargo fmt --check and clippy with warnings denied.

Install: cargo install --git https://github.com/RahilSahu/secretsweep --tag v1.0.0 (needs a stable Rust toolchain; history mode also needs git).

Note on fixtures: tests use only publicly documented example credentials or synthetic strings assembled from fragments. During the first push, GitHub push protection flagged two fixtures that were written as single literals (a Slack bot token and a Slack webhook shape); both were reworked into fragmented synthetic strings rather than allowed through, and the push then passed.