🔐 HashiCorp Vault + MERN Architecture

Enterprise Zero-Trust Authentication & Dynamic Sidecar Secret Injection on AWS EKS

Enterprise Zero-Trust Architecture Diagram Live EKS VPC Data Plane

Every tier in this architecture eliminates static secrets. Mutual trust is established across three security zones: Ingress, the Amazon EKS cluster mesh, and dedicated HashiCorp Vault security services.

EDGE INGRESS ZONE Client Browser HTTPS / TLS 1.3 AWS NLB / Ingress Port 80 / 443 TLS Terminated via PKI AMAZON EKS CLUSTER (mern-vault namespace) mern-frontend Pod React 19 Dashboard Reverse Proxy /api :3000 mern-backend Pod Express Backend (:3001) Reads In-Memory Secrets 📁 /vault/secrets/config.json Vault Agent Sidecar K8s SA JWT Auth Auto-Renews Lease (1h) mongodb StatefulSet MongoDB Engine (:27017) Ephemeral Users Only v-token-* (Auto-Dropped) EBS Storage Volume Encrypted at Rest (KMS) Zero Passwords on Disk HASHICORP VAULT ZERO-TRUST CORE auth/kubernetes/mern-vault Validates SA JWT via EKS OIDC JWKS Binds: SA="mern-backend" → Policy database/ (Dynamic Secrets Engine) Role: mern-app-role (readWrite) Role: mern-analytics-role (readOnly) Runs: db.createUser() / db.dropUser() pki/ (Automated X.509 & ACME CA) Role: mern-vault-dot-io (Root CA) On-Demand Ephemeral Private Keys Short-Lived (24h) Zero-Outage Renewal

1. Zero Secrets in Git or Environment Variables

No AWS IAM keys, Vault root tokens, or DB passwords are hardcoded in Kubernetes manifests or containers.

2. Cryptographic ServiceAccount Identity

Kubelet projects an RFC 7519 JWT into the pod; Vault validates its signature against the Amazon EKS OIDC provider.

3. Dynamic Ephemeral Database Leases

MongoDB users are generated with 1-hour TTLs on-demand and automatically dropped upon revocation or pod termination.

4. Automated PKI & Microsegmentation

Certificates are signed on-the-fly by Vault's PKI engine, establishing verified TLS without manual cert rotation.

Live Cluster Telemetry & Active Lease Metadata

Loading live telemetry from backend...

Vault Dynamic Database Secrets Engine Zero Static Credentials & Auto-Revocation

Eliminate static database passwords permanently. With the Vault Database Secrets Engine mounted at database/, Vault dynamically creates short-lived, individual MongoDB database users on-the-fly and automatically drops them when leases expire.

1. On-Demand User Generation

When an application or pod requests credentials, Vault connects to MongoDB and executes db.createUser({ user: "v-token-...", roles: ["readWrite"] }).

2. Ephemeral Lease Lifecycles

Credentials are leased for 1 hour (3600s). Vault Agent continually renews the lease while the pod is healthy.

3. Automated User Revocation

When a pod terminates or a lease expires without renewal, Vault immediately executes db.dropUser() in MongoDB.

4. Granular Least-Privilege Roles

Different application tiers request different roles (e.g. mern-app-role for readWrite, mern-analytics-role for readOnly).

⚡ Live Dynamic MongoDB User Generation Console

Select an authorized Vault database role to generate an on-demand ephemeral MongoDB database user:

Zero-Trust Identity Handshake (Kubernetes ServiceAccount → Vault Auth) RFC 7519 / OIDC Trust

Traditional setups force developers to store long-lived cloud credentials or static tokens in Kubernetes secrets. With Vault's Zero-Trust Kubernetes Auth Method, the pod's identity is established dynamically through short-lived cryptographic tokens without a single static secret stored anywhere.

1. Kubelet Token Projection

When the pod boots, Kubelet mounts an RFC 7519 ServiceAccount JWT at /var/run/secrets/kubernetes.io/serviceaccount/token signed by EKS OIDC.

2. Cryptographic TokenReview

Vault receives the JWT and verifies its RS256 signature against the Amazon EKS cluster's public JWKS endpoint (no shared secrets needed).

3. Strict Metadata & Namespace Binding

Vault enforces that the request originated from the authorized namespace (mern-vault) and service account (mern-backend).

4. Least-Privilege Ephemeral Token

Vault returns an in-memory client token bound strictly to required ACL policies (mern-vault-database-read, pki-issue-mern-vault).

⚡ Live Cryptographic Auth Handshake Simulation

Trigger a live token projection & OIDC signature verification cycle to inspect the underlying JWT claims, role binding, and execution trace:

Vault Agent Sidecar & Consul Template Engine (Zero Code Refactor) In-Memory emptyDir / Zero SDK

Developers never need to import HashiCorp Vault SDKs or rewrite backend application logic. The Vault Agent Mutating Webhook injects a lightweight sidecar that renders secrets directly into in-memory files in whichever format your application expects.

1. Zero SDK Overhead in App Code

Applications read local files like fs.readFileSync('/vault/secrets/config.json') or native environment files without Vault SDK imports.

2. In-Memory Security Isolation

Secrets exist strictly in RAM on an emptyDir { medium: "Memory" } volume. Zero credentials touch the host worker node disk.

3. Dynamic Format Transformation

Consul Template allows transforming any Vault secret into JSON, .env files, YAML, or Java Spring Boot property files.

4. Automatic File Watcher & SIGHUP

