mazen160/secrets-patterns-db
mazen160/secrets-patterns-db has 1,625 GitHub stars and 189 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-08 03:24 UTC. Last push 2025-08-06.
Secrets Patterns DB: The largest open-source Database for detecting secrets, API keys, passwords, tokens, and more.
What you can do
- Over 1600 regular expressions for detecting secrets, passwords, API keys, tokens, and more.
- Format agnostic. A Single format that supports secret detection tools, including Trufflehog and Gitleaks.
- Tested and reviewed Regular expressions.
- Categorized by confidence levels of each pattern.
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original🗄️ Secrets Patterns Database 🗄️
The largest open-source database for detecting secrets, API keys, passwords, tokens, and more. Use secrets-patterns-db to feed your secret scanning engine with regex patterns for identifying secrets.
🚀 Features
- Over 1600 regular expressions for detecting secrets, passwords, API keys, tokens, and more.
- Format agnostic. A Single format that supports secret detection tools, including Trufflehog and Gitleaks.
- Tested and reviewed Regular expressions.
- Categorized by confidence levels of each pattern.
- All regular expressions are tested against ReDos attacks.
❔ Why?
There are limited resources online for Regular Expressions patterns for secrets. TruffleHog offers ~700 as built-in rules. GitLeaks offers ~60 rules. While it's a good start, it's not enough. There's a lot of work that needs to be done for maintenance and keeping up with new secrets patterns.
I have collected and curated Regular Expressions Patterns for Secrets, API Tokens, Keys, and Passwords. I'm open-sourcing the database I built (Secrets-Patterns-DB), and hope that security teams contribute to it!
The Secrets-Patterns-DB contains over 1600 Regular Expressions. I have also written scripts to validate Regexes against ReDoS attacks, and CI jobs to load and validate Regexes, and I also manually cleaned-up invalid ones.
It's in Beta. There’s a lot of room for improvement on the project. I'm looking forward to your Pull Requests and Issues on Github to enhance Secrets-Patterns-DB for everyone.
Are you planning to enhance your secrets detection in your AppSec program? Please take some time to contribute to the project! :pray:
💻 Contribution
Contribution is always welcome! Please feel free to report issues on Github and create Pull Requestss for new features.
📌 Ideas to Start on
Using
For Trufflehog v2
./scripts/convert-rules.py --db ./db/rules-stable.yml --type trufflehogv2
For Trufflehog v3
./scripts/convert-rules.py --db ./db/rules-stable.yml --type trufflehogv3
For Gitleaks
./scripts/convert-rules.py --db ./db/rules-stable.yml --type gitleaks
Optional: --export - Set filename, extension will be added by type (gitleaks = toml, trufflehogV2 = json, trufflehogV3 = yaml)
Would like to contribute to secrets-patterns-db? Here are some ideas that you may start with:
- Support severity
- Categorize patterns by type?
- Categorize patterns by tags?
- Support more tools?
📄 License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Trufflehog data is licensed under the AGPL.
💚 Author
Mazin Ahmed
- Website: https://mazinahmed.net
- Email:
mazin [at] mazinahmed [dot] net - Twitter: https://twitter.com/mazen160
- Linkedin: http://linkedin.com/in/infosecmazinahmed
Explore related projects
Asabeneh/30-Days-Of-Python
The 30 Days of Python programming challenge is a step-by-step guide to learn the Python programming language in 30 days. This challenge may take more than 100 days. Follow your own pace. These videos may help too: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,370 starsgrafana/grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
77,763 starsredis/redis
For developers, who are building real-time data-driven applications, Redis is the preferred, fastest, and most feature-rich cache, data structure server, and document and vector query engine.
77,288 starsapache/superset
Apache Superset is a Data Visualization and Data Exploration Platform
75,453 stars