vault-broker-core is an enterprise-grade, cloud-agnostic secret orchestration and ephemeral credential brokering engine written in Go. It eliminates standing privileges and hardcoded static secrets across multi-cloud environments by minting short-lived, tightly-scoped access tokens on-demand, strictly linked to cryptographic workload identities (SPIFFE IDs).
[ Workload / Microservice ]
│
(1) Present Cryptographic Identity (SPIFFE ID)
▼
┌───────────────────────────┐
│ vault-broker-core │
│ │
│ ✦ AES-256-GCM Envelope │
│ ✦ Shamir Secret Sharing │
│ ✦ Dynamic Lease Engine │
│ ✦ Auto-Rotation Daemon │
└─────────────┬─────────────┘
│
┌────────────────────────────┼────────────────────────────┐
▼ ▼ ▼
[ AWS IAM STS ] [ GCP IAM Service ] [ Relational DBs ]
(Temporary Session) (Short-lived OAuth2) (Dynamic Roles/Users)
- AES-256-GCM Authenticated Encryption: Plaintext secrets are encrypted with a single-use ephemeral Data Encryption Key (DEK).
- HKDF Key Derivation: Sub-keys for wrapping DEKs are deterministically derived via HMAC-based Extract-and-Expand Key Derivation (
RFC 5869). - Additional Authenticated Data (AAD): Context-bound tamper-proofing guaranteeing payload integrity.
-
$(k, n)$ Threshold Splitting over$\mathbb{GF}(p)$ : Splits 256-bit root master keys into$n$ separate cryptographic shares. - Reconstructable only when at least
$k$ threshold shares are presented using polynomial Lagrange interpolation over large prime Galois fields ($2^{256} - 189$ ).
- Deterministic TTL Enforcement: Every minted credential receives a strict Time-To-Live (TTL) with maximum bounded renewal caps.
- Background Active Reaper: Concurrently inspects expired credentials and triggers provider-level revocation callbacks.
- Graceful Cleanups: Automatically drops dynamic database users and revokes cloud STS sessions upon expiration or explicit deletion.
- Zero-downtime automated credential rotation prior to expiration window thresholds.
- Non-blocking concurrent dispatching with deduplication to prevent double-rotation race conditions.
- AWS IAM: Dynamic STS AssumeRole with Web Identity session broker.
- GCP Service Account: Ephemeral OAuth2 access token generator with custom permission scoping.
- Database (PostgreSQL / MySQL): Auto-provisioning of ephemeral database users with custom roles and auto-drop triggers.
vault-broker-core/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions automated test & verification suite
├── pkg/
│ ├── vault/
│ │ ├── envelope.go # AES-256-GCM envelope encryption & HKDF key derivation
│ │ └── shamir.go # Shamir Secret Sharing (k, n) polynomial scheme over GF(p)
│ ├── lease/
│ │ ├── manager.go # Dynamic lease lifecycle engine & automatic reaper
│ │ └── rotator.go # Zero-downtime auto-rotation background daemon
│ └── provider/
│ ├── provider.go # Common dynamic credential interfaces & request types
│ ├── aws.go # AWS IAM STS ephemeral session broker
│ ├── gcp.go # Google Cloud Service Account OAuth2 token broker
│ └── database.go # Ephemeral PostgreSQL / MySQL dynamic user manager
├── tests/
│ ├── envelope_test.go # Envelope encryption & Shamir split/combine unit tests
│ └── lease_test.go # Lease lifecycle, expiration, auto-rotation & provider tests
├── go.mod # Go module definitions & dependencies
└── README.md # Architecture documentation & animated visual manual
- Go 1.22 or higher
Execute the comprehensive automated test suite with race detection and code coverage:
# Run all unit and integration tests
go test -v -race -cover ./...- No static secrets stored at rest in plaintext.
- High-entropy cryptographically secure pseudorandom number generators (
crypto/rand). - Ephemeral credentials default to the principle of least privilege (PoLP).
Authored by koushik4475 for ER-brocode
Engineered for zero-trust cloud-native infrastructures.