[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73D2HDGM7TDNNKX5TWDEVTG":3,"skill-same:01M73D2HDGM7TDNNKX5TWDEVTG":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M73D2HDGM7TDNNKX5TWDEVTG","implementing-secrets-management-with-vault",null,"This skill covers deploying HashiCorp Vault for centralized secrets management across cloud environments, including dynamic secret generation for databases and cloud providers, transit encryption, PKI certificate management, and Kubernetes integration. It addresses eliminating hardcoded credentials from application code and CI\u002FCD pipelines by implementing short-lived, automatically rotated secrets.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fimplementing-secrets-management-with-vault\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fimplementing-secrets-management-with-vault\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: implementing-secrets-management-with-vault\ndescription: 'This skill covers deploying HashiCorp Vault for centralized secrets\n  management across cloud environments, including dynamic secret generation for databases\n  and cloud providers, transit encryption, PKI certificate management, and Kubernetes\n  integration. It addresses eliminating hardcoded credentials from application code\n  and CI\u002FCD pipelines by implementing short-lived, automatically rotated secrets.\n\n  '\ndomain: cybersecurity\nsubdomain: cloud-security\ntags:\n- hashicorp-vault\n- secrets-management\n- dynamic-secrets\n- credential-rotation\n- zero-trust\nversion: 1.0.0\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.IR-01\n- ID.AM-08\n- GV.SC-06\n- DE.CM-01\nmitre_attack:\n- T1078.004\n- T1530\n- T1537\n- T1580\n- T1003\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n\n# Implementing Secrets Management with Vault\n\n## When to Use\n\n- When applications store database passwords, API keys, or certificates in environment variables or config files\n- When migrating from static long-lived credentials to dynamic short-lived secrets\n- When Kubernetes workloads need secure access to database credentials or cloud provider APIs\n- When compliance requirements mandate centralized credential management with audit logging\n- When CI\u002FCD pipelines contain hardcoded secrets that represent supply chain risk\n\n**Do not use** for AWS-only environments where AWS Secrets Manager suffices without multi-cloud requirements, for application-level encryption logic (though Vault Transit can help), or for identity federation (see managing-cloud-identity-with-okta).\n\n## Prerequisites\n\n- HashiCorp Vault server deployed in HA mode (Consul or Raft storage backend)\n- TLS certificates for Vault listener endpoints\n- Vault Enterprise license for namespaces, Sentinel policies, and replication (optional)\n- Kubernetes cluster with Vault Agent Injector or CSI provider for workload integration\n\n## Workflow\n\n### Step 1: Deploy Vault in High Availability Mode\n\nDeploy Vault using Integrated Storage (Raft) for HA without external dependencies. Configure TLS, audit logging, and auto-unseal using a cloud KMS.\n\n```hcl\n# vault-config.hcl\nstorage \"raft\" {\n  path    = \"\u002Fopt\u002Fvault\u002Fdata\"\n  node_id = \"vault-node-1\"\n\n  retry_join {\n    leader_api_addr = \"https:\u002F\u002Fvault-node-2.internal:8200\"\n  }\n  retry_join {\n    leader_api_addr = \"https:\u002F\u002Fvault-node-3.internal:8200\"\n  }\n}\n\nlistener \"tcp\" {\n  address     = \"0.0.0.0:8200\"\n  tls_cert_file = \"\u002Fopt\u002Fvault\u002Ftls\u002Fvault.crt\"\n  tls_key_file  = \"\u002Fopt\u002Fvault\u002Ftls\u002Fvault.key\"\n}\n\nseal \"awskms\" {\n  region     = \"us-east-1\"\n  kms_key_id = \"alias\u002Fvault-unseal-key\"\n}\n\napi_addr      = \"https:\u002F\u002Fvault-node-1.internal:8200\"\ncluster_addr  = \"https:\u002F\u002Fvault-node-1.internal:8201\"\n\ntelemetry {\n  prometheus_retention_time = \"30s\"\n  disable_hostname         = true\n}\n```\n\n```bash\n# Initialize Vault\nvault operator init -key-shares=5 -key-threshold=3\n\n# Enable audit logging\nvault audit enable file file_path=\u002Fvar\u002Flog\u002Fvault\u002Faudit.log\n\n# Enable syslog audit for SIEM integration\nvault audit enable syslog tag=\"vault\" facility=\"AUTH\"\n```\n\n### Step 2: Configure Authentication Methods\n\nEnable authentication backends for human operators, applications, and CI\u002FCD pipelines. Use AppRole for machine authentication and OIDC for human access.\n\n```bash\n# Enable OIDC auth for human users via Okta\nvault auth enable oidc\nvault write auth\u002Foidc\u002Fconfig \\\n  oidc_discovery_url=\"https:\u002F\u002Fcompany.okta.com\u002Foauth2\u002Fdefault\" \\\n  oidc_client_id=\"vault-client-id\" \\\n  oidc_client_secret=\"vault-client-secret\" \\\n  default_role=\"default\"\n\n# Enable AppRole for application authentication\nvault auth enable approle\nvault write auth\u002Fapprole\u002Frole\u002Fweb-app \\\n  secret_id_ttl=10m \\\n  token_num_uses=10 \\\n  token_ttl=20m \\\n  token_max_ttl=30m \\\n  secret_id_num_uses=1 \\\n  token_policies=\"web-app-policy\"\n\n# Enable Kubernetes auth for pod-based access\nvault auth enable kubernetes\nvault write auth\u002Fkubernetes\u002Fconfig \\\n  kubernetes_host=\"https:\u002F\u002Fkubernetes.default.svc:443\" \\\n  token_reviewer_jwt=@\u002Fvar\u002Frun\u002Fsecrets\u002Fkubernetes.io\u002Fserviceaccount\u002Ftoken \\\n  kubernetes_ca_cert=@\u002Fvar\u002Frun\u002Fsecrets\u002Fkubernetes.io\u002Fserviceaccount\u002Fca.crt\n```\n\n### Step 3: Enable Dynamic Secret Engines\n\nConfigure database secret engines to generate short-lived credentials on demand. Each credential set has a TTL and is automatically revoked when it expires.\n\n```bash\n# Enable database secrets engine for PostgreSQL\nvault secrets enable database\nvault write database\u002Fconfig\u002Fproduction-db \\\n  plugin_name=postgresql-database-plugin \\\n  allowed_roles=\"readonly,readwrite\" \\\n  connection_url=\"postgresql:\u002F\u002F{{username}}:{{password}}@db.internal:5432\u002Fproduction?sslmode=require\" \\\n  username=\"vault_admin\" \\\n  password=\"initial-password\"\n\n# Rotate the root credentials so Vault manages them exclusively\nvault write -force database\u002Frotate-root\u002Fproduction-db\n\n# Create a readonly role with 1-hour TTL\nvault write database\u002Froles\u002Freadonly \\\n  db_name=production-db \\\n  creation_statements=\"CREATE ROLE \\\"{{name}}\\\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO \\\"{{name}}\\\";\" \\\n  revocation_statements=\"REVOKE ALL ON ALL TABLES IN SCHEMA public FROM \\\"{{name}}\\\"; DROP ROLE IF EXISTS \\\"{{name}}\\\";\" \\\n  default_ttl=\"1h\" \\\n  max_ttl=\"24h\"\n\n# Enable AWS secrets engine for dynamic IAM credentials\nvault secrets enable aws\nvault write aws\u002Fconfig\u002Froot \\\n  access_key=AKIAEXAMPLE \\\n  secret_key=secretkey \\\n  region=us-east-1\n\nvault write aws\u002Froles\u002Fdeploy-role \\\n  credential_type=iam_user \\\n  policy_document=@deploy-policy.json \\\n  default_sts_ttl=3600\n```\n\n### Step 4: Integrate with Kubernetes Workloads\n\nUse the Vault Agent Injector or CSI Provider to deliver secrets to pods without application code changes. Secrets are rendered as files in a shared volume.\n\n```yaml\n# Kubernetes deployment with Vault Agent Injector annotations\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: web-app\nspec:\n  template:\n    metadata:\n      annotations:\n        vault.hashicorp.com\u002Fagent-inject: \"true\"\n        vault.hashicorp.com\u002Frole: \"web-app\"\n        vault.hashicorp.com\u002Fagent-inject-secret-db-creds: \"database\u002Fcreds\u002Freadonly\"\n        vault.hashicorp.com\u002Fagent-inject-template-db-creds: |\n          {{- with secret \"database\u002Fcreds\u002Freadonly\" -}}\n          export DB_USERNAME=\"{{ .Data.username }}\"\n          export DB_PASSWORD=\"{{ .Data.password }}\"\n          {{- end }}\n    spec:\n      serviceAccountName: web-app\n      containers:\n        - name: web-app\n          image: company\u002Fweb-app:v2.1\n          command: [\"\u002Fbin\u002Fsh\", \"-c\", \"source \u002Fvault\u002Fsecrets\u002Fdb-creds && .\u002Fstart.sh\"]\n```\n\n### Step 5: Implement Transit Encryption and PKI\n\nUse the Transit secrets engine for application-level encryption without managing keys in application code. Deploy the PKI engine for automatic TLS certificate management.\n\n```bash\n# Enable Transit engine for encryption as a service\nvault secrets enable transit\nvault write -f transit\u002Fkeys\u002Fpayment-data type=aes256-gcm96\n\n# Encrypt sensitive data\nvault write transit\u002Fencrypt\u002Fpayment-data \\\n  plaintext=$(echo \"card-number-4111-1111-1111-1111\" | base64)\n\n# Enable PKI for internal certificate management\nvault secrets enable pki\nvault secrets tune -max-lease-ttl=87600h pki\n\n# Generate root CA\nvault write pki\u002Froot\u002Fgenerate\u002Finternal \\\n  common_name=\"Internal Root CA\" \\\n  ttl=87600h\n\n# Configure intermediate CA for issuing certificates\nvault secrets enable -path=pki_int pki\nvault write pki_int\u002Fintermediate\u002Fgenerate\u002Finternal \\\n  common_name=\"Internal Intermediate CA\" \\\n  ttl=43800h\n\n# Create a role for issuing certificates\nvault write pki_int\u002Froles\u002Finternal-services \\\n  allowed_domains=\"internal.company.com\" \\\n  allow_subdomains=true \\\n  max_ttl=720h\n```\n\n### Step 6: Establish Policies and Audit Trail\n\nDefine fine-grained ACL policies following least privilege. Enable comprehensive audit logging for all secret access and administrative operations.\n\n```hcl\n# web-app-policy.hcl\npath \"database\u002Fcreds\u002Freadonly\" {\n  capabilities = [\"read\"]\n}\n\npath \"transit\u002Fencrypt\u002Fpayment-data\" {\n  capabilities = [\"update\"]\n}\n\npath \"transit\u002Fdecrypt\u002Fpayment-data\" {\n  capabilities = [\"update\"]\n}\n\npath \"secret\u002Fdata\u002Fweb-app\u002F*\" {\n  capabilities = [\"read\", \"list\"]\n}\n\n# Deny access to admin paths\npath \"sys\u002F*\" {\n  capabilities = [\"deny\"]\n}\n```\n\n```bash\n# Apply the policy\nvault policy write web-app-policy web-app-policy.hcl\n\n# Verify audit log captures all operations\nvault audit list -detailed\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Dynamic Secrets | Credentials generated on-demand with automatic expiration and revocation, eliminating long-lived static credentials |\n| Secret Engine | Vault component that stores, generates, or encrypts data; includes KV, database, AWS, PKI, and Transit engines |\n| Auto-Unseal | Cloud KMS-based mechanism that automatically unseals Vault nodes on restart without manual key entry |\n| AppRole | Machine-oriented authentication method using Role ID and Secret ID for application and CI\u002FCD pipeline access |\n| Transit Engine | Encryption-as-a-service engine that handles cryptographic operations without exposing encryption keys to applications |\n| Lease | Time-bound credential with a TTL that Vault automatically revokes on expiration unless renewed |\n| Namespace | Vault Enterprise feature providing tenant isolation with separate auth, secrets, and policy management |\n| Response Wrapping | Technique that wraps secret responses in a single-use token to prevent man-in-the-middle exposure during delivery |\n\n## Tools & Systems\n\n- **HashiCorp Vault**: Core secrets management platform providing dynamic secrets, encryption, and identity-based access\n- **Vault Agent Injector**: Kubernetes mutating webhook that automatically injects Vault secrets into pod volumes via sidecar containers\n- **Vault CSI Provider**: Kubernetes CSI driver that mounts Vault secrets directly into pod volumes without sidecar containers\n- **consul-template**: Template rendering daemon that watches Vault secrets and re-renders configuration files when secrets change\n- **Vault Radar**: Secret scanning tool that detects hardcoded credentials in source code, CI\u002FCD pipelines, and cloud configurations\n\n## Common Scenarios\n\n### Scenario: Eliminating Hardcoded Database Credentials from CI\u002FCD Pipeline\n\n**Context**: A DevOps team stores PostgreSQL credentials in GitHub Actions secrets and Jenkins credential stores. The same credentials are shared across staging and production environments with no rotation for 18 months.\n\n**Approach**:\n1. Deploy Vault with AppRole auth enabled for CI\u002FCD systems\n2. Configure the database secrets engine with separate roles for staging (readwrite, 2h TTL) and production (readonly, 1h TTL)\n3. Create separate Vault policies for each pipeline stage restricting access to the appropriate database role\n4. Update GitHub Actions workflows to authenticate via AppRole and request dynamic credentials at the start of each job\n5. Rotate the static PostgreSQL credentials and hand root access to Vault exclusively\n6. Enable audit logging to track every credential request with pipeline job metadata\n\n**Pitfalls**: Failing to rotate the original static credentials after Vault migration leaves the old credentials valid. Setting TTLs too short causes credential expiry mid-deployment for long-running jobs.\n\n## Output Format\n\n```\nVault Secrets Management Audit Report\n=======================================\nVault Cluster: vault.internal.company.com\nVersion: 1.18.1 Enterprise\nHA Mode: Raft (3 nodes)\nSeal Type: AWS KMS Auto-Unseal\nReport Date: 2025-02-23\n\nSECRET ENGINES:\n  database\u002F         PostgreSQL dynamic creds   Leases Active: 47\n  aws\u002F              Dynamic IAM credentials    Leases Active: 12\n  transit\u002F          Encryption as a service    Keys: 8\n  pki\u002F              Root CA                    Certs Issued: 0\n  pki_int\u002F          Intermediate CA            Certs Issued: 234\n  secret\u002F           KV v2 static secrets       Versions: 1,892\n\nAUTH METHODS:\n  oidc\u002F             Okta SSO for humans        Active Tokens: 23\n  approle\u002F          CI\u002FCD pipelines            Active Tokens: 156\n  kubernetes\u002F       Pod-based auth             Active Tokens: 89\n\nAUDIT FINDINGS:\n  [WARN] 3 AppRole secret_id_num_uses set to 0 (unlimited)\n  [WARN] 12 KV secrets not accessed in 90+ days (potential orphans)\n  [PASS] All dynamic secret TTLs under 24 hours\n  [PASS] Audit logging enabled on all nodes\n  [PASS] Root token revoked after initial setup\n\nCREDENTIAL HYGIENE:\n  Static Secrets (KV): 234\n  Dynamic Secrets Active: 59\n  Average Lease TTL: 2.3 hours\n  Secrets Rotated This Month: 12,456\n```\n","# Implementing Secrets Management with Vault\n\n## When to Use\n\n- When applications store database passwords, API keys, or certificates in environment variables or config files\n- When migrating from static long-lived credentials to dynamic short-lived secrets\n- When Kubernetes workloads need secure access to database credentials or cloud provider APIs\n- When compliance requirements mandate centralized credential management with audit logging\n- When CI\u002FCD pipelines contain hardcoded secrets that represent supply chain risk\n\n**Do not use** for AWS-only environments where AWS Secrets Manager suffices without multi-cloud requirements, for application-level encryption logic (though Vault Transit can help), or for identity federation (see managing-cloud-identity-with-okta).\n\n## Prerequisites\n\n- HashiCorp Vault server deployed in HA mode (Consul or Raft storage backend)\n- TLS certificates for Vault listener endpoints\n- Vault Enterprise license for namespaces, Sentinel policies, and replication (optional)\n- Kubernetes cluster with Vault Agent Injector or CSI provider for workload integration\n\n## Workflow\n\n### Step 1: Deploy Vault in High Availability Mode\n\nDeploy Vault using Integrated Storage (Raft) for HA without external dependencies. Configure TLS, audit logging, and auto-unseal using a cloud KMS.\n\n```hcl\n# vault-config.hcl\nstorage \"raft\" {\n  path    = \"\u002Fopt\u002Fvault\u002Fdata\"\n  node_id = \"vault-node-1\"\n\n  retry_join {\n    leader_api_addr = \"https:\u002F\u002Fvault-node-2.internal:8200\"\n  }\n  retry_join {\n    leader_api_addr = \"https:\u002F\u002Fvault-node-3.internal:8200\"\n  }\n}\n\nlistener \"tcp\" {\n  address     = \"0.0.0.0:8200\"\n  tls_cert_file = \"\u002Fopt\u002Fvault\u002Ftls\u002Fvault.crt\"\n  tls_key_file  = \"\u002Fopt\u002Fvault\u002Ftls\u002Fvault.key\"\n}\n\nseal \"awskms\" {\n  region     = \"us-east-1\"\n  kms_key_id = \"alias\u002Fvault-unseal-key\"\n}\n\napi_addr      = \"https:\u002F\u002Fvault-node-1.internal:8200\"\ncluster_addr  = \"https:\u002F\u002Fvault-node-1.internal:8201\"\n\ntelemetry {\n  prometheus_retention_time = \"30s\"\n  disable_hostname         = true\n}\n```\n\n```bash\n# Initialize Vault\nvault operator init -key-shares=5 -key-threshold=3\n\n# Enable audit logging\nvault audit enable file file_path=\u002Fvar\u002Flog\u002Fvault\u002Faudit.log\n\n# Enable syslog audit for SIEM integration\nvault audit enable syslog tag=\"vault\" facility=\"AUTH\"\n```\n\n### Step 2: Configure Authentication Methods\n\nEnable authentication backends for human operators, applications, and CI\u002FCD pipelines. Use AppRole for machine authentication and OIDC for human access.\n\n```bash\n# Enable OIDC auth for human users via Okta\nvault auth enable oidc\nvault write auth\u002Foidc\u002Fconfig \\\n  oidc_discovery_url=\"https:\u002F\u002Fcompany.okta.com\u002Foauth2\u002Fdefault\" \\\n  oidc_client_id=\"vault-client-id\" \\\n  oidc_client_secret=\"vault-client-secret\" \\\n  default_role=\"default\"\n\n# Enable AppRole for application authentication\nvault auth enable approle\nvault write auth\u002Fapprole\u002Frole\u002Fweb-app \\\n  secret_id_ttl=10m \\\n  token_num_uses=10 \\\n  token_ttl=20m \\\n  token_max_ttl=30m \\\n  secret_id_num_uses=1 \\\n  token_policies=\"web-app-policy\"\n\n# Enable Kubernetes auth for pod-based access\nvault auth enable kubernetes\nvault write auth\u002Fkubernetes\u002Fconfig \\\n  kubernetes_host=\"https:\u002F\u002Fkubernetes.default.svc:443\" \\\n  token_reviewer_jwt=@\u002Fvar\u002Frun\u002Fsecrets\u002Fkubernetes.io\u002Fserviceaccount\u002Ftoken \\\n  kubernetes_ca_cert=@\u002Fvar\u002Frun\u002Fsecrets\u002Fkubernetes.io\u002Fserviceaccount\u002Fca.crt\n```\n\n### Step 3: Enable Dynamic Secret Engines\n\nConfigure database secret engines to generate short-lived credentials on demand. Each credential set has a TTL and is automatically revoked when it expires.\n\n```bash\n# Enable database secrets engine for PostgreSQL\nvault secrets enable database\nvault write database\u002Fconfig\u002Fproduction-db \\\n  plugin_name=postgresql-database-plugin \\\n  allowed_roles=\"readonly,readwrite\" \\\n  connection_url=\"postgresql:\u002F\u002F{{username}}:{{password}}@db.internal:5432\u002Fproduction?sslmode=require\" \\\n  username=\"vault_admin\" \\\n  password=\"initial-password\"\n\n# Rotate the root credentials so Vault manages them exclusively\nvault write -force database\u002Frotate-root\u002Fproduction-db\n\n# Create a readonly role with 1-hour TTL\nvault write database\u002Froles\u002Freadonly \\\n  db_name=production-db \\\n  creation_statements=\"CREATE ROLE \\\"{{name}}\\\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO \\\"{{name}}\\\";\" \\\n  revocation_statements=\"REVOKE ALL ON ALL TABLES IN SCHEMA public FROM \\\"{{name}}\\\"; DROP ROLE IF EXISTS \\\"{{name}}\\\";\" \\\n  default_ttl=\"1h\" \\\n  max_ttl=\"24h\"\n\n# Enable AWS secrets engine for dynamic IAM credentials\nvault secrets enable aws\nvault write aws\u002Fconfig\u002Froot \\\n  access_key=AKIAEXAMPLE \\\n  secret_key=secretkey \\\n  region=us-east-1\n\nvault write aws\u002Froles\u002Fdeploy-role \\\n  credential_type=iam_user \\\n  policy_document=@deploy-policy.json \\\n  default_sts_ttl=3600\n```\n\n### Step 4: Integrate with Kubernetes Workloads\n\nUse the Vault Agent Injector or CSI Provider to deliver secrets to pods without application code changes. Secrets are rendered as files in a shared volume.\n\n```yaml\n# Kubernetes deployment with Vault Agent Injector annotations\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: web-app\nspec:\n  template:\n    metadata:\n      annotations:\n        vault.hashicorp.com\u002Fagent-inject: \"true\"\n        vault.hashicorp.com\u002Frole: \"web-app\"\n        vault.hashicorp.com\u002Fagent-inject-secret-db-creds: \"database\u002Fcreds\u002Freadonly\"\n        vault.hashicorp.com\u002Fagent-inject-template-db-creds: |\n          {{- with secret \"database\u002Fcreds\u002Freadonly\" -}}\n          export DB_USERNAME=\"{{ .Data.username }}\"\n          export DB_PASSWORD=\"{{ .Data.password }}\"\n          {{- end }}\n    spec:\n      serviceAccountName: web-app\n      containers:\n        - name: web-app\n          image: company\u002Fweb-app:v2.1\n          command: [\"\u002Fbin\u002Fsh\", \"-c\", \"source \u002Fvault\u002Fsecrets\u002Fdb-creds && .\u002Fstart.sh\"]\n```\n\n### Step 5: Implement Transit Encryption and PKI\n\nUse the Transit secrets engine for application-level encryption without managing keys in application code. Deploy the PKI engine for automatic TLS certificate management.\n\n```bash\n# Enable Transit engine for encryption as a service\nvault secrets enable transit\nvault write -f transit\u002Fkeys\u002Fpayment-data type=aes256-gcm96\n\n# Encrypt sensitive data\nvault write transit\u002Fencrypt\u002Fpayment-data \\\n  plaintext=$(echo \"card-number-4111-1111-1111-1111\" | base64)\n\n# Enable PKI for internal certificate management\nvault secrets enable pki\nvault secrets tune -max-lease-ttl=87600h pki\n\n# Generate root CA\nvault write pki\u002Froot\u002Fgenerate\u002Finternal \\\n  common_name=\"Internal Root CA\" \\\n  ttl=87600h\n\n# Configure intermediate CA for issuing certificates\nvault secrets enable -path=pki_int pki\nvault write pki_int\u002Fintermediate\u002Fgenerate\u002Finternal \\\n  common_name=\"Internal Intermediate CA\" \\\n  ttl=43800h\n\n# Create a role for issuing certificates\nvault write pki_int\u002Froles\u002Finternal-services \\\n  allowed_domains=\"internal.company.com\" \\\n  allow_subdomains=true \\\n  max_ttl=720h\n```\n\n### Step 6: Establish Policies and Audit Trail\n\nDefine fine-grained ACL policies following least privilege. Enable comprehensive audit logging for all secret access and administrative operations.\n\n```hcl\n# web-app-policy.hcl\npath \"database\u002Fcreds\u002Freadonly\" {\n  capabilities = [\"read\"]\n}\n\npath \"transit\u002Fencrypt\u002Fpayment-data\" {\n  capabilities = [\"update\"]\n}\n\npath \"transit\u002Fdecrypt\u002Fpayment-data\" {\n  capabilities = [\"update\"]\n}\n\npath \"secret\u002Fdata\u002Fweb-app\u002F*\" {\n  capabilities = [\"read\", \"list\"]\n}\n\n# Deny access to admin paths\npath \"sys\u002F*\" {\n  capabilities = [\"deny\"]\n}\n```\n\n```bash\n# Apply the policy\nvault policy write web-app-policy web-app-policy.hcl\n\n# Verify audit log captures all operations\nvault audit list -detailed\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Dynamic Secrets | Credentials generated on-demand with automatic expiration and revocation, eliminating long-lived static credentials |\n| Secret Engine | Vault component that stores, generates, or encrypts data; includes KV, database, AWS, PKI, and Transit engines |\n| Auto-Unseal | Cloud KMS-based mechanism that automatically unseals Vault nodes on restart without manual key entry |\n| AppRole | Machine-oriented authentication method using Role ID and Secret ID for application and CI\u002FCD pipeline access |\n| Transit Engine | Encryption-as-a-service engine that handles cryptographic operations without exposing encryption keys to applications |\n| Lease | Time-bound credential with a TTL that Vault automatically revokes on expiration unless renewed |\n| Namespace | Vault Enterprise feature providing tenant isolation with separate auth, secrets, and policy management |\n| Response Wrapping | Technique that wraps secret responses in a single-use token to prevent man-in-the-middle exposure during delivery |\n\n## Tools & Systems\n\n- **HashiCorp Vault**: Core secrets management platform providing dynamic secrets, encryption, and identity-based access\n- **Vault Agent Injector**: Kubernetes mutating webhook that automatically injects Vault secrets into pod volumes via sidecar containers\n- **Vault CSI Provider**: Kubernetes CSI driver that mounts Vault secrets directly into pod volumes without sidecar containers\n- **consul-template**: Template rendering daemon that watches Vault secrets and re-renders configuration files when secrets change\n- **Vault Radar**: Secret scanning tool that detects hardcoded credentials in source code, CI\u002FCD pipelines, and cloud configurations\n\n## Common Scenarios\n\n### Scenario: Eliminating Hardcoded Database Credentials from CI\u002FCD Pipeline\n\n**Context**: A DevOps team stores PostgreSQL credentials in GitHub Actions secrets and Jenkins credential stores. The same credentials are shared across staging and production environments with no rotation for 18 months.\n\n**Approach**:\n1. Deploy Vault with AppRole auth enabled for CI\u002FCD systems\n2. Configure the database secrets engine with separate roles for staging (readwrite, 2h TTL) and production (readonly, 1h TTL)\n3. Create separate Vault policies for each pipeline stage restricting access to the appropriate database role\n4. Update GitHub Actions workflows to authenticate via AppRole and request dynamic credentials at the start of each job\n5. Rotate the static PostgreSQL credentials and hand root access to Vault exclusively\n6. Enable audit logging to track every credential request with pipeline job metadata\n\n**Pitfalls**: Failing to rotate the original static credentials after Vault migration leaves the old credentials valid. Setting TTLs too short causes credential expiry mid-deployment for long-running jobs.\n\n## Output Format\n\n```\nVault Secrets Management Audit Report\n=======================================\nVault Cluster: vault.internal.company.com\nVersion: 1.18.1 Enterprise\nHA Mode: Raft (3 nodes)\nSeal Type: AWS KMS Auto-Unseal\nReport Date: 2025-02-23\n\nSECRET ENGINES:\n  database\u002F         PostgreSQL dynamic creds   Leases Active: 47\n  aws\u002F              Dynamic IAM credentials    Leases Active: 12\n  transit\u002F          Encryption as a service    Keys: 8\n  pki\u002F              Root CA                    Certs Issued: 0\n  pki_int\u002F          Intermediate CA            Certs Issued: 234\n  secret\u002F           KV v2 static secrets       Versions: 1,892\n\nAUTH METHODS:\n  oidc\u002F             Okta SSO for humans        Active Tokens: 23\n  approle\u002F          CI\u002FCD pipelines            Active Tokens: 156\n  kubernetes\u002F       Pod-based auth             Active Tokens: 89\n\nAUDIT FINDINGS:\n  [WARN] 3 AppRole secret_id_num_uses set to 0 (unlimited)\n  [WARN] 12 KV secrets not accessed in 90+ days (potential orphans)\n  [PASS] All dynamic secret TTLs under 24 hours\n  [PASS] Audit logging enabled on all nodes\n  [PASS] Root token revoked after initial setup\n\nCREDENTIAL HYGIENE:\n  Static Secrets (KV): 234\n  Dynamic Secrets Active: 59\n  Average Lease TTL: 2.3 hours\n  Secrets Rotated This Month: 12,456\n```\n",{"name":5,"note":25,"tags":26,"author":32,"domain":33,"source":34,"license":15,"version":35,"nist_csf":36,"subdomain":41,"description":42,"mitre_attack":43,"source_commit":49},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31],"hashicorp-vault","secrets-management","dynamic-secrets","credential-rotation","zero-trust","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0.0",[37,38,39,40],"PR.IR-01","ID.AM-08","GV.SC-06","DE.CM-01","cloud-security","This skill covers deploying HashiCorp Vault for centralized secrets management across cloud environments, including dynamic secret generation for databases and cloud providers, transit encryption, PKI certificate management, and Kubernetes integration. It addresses eliminating hardcoded credentials from application code and CI\u002FCD pipelines by implementing short-lived, automatically rotated secrets.\n",[44,45,46,47,48],"T1078.004","T1530","T1537","T1580","T1003","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa","core\u002Fskills\u002Fimplementing-secrets-management-with-vault",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill implementing-secrets-management-with-vault",{"tool":66,"command":67},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill implementing-secrets-management-with-vault",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill implementing-secrets-management-with-vault","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fimplementing-secrets-management-with-vault\u002FSKILL.md",true,[74,78,84],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",4193,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fimplementing-secrets-management-with-vault\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",10933,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fimplementing-secrets-management-with-vault\u002Fscripts\u002Fagent.py",[91,99,106,114,122,130],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":20},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":131,"name":132,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]