Skip to main content

Production-grade secrets verifier for bot platforms

Project description

vault-check logo

PyPI version Python Wheel Release

Build status Codecov Test Coverage Code style: black Ruff Security

Downloads PyPI Downloads OS Python Versions

License: MIT

vault-check 🔒

Production-grade secrets verifier and health check utility. Ensures your environment variables, API keys, and credentials are valid, secure, and ready for production.


🚀 Quick Start

Prerequisites

  • Python 3.11+
  • pip

Installation

One command to rule them all:

pip install vault-check

For the full suite (AWS, Databases, Security):

pip install "vault-check[db,aws,security]"

Usage Example

Run a quick dry-run check to validate formats and entropy without live network probes:

vault-check --dry-run

Or run the full suite with a dashboard:

vault-check --dashboard --dashboard-port 8080 --output-json ./reports/latest.json

✨ Key Features

  • Multi-Source Loading: Seamlessly fetch secrets from .env, Doppler, AWS SSM, or HashiCorp Vault.
  • Comprehensive Verifiers: Out-of-the-box checks for Database URLs, Redis, JWT secrets, Telegram Bots, Razorpay, Google OAuth, and more.
  • God Level Security Checks:
    • Entropy Analysis: Uses zxcvbn to ensure your keys aren't weak (e.g., "password123").
    • Live Probes: Actually connects to DBs and APIs (e.g., SELECT 1, /getMe) to verify credentials work.
  • Web Dashboard: Visualize your reports with a built-in web interface.
  • CI/CD Ready: JSON outputs, exit codes, and email alerts make it perfect for pipelines.

⚙️ Configuration & Advanced Usage

Environment Variables

Vault Check looks for a .env file by default (or fetching from Doppler/AWS). The verifier suite automatically detects and validates the following secret keys if they are present:

Key Verifier Notes
*_DB_URL DatabaseVerifier Validates Postgres/SQLite connection strings.
*_REDIS_URL RedisVerifier Checks Redis connection and PING command.
SESSION_ENCRYPTION_KEY SessionKeyVerifier God Level: Fernet key with zxcvbn entropy check (score >= 3).
JWT_SECRET JWTSecretVerifier Checks for a high-entropy secret (>= 32 chars).
JWT_EXPIRATION_MINUTES JWTExpirationVerifier Ensures the expiration time is a valid integer.
API_ID / API_HASH TelegramAPIVerifier Validates Telegram MTProto API credentials.
*_BOT_TOKEN TelegramBotVerifier God Level: Performs a live /getMe probe to the Telegram Bot API.
OWNER_TELEGRAM_ID / ADMIN_USER_IDS TelegramIDVerifier Checks for valid Telegram user/chat IDs.
ACCOUNTS_API_KEY AccountsAPIVerifier Validates the Accounts API key format.
BASE_WEBHOOK_URL WebhookVerifier Ensures the URL is valid and reachable.
RAZORPAY_KEY_ID RazorpayVerifier Verifies Razorpay credentials via a live API call.
GOOGLE_CLIENT_ID GoogleOAuthVerifier Checks the structure of Google OAuth credentials.

CLI Arguments

Argument Type Default Description
--env-file string .env Path to the environment file.
--doppler-project string bot-platform Doppler Project Name.
--doppler-config string dev_bot-platform Doppler Config Name.
--aws-ssm-prefix string None AWS SSM parameter prefix to load secrets from.
--vault-addr env var None HashiCorp Vault Address (via VAULT_ADDR).
--vault-token env var None HashiCorp Vault Token (via VAULT_TOKEN).
--log-level choice INFO Logging level (DEBUG, INFO, WARNING, ERROR).
--log-format choice text Log format (text, json).
--color bool False Enable colorized output.
--concurrency int 5 Number of concurrent verifiers.
--http-timeout float 12.0 Timeout for HTTP requests (seconds).
--db-timeout float 10.0 Timeout for Database connections (seconds).
--overall-timeout float 60.0 Global execution timeout (seconds).
--retries int 3 Number of retries for failed checks.
--dry-run bool False Validate formats only; skip network calls.
--skip-live bool False Fetch secrets but skip live connectivity probes.
--output-json string None Path to save the report as JSON.
--email-alert list None Send email alert on failure (SMTP_SERVER FROM TO PASS).
--verifiers list None Space-separated list of specific verifiers to run.
--dashboard bool False Start the web dashboard for viewing reports.
--dashboard-port int 8000 Port for the dashboard.
--reports-dir string . Directory to serve reports from.
--version bool False Show version and exit.
project_path string None Optional path to project directory.

🏗️ Architecture

The project follows a modular, asynchronous architecture designed for speed and extensibility.

src/vault_check/
├── cli.py          # Entry point & Argument Parsing
├── runner.py       # Core Async Engine & Verifier Orchestration
├── secrets.py      # Secret Fetching (Env, Doppler, AWS)
├── dashboard.py    # Web Dashboard Application (aiohttp)
├── verifiers/      # Plugin-based Verification Modules
│   ├── base.py     # Base Class for all Verifiers
│   ├── database.py # DB Connection Checks
│   ├── s3.py       # AWS S3 Checks
│   └── ...
└── ...

Logic Flow:

  1. CLI parses arguments and initializes configuration.
  2. Secrets Loader aggregates variables from .env, Doppler, or AWS.
  3. Runner identifies relevant verifiers based on available keys.
  4. Verifiers execute concurrently (asyncio), performing syntax checks (dry-run) or live probes.
  5. Output is rendered to console (Rich), JSON file, or the Web Dashboard.

🗺️ Roadmap

  • Core Verification Engine (Async, Retries, Timeouts)
  • Multi-Source Secrets (Dotenv, Doppler, AWS SSM)
  • Web Dashboard (View JSON reports in browser)
  • God Level Verifiers (Telegram Bot, Database, Redis, JWT, S3, SMTP)
  • Plugin System (Load external verifiers dynamically) - Partially implemented
  • Kubernetes Operator (Continuous in-cluster monitoring)

🤝 Contributing & License

We welcome contributions! Please see CONTRIBUTING.md (if available) or standard GitHub flow.

  1. Fork the repository.
  2. Create a feature branch.
  3. Commit your changes.
  4. Push to the branch.
  5. Open a Pull Request.

License: MIT

Project details


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-6.0.0.tar.gz (34.3 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-6.0.0-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vault_check-6.0.0.tar.gz
  • Upload date:
  • Size: 34.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vault_check-6.0.0.tar.gz
Algorithm Hash digest
SHA256 fa715470602e11c3e0c9b590e186d24fee49cf1034ad3c48b5b9ba8018299968
MD5 95614eedbd880e5275b16c6b06667b13
BLAKE2b-256 3066cfa28ce9ee8a4d6a1f75fab6b0175c7252a614ecfd2ff3d633fe3f0896bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for vault_check-6.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-6.0.0-py3-none-any.whl.

File metadata

  • Download URL: vault_check-6.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vault_check-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd84c4a49ea6b2cf818b4d51372845f9fefb747dd32ca74c336aa17d837d965a
MD5 b421bb0dfc3b2fbd64559215b85b9aad
BLAKE2b-256 4ac3c76e90193b83056480efa8d78393f28effb3b1946a7e5b3d25ecd452e8fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for vault_check-6.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.

Supported by

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