Home / DevOps & CI/CD / HashiCorp Vault
Secrets · PKI · Encryption

HashiCorp Vault

Niente più password nei file YAML. Dynamic secrets, PKI interna, transit encryption, audit log nativo.

VAULT · open source
HashiCorp Vault
Cos'è

I segreti dell'azienda, in un posto solo, controllati e auditati.

HashiCorp Vault è il sistema di secret management più adottato a livello enterprise. Indirizza il problema che ogni azienda ha: dove finiscono le password? (Spoiler: in git, in confluence, sulle stickies del monitor.)

Storage backend cifrato (Consul, Postgres, Raft), auth method per ogni identità (K8s ServiceAccount, AWS IAM, AD, OIDC, AppRole, tokens), secret engine per ogni use case (KV statico, DB dynamic, PKI, transit encryption, SSH certificates, AWS STS).

Lo deployiamo HA su 3 nodi (Raft consensus), sealed/unsealed con auto-unseal su KMS Clodino Cloud, integrato con K8s via Vault Agent Injector o External Secrets Operator. Audit log su SIEM cliente.

Caratteristiche chiave

Le sei feature che fanno la differenza in produzione.

Non solo password storage: rotation, PKI, encryption-as-a-service.

Dynamic secrets

Credenziali DB generate al volo, TTL breve, revocate automaticamente. No più password lunghe.

PKI interna

Certificate authority per servizi interni. mTLS gratis, niente Let's Encrypt per ogni service.

Transit encryption

Encryption-as-a-service: le app cifrano via API senza gestire chiavi. Rotation senza re-encrypt.

Auth method

K8s SA, AWS IAM, AD, OIDC, AppRole. Ogni identità, un metodo nativo.

K8s injection

Vault Agent Injector annota i pod, monta i secret come file/env. Trasparente per le app.

Audit log

Ogni richiesta loggata cifrata. Export su SIEM, retention per compliance.

Come lo usiamo

Come integriamo Vault nei progetti reali.

Vault 1.17+Raft storageExternal Secrets OperatorVault Agent InjectorVault PKIOpenBao (fork)
  • Vault HA 3 nodi (Raft), auto-unseal con KMS Clodino Cloud o Transit di un Vault root.
  • External Secrets Operator su K8s: i secret arrivano in cluster come Kubernetes Secret.
  • Dynamic secrets per Postgres/MySQL: l'app riceve credenziali con TTL 1h, rotation trasparente.
  • PKI interna per mTLS service-to-service: Istio/Linkerd ricevono cert da Vault.
  • AppRole per pipeline GitLab CI: i runner si autenticano e accedono ai secret necessari.
  • Audit log streaming verso Loki/SIEM per compliance (GDPR, NIS2, ISO 27001).
“Vault è quello che ti permette di rispondere onestamente alla domanda: dove sono i secret? Ovunque, ma in modo controllato.”
Hands on

Un pod K8s che riceve dynamic secret DB.

yaml · pod annotations~/clodino
 deployment.yaml
metadata:
  annotations:
    vault.hashicorp.com/agent-inject: "true"
    vault.hashicorp.com/role: "checkout-api"
    vault.hashicorp.com/agent-inject-secret-db.txt: \
      "database/creds/checkout-readwrite"
    vault.hashicorp.com/agent-inject-template-db.txt: |
      DB_USER={{ .Data.username }}
      DB_PASS={{ .Data.password }}

 Container starts:
 /vault/secrets/db.txt populated
 DB user: v-kubernet-checkou-AbCd1234XyZ (TTL 1h)
 rotation 5m before expiry · transparent

Le password sono ancora in git?

Setup Vault HA + External Secrets + dynamic secret DB + integrazione GitLab CI.

← DevOpsParla con noi