How ripsecrets detects secrets
mainThe tool uses two primary methods to identify secrets:
- Known Patterns: Uses regular expressions to match API keys with predefined prefixes (e.g., Stripe, Slack).
- Randomness Detection: For secrets without a known pattern (like AWS secret access keys),
ripsecretslooks for variables or properties assigned words liketoken,secret, orpassword. It then calculates the probability that the assigned string occurred by random chance. If the probability is less than 1 in 10,000, it is flagged as a secret.
ripsecrets operates entirely locally and never sends data to third-party services for verification.