Add hardcoded secret detection#84
Open
daniplatform wants to merge 3 commits into
Open
Conversation
Adds a dedicated secrets-scanning ruleset (AWS/GCP/Azure/GitHub/Slack/Stripe keys, private key material, JWTs, generic secret assignments) plus a Shannon-entropy fallback rule for unpatterned high-entropy tokens. Matched secret values are always redacted before being stored on an Issue. New `pyspector secrets` CLI group: - `scan` — working tree, `--staged-only` (pre-commit), or `--history` (full git object history, to catch secrets removed from HEAD but still reachable) - `baseline` — snapshot current findings into .pyspector_baseline.json for incremental adoption on legacy repos - `install-hook` — installs a pre-commit hook running the staged-only scan Rebased onto main to reconcile with the recently-merged ParzivalHack#55 (regex-only G110-G133 secret detectors bundled into the main ruleset): this feature adds a separate, opt-in `pyspector secrets` command with entropy-based detection, git-history/staged scanning, baselining, and hook installation, none of which ParzivalHack#55 covers. Test fixtures for the AWS/Slack/Stripe rules are split with `concat!` so the provider-shaped secret string never appears contiguous in source (avoids tripping GitHub push protection on synthetic-but-realistic test data). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.