Secrets Management with HashiCorp Vault
Implemented HashiCorp Vault as centralized secrets management solution for Kubernetes workloads. Eliminated all hardcoded secrets, implemented dynamic credential generation for databases, enabled secret rotation, and built comprehensive audit logging reducing security incidents to zero.
DevOps Security SRE
HashiCorp Vault Consul AWS KMS Kubernetes Terraform RDS IAM LDAP TLS Docker Python
The Problem
Our secrets management was a security disaster waiting to happen. We found hardcoded API keys in 35+ repositories, database passwords stored in environment variables visible in CI/CD logs, and production credentials shared via Slack and email. Secrets were manually rotated once per year (if remembered), and we had no audit trail of who accessed what secrets when. Each application stored secrets differently: some in .env files, others in AWS Parameter Store, and some in plaintext Kubernetes ConfigMaps. When a developer left the company, we had no systematic way to rotate all secrets they had access to. A security audit identified this as our highest risk area, threatening SOC 2 compliance. Our RDS database password had been unchanged for 3 years and was known to 20+ people. The manual secret distribution process took 2-3 hours for onboarding new services.
The Solution
**Vault Architecture & Deployment**: Deployed HashiCorp Vault in high-availability mode across three AWS availability zones with auto-unseal using AWS KMS for disaster recovery. Configured Consul as the storage backend for consistency and durability. Implemented TLS encryption for all Vault communication and mutual TLS authentication. Set up automated Vault backups to S3 with 30-day retention.
**Secret Engines Configuration**: Enabled database secrets engine for dynamic credential generation for RDS, rotating credentials automatically every 24 hours. Configured AWS secrets engine providing temporary IAM credentials with TTLs eliminating long-lived access keys. Set up PKI secrets engine for automated TLS certificate issuance and rotation. Enabled key-value v2 engine with versioning for application secrets and automatic encryption.
**Authentication & Authorization**: Integrated Vault with multiple auth methods: AWS IAM for EC2/ECS workloads, Kubernetes service accounts for pod authentication, and LDAP for human access. Implemented granular policies using path-based ACLs ensuring principle of least privilege. Configured MFA for all administrative operations.
**Application Integration**: Developed Vault agent sidecar containers for automatic secret injection into Kubernetes pods. Created Terraform provider integration for infrastructure-as-code secret management. Built CI/CD pipeline integration retrieving secrets dynamically rather than storing in variables. Implemented Vault encryption-as-a-service for PII data encryption in application databases.
**Secret Engines Configuration**: Enabled database secrets engine for dynamic credential generation for RDS, rotating credentials automatically every 24 hours. Configured AWS secrets engine providing temporary IAM credentials with TTLs eliminating long-lived access keys. Set up PKI secrets engine for automated TLS certificate issuance and rotation. Enabled key-value v2 engine with versioning for application secrets and automatic encryption.
**Authentication & Authorization**: Integrated Vault with multiple auth methods: AWS IAM for EC2/ECS workloads, Kubernetes service accounts for pod authentication, and LDAP for human access. Implemented granular policies using path-based ACLs ensuring principle of least privilege. Configured MFA for all administrative operations.
**Application Integration**: Developed Vault agent sidecar containers for automatic secret injection into Kubernetes pods. Created Terraform provider integration for infrastructure-as-code secret management. Built CI/CD pipeline integration retrieving secrets dynamically rather than storing in variables. Implemented Vault encryption-as-a-service for PII data encryption in application databases.
Key Highlights
- Centralized management of 500+ secrets across 50+ applications
- Implemented automatic secret rotation every 24 hours for databases
- Eliminated 100% of hardcoded secrets from source code repositories
- Achieved complete audit trail with 13-month retention for compliance
- Reduced secret provisioning time from 2-3 hours to 5 minutes
- Configured automated secret revocation when employees leave
- Enabled dynamic credential generation reducing long-lived credentials by 95%
- Passed SOC 2 audit with perfect score on secrets management
- Implemented zero-knowledge architecture where operators cannot view secrets
- Configured automatic encryption of 15M+ database records containing PII
- Built self-service secret management portal for development teams
- Reduced security incidents related to credential exposure from 8/year to 0
Project Screenshots
Interested in Similar Work?
Let's discuss how I can help with your project.