Skip to content

003 · Domain 5: Secrets engines · 20% of the exam

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?

  1. ARotate the shared application username and password in the database and redeploy every service with them
  2. BLeave the credential alone, since its lease will expire on its own at its TTL
  3. CTrace the username to its lease and requesting client in the audit log, and revoke only that lease
  4. 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.

Question 2 · choose 1

Why do short TTLs on dynamic database credentials reduce risk?

  1. AShort TTLs make the generated passwords longer and harder to guess
  2. BShort TTLs prevent the credential from being logged
  3. CA leaked credential stops working soon after it is issued
  4. DShort TTLs let several services share one credential
Show the answer and why
  • AShort TTLs make the generated passwords longer and harder to guess

    Incorrect

    TTL controls lifetime, not password strength.

  • BShort TTLs prevent the credential from being logged

    Incorrect

    Audit logging does not depend on TTL.

  • CA leaked credential stops working soon after it is issued

    Correct

    Vault revokes the credential when its lease ends, so exposure is limited to that window.

  • DShort TTLs let several services share one credential

    Incorrect

    Dynamic credentials are issued per client.

Short-lived secrets turn a leak from a standing risk into a brief one.

Question 3 · choose 1

An operations team rotates a shared database password by hand every quarter and often forgets. What changes with dynamic credentials from Vault?

  1. ANothing needs rotating: each credential is revoked at lease end
  2. BThe quarterly rotation becomes a monthly Vault job
  3. CVault rotates the shared password on a schedule, and each app reads it
  4. DThe rotation moves to the application teams
Show the answer and why
  • ANothing needs rotating: each credential is revoked at lease end

    Correct

    Vault revokes dynamic secrets automatically when their TTL expires, so no shared password ages.

  • BThe quarterly rotation becomes a monthly Vault job

    Incorrect

    There is no shared password left to rotate.

  • CVault rotates the shared password on a schedule, and each app reads it

    Incorrect

    That describes a static role, not dynamic credentials.

  • DThe rotation moves to the application teams

    Incorrect

    Vault handles the credential lifecycle.

Automation of the full lifecycle is the operational payoff of dynamic secrets.

Question 4 · choose 1

A contractor needs AWS access for exactly two hours today. What gives that with the least follow-up work?

  1. AAn IAM user created by hand and deleted tomorrow
  2. BAWS credentials from the AWS secrets engine with a 2-hour TTL
  3. CA long-lived key stored in KV with a 2-hour delete_version_after
  4. DA shared team key rotated after the contractor finishes
Show the answer and why
  • AAn IAM user created by hand and deleted tomorrow

    Incorrect

    Manual deletion relies on someone remembering and leaves access open meanwhile.

  • BAWS credentials from the AWS secrets engine with a 2-hour TTL

    Correct

    Vault revokes the credentials when the TTL ends, so access is time-boxed without manual cleanup.

  • CA long-lived key stored in KV with a 2-hour delete_version_after

    Incorrect

    Deleting the KV version does not disable the key in AWS.

  • DA shared team key rotated after the contractor finishes

    Incorrect

    Rotation afterwards cuts off everyone and depends on manual action.

TTLs on leases and tokens give time-boxed access by design.

Question 5 · choose 1

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?

  1. ARevoke the certificate at once, since every lost key must be on the CRL
  2. BRequest the private key again from Vault, which keeps a copy of it
  3. CRotate the issuing CA, since a lost leaf key exposes the issuer
  4. 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.

Practice domain 5 →Practice all domains →