Zero-trust secrets management SDK
Project description
VaultMesh ๐
Zero-trust Secrets Management & Dynamic Credential Rotation Service for Multi-cloud
VaultMesh is a serverless secrets rotation platform built on AWS Lambda + Step Functions + EventBridge. It automates credential rotation for RDS, Redis, API keys, and JWT signing keys โ with zero standing privileges, full audit trails, and no service downtime during rotation.
Architecture
EventBridge Scheduler (cron)
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Step Functions โ โ AWS Secrets Manager โ
โ Rotation Workflow โโโโโถโ โ
โ โ โ AWSCURRENT โโโ AWSPREVIOUS โ
โ 1. createSecret โ โ AWSPENDING โโโ AWSCURRENT (on finish) โ
โ 2. setSecret โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 3. testSecret โ โ KMS CMK envelope encryption
โ 4. finishSecret โ โผ
โ โ โโโโโโโโโโโโโโโโโโโโโโโ
โ (retry + catch) โ โ Lambda Rotators โ
โโโโโโโโโโโโโโโโโโโโโโโ โ - rds_rotator โ
โ โ - redis_rotator โ
โ on failure โ - api_key_rotator โ
โผ โ - jwt_rotator โ
SQS DLQ โโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
CloudWatch Alarm โ SNS โ PagerDuty
Rotation Handlers
| Secret Type | Handler | Rotation Mechanism |
|---|---|---|
| RDS (MySQL/Postgres) | rds_rotator.py |
ALTER USER via direct DB connection |
| Redis | redis_rotator.py |
CONFIG SET requirepass via Redis client |
| API Keys | api_key_rotator.py |
Provider-specific API (GitHub, Stripe, Twilio) |
| JWT Signing Keys | jwt_rotator.py |
RSA-4096 key pair regeneration, 24h overlap |
All handlers follow the 4-step rotation protocol (createSecret โ setSecret โ testSecret โ finishSecret), ensuring old credentials remain valid until the new ones are verified.
Quick Start
git clone https://github.com/KabirMoulana/vaultmesh
cd vaultmesh
pip install -r requirements.txt
# Run tests (no AWS account needed โ uses moto mocks)
pytest tests/unit/ -v --cov=src
# Deploy to AWS
npm install -g aws-cdk@2
cdk deploy VaultMeshStack-dev --app "python infra/cdk/app.py"
Zero Standing Privileges
Each Lambda execution role is scoped to exact secret ARN prefixes:
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue",
"secretsmanager:PutSecretValue",
"secretsmanager:UpdateSecretVersionStage"
],
"Resource": "arn:aws:secretsmanager:us-east-1:123456789:secret:vaultmesh/*"
}
No wildcard * resource permissions anywhere in the codebase.
CI/CD: CDK Diff on PRs
Every pull request gets an automatic CDK diff posted as a comment, showing exactly what infrastructure will change before merge. No surprises in production.
Threat Model
See docs/threat-model/THREAT_MODEL.md for a complete threat analysis including:
- Attack vectors against the rotation pipeline
- Data classification for managed secrets
- Blast radius analysis per compromise scenario
- Mitigations and compensating controls
This document is intentionally public โ security through transparency.
Project Structure
vaultmesh/
โโโ src/
โ โโโ rotators/ # Lambda handlers (one per secret type)
โ โโโ handlers/ # API Gateway handlers (admin API)
โ โโโ providers/ # Third-party API clients (GitHub, Stripe)
โ โโโ models/ # Pydantic models for secret schemas
โ โโโ utils/ # Crypto utilities, audit logger
โโโ infra/cdk/
โ โโโ app.py # CDK app entrypoint
โ โโโ stacks/ # CDK stacks (one per concern)
โโโ tests/
โ โโโ unit/ # Moto-based unit tests (no real AWS)
โ โโโ integration/ # Tests against real AWS (staging)
โโโ docs/
โโโ adr/ # Architecture Decision Records
โโโ threat-model/ # STRIDE threat model
Architecture Decision Records
- ADR-001: Lambda vs Fargate for rotation jobs
- ADR-002: Step Functions vs EventBridge Pipes
- ADR-003: CDK vs Terraform for serverless
License
MIT
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 vaultmesh_kabir-0.1.0.tar.gz.
File metadata
- Download URL: vaultmesh_kabir-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
872dc041c6ec004dcd218996102a01ffb7fac577fae3db79b959163e937d2dba
|
|
| MD5 |
3c86b6cadb00a0f9f1eb83a56fa3940b
|
|
| BLAKE2b-256 |
911986a126937a7dc11d3c088e93be739bfb7a1def68ebd89f41bc10be81e062
|
File details
Details for the file vaultmesh_kabir-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vaultmesh_kabir-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20b2688687ac45aac8b8af5b2dabfe5f087d33f0cd0512e73245a40074b92a30
|
|
| MD5 |
5eef0b478093c14a98360ab51d0a9e2a
|
|
| BLAKE2b-256 |
9708370653b6b9e046dbb51f71021ec5968f5c04f6a8a816d6885f2f85484220
|