Task 5.6: Explain the value of short-lived, dynamically generated secrets
A unique credential per client, a smaller window for a leaked value, automatic revocation at expiry, and audit trails that name the consumer.
Study it
Why short-lived, dynamic secrets reduce risk
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 1
A database username and password appear on a public paste site. Every service gets its own credentials from the database secrets engine. The leaked credential must stop working now, and no other service may lose database access. What can the team do?
ARotate the shared application username and password in the database and redeploy every service with them
BLeave the credential alone, since its lease will expire on its own at its TTL
CTrace the username to its lease and requesting client in the audit log, and revoke only that lease
DRevoke every lease under the database mount's prefix and let services request new ones
Show the answer and why
ARotate the shared application username and password in the database and redeploy every service with them
Incorrect
Redeploying every service would interrupt the others, which the requirement forbids.
BLeave the credential alone, since its lease will expire on its own at its TTL
Incorrect
The credential would stay valid until the TTL ends, but it must stop working now.
CTrace the username to its lease and requesting client in the audit log, and revoke only that lease
Correct
Each service has unique credentials, so the username identifies one lease and one client, and revoking that lease drops only that user.
DRevoke every lease under the database mount's prefix and let services request new ones
Incorrect
Prefix revocation cuts off every service at once, which the requirement forbids.
Dynamic secrets are unique per client and short-lived, so a leak points to one consumer and can be contained by revoking one lease.
A service lost the private key of a 24-hour TLS certificate it obtained from Vault's PKI secrets engine two hours ago; nothing suggests the key was stolen. What does HashiCorp's PKI guidance say is usually enough?
ARevoke the certificate at once, since every lost key must be on the CRL
BRequest the private key again from Vault, which keeps a copy of it
CRotate the issuing CA, since a lost leaf key exposes the issuer
DIgnore the certificate and request a new one; it expires shortly anyway
Show the answer and why
ARevoke the certificate at once, since every lost key must be on the CRL
Incorrect
Revocation remains available, but for short-lived certificates it is usually unnecessary, and each revocation makes Vault rebuild the CRL.
BRequest the private key again from Vault, which keeps a copy of it
Incorrect
The PKI engine returns a private key only to the requesting client and does not store generated private keys.
CRotate the issuing CA, since a lost leaf key exposes the issuer
Incorrect
A leaf certificate's key gives no access to the CA's own key.
DIgnore the certificate and request a new one; it expires shortly anyway
Correct
With short lifetimes, a certificate whose key was lost can usually just be ignored until it expires, which keeps CRLs small.
Short-lived certificates follow Vault's philosophy of short-lived secrets: revocation becomes the exception, and CRLs stay small, which matters because rebuilding a CRL is expensive.