When Vault rotates a database secret or renews a lease, Vault Agent overwrites the file and can trigger graceful application reloads.

⚡ Live In-Memory Template Transformer Playground

Select an output format to see how the Vault Agent Consul Template transforms dynamic database credentials into native configuration files:

HashiCorp Vault PKI Secrets Engine & End-to-End mTLS Zero-Trust Encryption Mutual TLS & ACME / Let's Encrypt

Instead of manual certificate provisioning or static private keys sitting in Kubernetes secrets, HashiCorp Vault operates as a high-velocity, automated Certificate Authority. Workloads dynamically request short-lived certificates signed by Vault Root & Let's Encrypt intermediates with automated rotation and mutual TLS enforcement.

1. Vault Root CA & ACME Role

Mount path pki/ configured with 10-year root key and dynamic issue role mern-vault-dot-io supporting ACME DNS-01/HTTP-01 validation.

2. Ephemeral Private Keys

Private keys are generated on demand inside memory and never written to Git, ConfigMaps, or long-term disk.

3. Zero-Outage Auto-Renewal

Short lease TTLs (24h) eliminate stale certificates; Cert-Manager / Vault Agent renews before expiry.

4. End-to-End mTLS Encryption

Service-to-service communication across EKS pods (Frontend ↔ Backend ↔ MongoDB) is cryptographically authenticated via TLS 1.3.

🔒 Live In-Cluster Mutual TLS (mTLS) Handshake Verifier

Test the cryptographic peer-to-peer mTLS handshake between the React Frontend and Express Backend using dynamic certificates issued by Vault PKI:

🌐 Frontend Ingress Security Switcher & Custom Vanity Domain
Port 443 (HTTPS / Let's Encrypt)

Switch between standard Port 80 (HTTP) and secured Port 443 (HTTPS) with an automated Let's Encrypt / Vault PKI signed certificate attached to your custom vanity FQDN:

Ingress Security Mode:
Current Public Endpoint:
https://mern-vault.christian-renaud.sbx.hashidemos.io
Certificate Authority: HashiCorp Vault ACME / Let's Encrypt Intermediate (Valid TLS 1.3)
⚡ Live On-Demand Certificate Signing Console

Generate and sign an X.509 TLS certificate dynamically through Vault's PKI engine:

Verified Data Plane & End-to-End Execution Trace Live MongoDB Transaction Pipeline

Demonstrate the complete live MERN application loop. Each transaction proves that the Express backend is dynamically resolving in-memory Vault credentials, authenticating to MongoDB under a short-lived ephemeral user (v-token-*), and persisting KMS-encrypted state at rest without any static password ever touching disk.

1. In-Memory Decoupling

Backend reads credentials directly from RAM via /vault/secrets/config.json with sub-millisecond local latency.

2. Dynamic Identity Attribution

Every transaction is cryptographically signed and executed under a short-lived temporary database user lease.

3. Mutual TLS Transport

Network communication across EKS pods is encrypted via TLS 1.3 using dynamic certificates issued by Vault PKI.

4. AWS KMS Volume Encryption

MongoDB storage is backed by an EBS volume encrypted at rest via AWS KMS customer-managed keys.

⚡ Live Transaction Dispatcher & Pipeline Tracer

Submit a real-time authenticated write to MongoDB to observe the 5-hop resolution pipeline and execution latency:

Live MongoDB Ledger (Persisted State & Lease Tracker)

    Enterprise Threat Model Comparison & CISO Scorecard Zero-Trust vs. Traditional Kubernetes

    Compare the architectural resilience of HashiCorp Vault against traditional static Kubernetes secrets across real-world attack vectors, breach containment scenarios, and compliance controls.

    Traditional Kubernetes Secrets High Risk (Score: 32/100)
    • Base64 static tokens in plaintext env variables
    • Credentials rarely rotated (avg. 180+ days)
    • Single pod breach exposes entire database cluster
    HashiCorp Vault Zero-Trust Enterprise Hardened (Score: 98/100)
    • Short-lived OIDC ServiceAccount tokens (RFC 7519)
    • Dynamic ephemeral users auto-dropped on lease expiry
    • In-memory RAM volume isolation with full audit logs
    ⚡ Interactive Threat Scenario Simulator

    Select an attack scenario to evaluate containment and blast-radius mitigation:

    Attack Vector / Control Traditional Kubernetes Pattern HashiCorp Vault Zero-Trust Architecture Risk Reduction
    1. Secret Storage & Persistence Base64 encoded plaintext in etcd / environment variables AES-256 encrypted at rest in Vault KV-v2; rendered only to in-memory RAM 95% Risk Drop
    2. Credential Lifecycle Static passwords lasting months or years without rotation Ephemeral dynamic database users generated on-demand with 1h TTL auto-drop Zero Stale Keys
    3. Blast Radius Containment Single pod compromise leaks root credentials for all services Isolated strictly to individual temporary user; auto-revoked upon pod termination Micro-Segmented
    4. Identity Verification Static API tokens or long-lived cloud IAM secret keys EKS OIDC cryptographic JWT handshake with automatic TokenReview Passwordless Trust
    5. Audit Trail & Compliance No audit records when applications read secrets from memory Immutable audit logging for every single secret access linked to pod SA identity 100% Traceable
    6. Transport Security Plaintext in-cluster HTTP or manually managed TLS certificates Automated TLS 1.3 & mTLS certificate lifecycle via Vault PKI / Let's Encrypt CA Automated PKI