๐ก๏ธ KeySentry
May 29, 2026 ยท View on GitHub
๐ KeySentry: Find leaked API keys & secrets in any GitHub repo or local project. No mercy.
A powerful, no-nonsense tool to detect unsecured API keys, tokens, and sensitive files โ either via command-line scan or a beautifully built frontend web scanner.
๐ Features
- ๐ Scans for 25+ common API key formats (AWS, Slack, Stripe, OpenAI, etc.)
- ๐ง Regex + entropy-inspired patterns for high accuracy
- ๐๏ธ Flags sensitive files like
.env,id_rsa,firebase.json, etc. - ๐พ Outputs structured results to JSON
- ๐งฉ Supports both GitHub repo URLs and local folder paths
- ๐ป No GitHub API tokens needed
- โก Styled terminal banner and colorful terminal logs
- ๐ Frontend scanner hosted on Netlify for ease of use
๐ Latest Update
๐ก๏ธ YARA Detection Rule Added
KeySentry now includes KeySentry.yar, a YARA rule designed to detect exposed API keys, authentication tokens, cloud credentials, private keys, and sensitive configuration files commonly found in source code repositories.
The rule currently supports detection of secrets associated with:
- AWS, Google Cloud, Slack, Stripe, OpenAI
- GitHub, Twilio, SendGrid, DigitalOcean
- Firebase, Cloudflare, Heroku, Mailgun
- Azure Storage, Dropbox, Notion
- Terraform Cloud, CircleCI, Facebook and more
It also identifies commonly leaked sensitive files such as:
.env,.env.local,.env.productioncredentials.json,firebase.json.aws/credentials,.npmrcid_rsa,id_rsa.pub,.pypirc
This addition enables defenders, threat hunters, malware analysts, and security researchers to leverage KeySentry's detection logic directly through YARA-based workflows.
๐ Live Frontend
We now have a frontend interface (located in project/ folder) for easier scanning.
Paste a GitHub repo URL and instantly view results in your browser.
๐ณ Docker Support
You can build and run the CLI version via Docker.
๐ Dockerfile Provided
A ready-to-use Dockerfile is included.
๐ค DockerHub Image
โก๏ธ https://hub.docker.com/r/adityabhatt3010/keysentry
๐ฆ Installation
๐ง Local Installation
git clone https://github.com/AdityaBhatt3010/KeySentry.git
cd KeySentry
pip install -r requirements.txt
๐ณ Pull from DockerHub
docker pull adityabhatt3010/keysentry
๐งช Usage
๐ Scan a GitHub repository:
python KeySentry.py --repo https://github.com/username/repo-name --output results.json
๐ป Scan a local directory:
python KeySentry.py --local /path/to/codebase --output results_local.json
โถ๏ธ Using Docker:
docker run --rm adityabhatt3010/keysentry --repo https://github.com/username/repo-name --output results.json
๐ธ Screenshots
๐ Web Interface Scanner
๐งช CLI Scaner
โ๏ธ Docker Build & Run
๐ Sample Output
[
{
"file": "/tmp/tmpabcd1234/app/settings.py",
"type": "AWS",
"match": "AKIAIOSFODNN7EXAMPLE"
},
{
"file": "/tmp/tmpabcd1234/.env",
"type": "Sensitive File",
"match": ".env"
}
]
๐ What It Detects
API Keys:
- AWS, Google, Slack, Stripe, OpenAI, SendGrid, Twilio
- GitHub, DigitalOcean, Heroku, Mailgun, Firebase
- Cloudflare, JWT, Facebook, Dropbox, Azure
- Netlify, Notion, Terraform, CircleCI, BasicAuth
- RSA Private Keys, Base64 blobs, and more
Sensitive Files:
.env,.env.local,.aws/credentials,.dockercfgcredentials.json,firebase.json,id_rsa,.pypirc, etc.
๐ง Future Roadmap
- โ Full local & GitHub scanning
- โ Structured JSON reporting
- โ Docker support
- ๐ Live token validation (OpenAI/AWS, etc.)
- ๐ GitHub username/org-wide scan
- ๐ FastAPI dashboard w/ SQLite visualization
- ๐ Discord/Telegram alert integrations
๐จโ๐ป Crafted By
Made with โค๏ธ by Aditya Bhatt โ Cybersecurity & VAPT Specialist.
โ ๏ธ Disclaimer
For educational & auditing use only. Do not use this tool on repositories you don't own or lack permission to scan.