Skip to main content
vault-check logo

vault-check

Production-grade secrets verifier for bot platforms.

Build status License: MIT Python Code style: black Ruff Maintenance


⚡ 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 1 for DBs, /getMe for Telegram Bots) to verify credentials.
  • Async & Concurrent: Built on asyncio and aiohttp for 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

  1. Input: The user invokes the CLI, specifying secret sources (local file, Doppler, AWS).
  2. Load: secrets.py aggregates secrets into a unified dictionary.
  3. Discover: runner.py inspects the secrets and matches them against registered verifiers in registry.py.
  4. Execute: The ExecutionEngine runs matched verifiers concurrently. Each verifier performs syntax checks (dry-run) or live probes.
  5. 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

  1. Clone the repository:

    git clone https://github.com/dhruv13x/vault-check.git
    cd vault-check
    
  2. Install development dependencies:

    pip install -e ".[dev,db,aws,security]"
    
  3. Run the tests to ensure everything is working:

    pytest
    
  4. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vault_check-8.0.0.tar.gz (33.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vault_check-8.0.0-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

File details

Details for the file vault_check-8.0.0.tar.gz.

File metadata

  • Download URL: vault_check-8.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.12

File hashes

Hashes for vault_check-8.0.0.tar.gz
Algorithm Hash digest
SHA256 ea500fdaa432d07406819cb176eb2b3464554ee2b2db96afadcf3ea60e0c9d11
MD5 4f7a6e431c6a01b0f50cdb6a99552775
BLAKE2b-256 ac296001ccb52e3de19fedc92010b64118bc6a246c676130b25fa855bafbe203

See more details on using hashes here.

Provenance

The following attestation bundles were made for vault_check-8.0.0.tar.gz:

Publisher: publish.yml on dhruv13x/vault-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vault_check-8.0.0-py3-none-any.whl.

File metadata

  • Download URL: vault_check-8.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.12

File hashes

Hashes for vault_check-8.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b590d1d5b5f7811e7d5e490943861bb31a6dd6e4eb19869e46bac829b87fd8b
MD5 a6bb3501a8b409cd98410d0a2977d1af
BLAKE2b-256 e5c200bcd1ef9b2418bdbe2ae3458bf1fb7713e61506615b59e321d00ed674bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vault_check-8.0.0-py3-none-any.whl:

Publisher: publish.yml on dhruv13x/vault-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

8.0.0 This release

2 files

7.0.0

2 files

6.0.0

2 files

4.2.1

2 files

4.2.0

2 files

4.1.0

2 files

4.0.0

2 files

3.0.5

2 files

3.0.4

2 files

3.0.3

2 files

3.0.2

2 files

2.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page