Skip to main content

Production-grade secrets verifier for bot platforms

Project description

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.

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-7.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-7.0.0-py3-none-any.whl (38.7 kB view details)

Uploaded Python 3

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

Hashes for vault_check-7.0.0.tar.gz
Algorithm Hash digest
SHA256 b44c19389b39c89bc682958b1191d2b0ded00f4033bb1dad50f755683dd14c1c
MD5 548860a15daa2f99f51dec345cdbcb66
BLAKE2b-256 695d63ab57df1e91d4414b289f75045e48241a8e8ca5860da1dd203fe288151b

See more details on using hashes here.

Provenance

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

Hashes for vault_check-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c215f8e4f8bab6a3df25e4e95d9fe42995053f7357481395f24173358806f5c9
MD5 5050767aac4fdf38eaf2461b08453fcd
BLAKE2b-256 a966d445f5cddb9f3f2b764552bc75d12c2db33ddd41a5995b7b40bcc171e568

See more details on using hashes here.

Provenance

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