Production-grade secrets verifier for bot platforms
Project description
⚡ Quick Start
Prerequisites
- Python 3.11+
pip- Docker (optional, for running tests)
Installation
Install the core package:
pip install .
For full feature support (AWS, Database, Security checks):
pip install ".[db,aws,security]"
Run
Run the verifier against your local .env file:
vault-check --env-file .env
Demo
Copy-paste this snippet to see vault-check in action with a dummy configuration:
# Create a dummy .env file
echo "DATABASE_URL=postgres://user:pass@localhost:5432/db" > .env
echo "JWT_SECRET=supersecretpassword123" >> .env
# Run a dry-run check (validates format and entropy only)
vault-check --dry-run
✨ Features
🛡️ Security & Core
- Entropy Analysis: Automatically detects weak secrets using
zxcvbn(e.g., warns on "password123"). - Live Probes: Performs actual network connections (e.g.,
SELECT 1for DBs,/getMefor Telegram Bots) to verify credentials. - Async & Concurrent: Built on
asyncioandaiohttpfor high-performance parallel verification.
🔌 Integrations
- Multi-Source Loading: Fetch secrets from
.env, Doppler, AWS SSM, or HashiCorp Vault. - Broad Protocol Support: Verifiers for PostgreSQL, Redis, Telegram API, Google OAuth, Razorpay, and more.
📊 Observability
- Web Dashboard: Built-in dashboard to visualize verification reports and trigger runs.
- Actionable Reports: JSON output and detailed logging for CI/CD pipelines.
🛠️ Configuration
Environment Variables
vault-check automatically detects and verifies these keys in your environment:
| Variable Name | Description | Required |
|---|---|---|
*_DB_URL |
Database connection string (Postgres/SQLite). | No |
*_REDIS_URL |
Redis connection URL. | No |
SESSION_ENCRYPTION_KEY |
Fernet encryption key (checked for entropy). | No |
JWT_SECRET |
JWT signing secret (checked for entropy). | No |
JWT_EXPIRATION_MINUTES |
JWT expiration time (integer). | No |
API_ID / API_HASH |
Telegram Client API credentials. | No |
*_BOT_TOKEN |
Telegram Bot Token (checked via live API call). | No |
OWNER_TELEGRAM_ID |
Telegram User ID of the bot owner. | No |
ACCOUNTS_API_KEY |
Key for internal Accounts API. | No |
RAZORPAY_KEY_ID |
Razorpay public key. | No |
GOOGLE_CLIENT_ID |
Google OAuth client ID. | No |
CLI Arguments
| Flag | Description | Default |
|---|---|---|
--env-file |
Path to the .env file. |
.env |
--doppler-project |
Doppler project name. | bot-platform |
--aws-ssm-prefix |
Prefix for AWS SSM parameters. | None |
--log-level |
Logging verbosity (DEBUG, INFO, WARNING, ERROR). | INFO |
--concurrency |
Number of concurrent verifier tasks. | 5 |
--dry-run |
Validate formats/entropy without network calls. | False |
--dashboard |
Launch the web dashboard. | False |
--dashboard-port |
Port for the web dashboard. | 8000 |
--output-json |
Path to save the verification report as JSON. | None |
🏗️ Architecture
Directory Tree
src/vault_check/
├── cli.py # Entry point, argument parsing
├── runner.py # Orchestrates async verification tasks
├── secrets.py # Loads secrets from Env, Doppler, AWS
├── registry.py # Manages discovery of verifier plugins
├── dashboard.py # Web server for the dashboard UI
├── verifiers/ # Individual verification logic
│ ├── database.py # DB connection checks
│ ├── http_check.py # Generic HTTP checks
│ └── ...
└── config.py # Configuration constants and schemas
Data Flow
- Input: The user invokes the CLI, specifying secret sources (local file, Doppler, AWS).
- Load:
secrets.pyaggregates secrets into a unified dictionary. - Discover:
runner.pyinspects the secrets and matches them against registered verifiers inregistry.py. - Execute: The
ExecutionEngineruns matched verifiers concurrently. Each verifier performs syntax checks (dry-run) or live probes. - Report: Results (errors, warnings, suggestions) are collected and output to the console, a JSON file, or the Dashboard.
🐞 Troubleshooting
| Error Message | Possible Solution |
|---|---|
Connection refused |
Ensure the service (DB, Redis) is running and reachable from the host. |
Authentication failed |
Check that the username/password in the secret is correct. |
Entropy too low |
The secret is too weak (e.g. "123456"). Generate a stronger key. |
ModuleNotFoundError |
Ensure you installed optional dependencies (pip install ".[db]"). |
Debug Mode
To see detailed logs of what vault-check is doing (including HTTP requests and secret loading details), use the --log-level flag:
vault-check --log-level DEBUG
🤝 Contributing
We welcome contributions!
Dev Setup
-
Clone the repository:
git clone https://github.com/dhruv13x/vault-check.git cd vault-check
-
Install development dependencies:
pip install -e ".[dev,db,aws,security]"
-
Run the tests to ensure everything is working:
pytest
-
Install pre-commit hooks to enforce code quality:
pre-commit install
Please follow standard GitHub Pull Request workflows.
🗺️ Roadmap
- Plugin System: Fully documented guide for creating 3rd-party verifiers.
- GitHub Action: Official action for CI/CD integration.
- Pre-commit Hook: Native pre-commit hook support.
- Automated Rotation: Integration to rotate weak secrets automatically.
- AI Anomaly Detection: Analyze secret usage patterns for security risks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vault_check-7.0.0.tar.gz.
File metadata
- Download URL: vault_check-7.0.0.tar.gz
- Upload date:
- Size: 33.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b44c19389b39c89bc682958b1191d2b0ded00f4033bb1dad50f755683dd14c1c
|
|
| MD5 |
548860a15daa2f99f51dec345cdbcb66
|
|
| BLAKE2b-256 |
695d63ab57df1e91d4414b289f75045e48241a8e8ca5860da1dd203fe288151b
|
Provenance
The following attestation bundles were made for vault_check-7.0.0.tar.gz:
Publisher:
publish.yml on dhruv13x/vault-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vault_check-7.0.0.tar.gz -
Subject digest:
b44c19389b39c89bc682958b1191d2b0ded00f4033bb1dad50f755683dd14c1c - Sigstore transparency entry: 772539214
- Sigstore integration time:
-
Permalink:
dhruv13x/vault-check@4e602ac51d0070208d4883bc1cb87a946e6e8b28 -
Branch / Tag:
refs/tags/v7.0.0 - Owner: https://github.com/dhruv13x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4e602ac51d0070208d4883bc1cb87a946e6e8b28 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vault_check-7.0.0-py3-none-any.whl.
File metadata
- Download URL: vault_check-7.0.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c215f8e4f8bab6a3df25e4e95d9fe42995053f7357481395f24173358806f5c9
|
|
| MD5 |
5050767aac4fdf38eaf2461b08453fcd
|
|
| BLAKE2b-256 |
a966d445f5cddb9f3f2b764552bc75d12c2db33ddd41a5995b7b40bcc171e568
|
Provenance
The following attestation bundles were made for vault_check-7.0.0-py3-none-any.whl:
Publisher:
publish.yml on dhruv13x/vault-check
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vault_check-7.0.0-py3-none-any.whl -
Subject digest:
c215f8e4f8bab6a3df25e4e95d9fe42995053f7357481395f24173358806f5c9 - Sigstore transparency entry: 772539225
- Sigstore integration time:
-
Permalink:
dhruv13x/vault-check@4e602ac51d0070208d4883bc1cb87a946e6e8b28 -
Branch / Tag:
refs/tags/v7.0.0 - Owner: https://github.com/dhruv13x
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4e602ac51d0070208d4883bc1cb87a946e6e8b28 -
Trigger Event:
push
-
Statement type: