Courseiva

CCNA Manage Vault leases Questions

38 questions · Manage Vault leases · All types, answers revealed

1
MCQeasy

A security engineer is onboarding a new application team to Vault. The team needs to understand how Vault manages the lifecycle of secrets issued by the database secrets engine. The engineer explains that Vault attaches a lease to dynamic secrets and that the lease defines the secret's validity period. Which statement accurately describes the relationship between a lease and a dynamic secret?

A.A lease is a static configuration setting on the secrets engine that applies the same TTL to every secret issued from that mount.
B.A lease is metadata that records the secret's validity period, renewal eligibility, and revocation behavior, and it is created alongside the dynamic secret.
C.A lease is a client-side token stored by the application that must be presented to Vault before the secret can be used.
D.A lease is created only when an administrator manually enables lease tracking on a secrets engine mount.
AnswerB

Every dynamic secret issued by Vault is accompanied by a lease that stores its TTL, renewability, and revocation instructions. This metadata lets Vault track the secret and automatically revoke it when the lease expires, ensuring credentials do not persist beyond their intended lifetime. The lease is the authoritative record of the secret's lifecycle.

Why this answer

Vault issues dynamic secrets together with a lease that records the secret's time-to-live, whether it can be renewed, and how it should be revoked. This server-side metadata is what allows Vault to automatically revoke credentials when they are no longer valid, which is a core security benefit of using dynamic secrets over static credentials.

Exam trap

The trap here is assuming a lease is a static mount configuration or a client-side artifact, rather than a per-secret server-side metadata record created at issuance.

2
MCQhard

A role in Vault's database secrets engine is configured with default_ttl=30m and max_ttl=2h. An application requests credentials and then successfully renews the lease twice, each time receiving the full default TTL. What is the longest total time the credential can remain valid from its original issue time?

A.2 hours
B.4 hours
C.1 hour 30 minutes
D.Unlimited, as long as the application renews before each expiry
AnswerA

max_ttl caps the total lifetime of a lease regardless of how many times it is renewed. Each renewal may grant up to the default TTL, but the expiration can never be pushed beyond two hours from the original issue time, so that is the absolute ceiling for this credential.

Why this answer

The max_ttl on the role is the hard ceiling on a lease's total lifetime from issuance. Renewals can extend expiration in increments up to the default TTL, but the expiration manager refuses to push past max_ttl, after which the application must obtain brand-new credentials through the creds endpoint.

Exam trap

The trap here is multiplying the default TTL by the number of renewals or assuming renewals can continue forever, instead of recognizing max_ttl as an absolute cap from issue time.

3
MCQmedium

A Vault operator accidentally revoked a token that was used to lease many database credentials. What happens to the leases associated with that token?

A.All leases are immediately revoked.
B.The leases become orphaned and will never be revoked.
C.Vault automatically renews the leases with a new token.
D.The leases continue until their natural expiration.
AnswerA

Vault ties every lease to its parent token, so revoking that token cascades to its entire lease tree. All database credential leases issued under it are immediately revoked, forcing clients to re-authenticate and obtain fresh credentials.

Why this answer

In Vault, tokens are the root of identity and authorization for all associated leases. When a token is revoked, Vault immediately revokes all leases created using that token, including database credential leases, because the token's lifecycle governs the leases it has created. This ensures that no credentials remain valid after the token is revoked, maintaining security.

Exam trap

HashiCorp often tests the misconception that leases have independent lifetimes or that Vault might orphan or auto-renew leases, when in fact the token's revocation is the authoritative trigger for immediate lease cleanup.

How to eliminate wrong answers

Option B is wrong because Vault does not orphan leases; it actively tracks the parent token for each lease and revokes them when the token is revoked. Option C is wrong because Vault does not automatically renew leases with a new token; lease renewal requires the original token or a token with sufficient privileges, and revocation is a terminal action. Option D is wrong because leases are tied to the token's lifecycle, not independent; they do not continue to natural expiration once the token is revoked.

4
Multi-Selectmedium

A Vault operator wants to manage lease durations for secrets issued by a PKI secrets engine. Which two actions can they take to affect the lease duration of certificates?

Select 2 answers
A.Set the 'default_lease_ttl' on the auth method used to log in.
B.Set the 'max_lease_ttl' on the auth method used to log in.
C.Configure the 'ttl' parameter in the PKI role definition.
D.Set the 'lease_duration' parameter in the PKI role definition.
E.Set the 'default_lease_ttl' on the PKI secrets engine mount.
AnswersC, E

The PKI role's ttl parameter sets the default lease duration for certificates issued under that role, so adjusting it directly controls how long issued certificates remain valid. This is the supported mechanism for influencing lease duration at issuance time.

Why this answer

Option C is correct because the PKI role definition accepts a 'ttl' parameter that sets the default lease duration for certificates issued under that role, overriding the mount's default when specified. Option E is correct because setting 'default_lease_ttl' on the PKI secrets engine mount establishes the baseline lease duration for certificates issued by that mount when the role does not specify its own TTL. Options A and B are incorrect because 'default_lease_ttl' and 'max_lease_ttl' on an auth method govern the lifetime of the auth method's own tokens, not the leases of certificates issued by a PKI secrets engine.

Option D is incorrect because 'lease_duration' is not a valid parameter in a PKI role definition; the correct parameter is 'ttl' (along with 'max_ttl').

Exam trap

The trap here is that candidates confuse the 'default_lease_ttl' on the mount (which is a fallback) with the role-level 'ttl' (which is the direct control), or mistakenly think auth method lease settings apply to secrets engine leases.

5
Multi-Selecthard

A Vault administrator is designing a disaster-recovery runbook for dynamic secrets and needs to document the ways leases can be terminated or cleaned up. Which two statements correctly describe lease revocation behavior in Vault? (Choose two.)

Select 2 answers
A.Revoking a token revokes the leases of secrets that were created using that token, in addition to the token itself.
B.Deleting the lease record from Vault's storage with a storage operation leaves the external credential valid until its natural expiry.
C.Revoking a lease automatically revokes every other lease issued by the same secrets engine mount.
D.Once a lease is revoked, the same lease ID can be renewed again if the client still holds it.
E.Revoking a lease for a dynamic secret also removes the corresponding credential at the external system through the secrets engine.
AnswersA, E

Vault tracks parent-child relationships between tokens and the leases they spawn. Revoking a token cascades to its child leases, which is why offboarding a service account cleans up its dynamic credentials. This cascade behavior is a core reason to issue per-application tokens rather than sharing one, so revocation boundaries stay meaningful.

Why this answer

Token revocation cascades to the leases that token created, and revoking a dynamic secret's lease instructs the secrets engine to delete the external credential. Revocation is scoped rather than mount-wide, revoked leases cannot be revived, and normal revocation cleans up the external system instead of merely dropping Vault's record.

Exam trap

The trap here is conflating lease revocation with mount-wide cleanup and assuming a revoked lease can still be renewed, when it is permanently dead and scoped only to itself or its prefix.

6
MCQmedium

A platform team runs a Vault cluster where many applications obtain dynamic AWS credentials from the aws secrets engine. During an incident, an operator needs to stop all credential usage tied to a compromised IAM role without disrupting other roles. The operator has a root token and wants to revoke every lease associated with that specific role. Which approach accomplishes this?

A.Delete the AWS IAM role directly in AWS and wait for Vault leases to expire naturally.
B.Disable the aws secrets engine mount, which immediately revokes all leases issued by that mount.
C.Run vault lease revoke -prefix aws/creds/<role-name> to revoke all leases under that role's path.
D.Run vault token revoke -self to revoke the token that requested the credentials.
AnswerC

The vault lease revoke command supports the -prefix flag, which revokes every lease whose ID begins with the given path. Using aws/creds/<role-name> targets only leases issued for that role, leaving other roles' credentials intact. This is the precise, scoped way to revoke a set of leases during an incident.

Why this answer

The vault lease revoke command with the -prefix flag revokes all leases whose IDs share a given path prefix. Because AWS dynamic credentials are issued under aws/creds/<role-name>, using that prefix scopes the revocation to the compromised role only, achieving rapid containment without tearing down the secrets engine or affecting other roles.

Exam trap

The trap here is reaching for mount disablement or AWS-side deletion when a scoped lease revocation by path prefix is the precise and least disruptive action.

7
MCQhard

An administrator notices that after revoking a specific lease, the underlying database credential is still accessible. What is the most likely cause?

A.The revocation script failed to delete the database user.
B.The secret engine caches credentials.
C.The lease ID was incorrect.
D.The lease was renewed after revocation.
AnswerA

Revoking a lease removes the credential from Vault's lease database but does not automatically drop the corresponding database user. If the revocation script fails to delete that user, the credential remains valid at the database layer.

Why this answer

When a lease is revoked in Vault, the revocation script associated with the database secret engine is responsible for deleting or disabling the corresponding database user. If that script fails (e.g., due to insufficient permissions, network issues, or a bug in the script), the underlying credential remains active in the database, even though the lease is no longer valid in Vault. This is a common operational issue where the lease lifecycle and the actual credential lifecycle become out of sync.

Exam trap

HashiCorp often tests the misconception that lease revocation automatically guarantees the underlying resource is destroyed, but the trap is that revocation only manages the Vault-side lease metadata, not the external resource, which depends on the success of the configured revocation script.

How to eliminate wrong answers

Option B is wrong because Vault's database secret engine does not cache credentials; each lease corresponds to a unique database user created dynamically, and revocation directly invokes the script to remove that user. Option C is wrong because if the lease ID were incorrect, Vault would return an error or not find the lease, but the question states the lease was successfully revoked, meaning the lease ID was valid. Option D is wrong because once a lease is revoked, it cannot be renewed; renewal is only possible before revocation, and attempting to renew after revocation would fail.

8
MCQmedium

A security team must immediately invalidate every dynamic database credential issued under a specific role named app-readonly, across all database mounts, without knowing individual lease IDs. Which Vault command accomplishes this?

A.vault secrets disable database
B.vault lease revoke -prefix database/creds/app-readonly
C.vault lease revoke -force database/creds/app-readonly
D.vault token revoke -accessor app-readonly
AnswerB

The -prefix flag revokes every lease whose ID begins with the given path, which includes all leases generated by that role. This is the intended bulk revocation mechanism when individual lease IDs are unknown, and it also instructs the database secrets engine to drop the corresponding users at the database.

Why this answer

Revoking by prefix targets all leases under the role's creds path in one operation and triggers the secrets engine to remove the corresponding database accounts. Forcing deletion skips backend cleanup, token revocation is scoped to tokens rather than roles, and disabling the mount destroys configuration the team still needs.

Exam trap

The trap here is reaching for mount-level or token-level revocation when the requirement is role-scoped bulk revocation, which the prefix flag handles precisely.

9
Multi-Selecthard

Which three statements about lease renewal are correct? (Choose three.)

Select 3 answers
A.A lease can be renewed indefinitely.
B.Renewing a lease increments the lease number.
C.A lease can be renewed up to the max_lease_ttl.
D.Lease renewal requires 'sudo' capability.
E.The renew operation can extend the lease TTL.
AnswersB, C, E

Each renewal increases the lease number, visible in lease details.

Why this answer

In Vault, each lease renewal increments the lease number (a monotonically increasing counter) to track the renewal history. This allows clients and Vault to detect replay attacks or stale renewals, as the lease ID remains the same but the lease number changes with each successful renew operation.

Exam trap

HashiCorp often tests the misconception that lease renewal is unlimited or requires elevated privileges, when in fact it is bounded by max_lease_ttl and only needs the lease ID and appropriate token capabilities.

10
Multi-Selectmedium

Which two commands can be used to manually revoke leases? (Choose two.)

Select 2 answers
A.vault secrets disable <path>
B.vault token revoke <token>
C.vault lease revoke <lease_id>
D.vault lease renew <lease_id>
E.vault lease revoke -prefix <prefix>
AnswersC, E

vault lease revoke with a specific lease_id terminates that single lease immediately, invalidating its associated token or secret. This satisfies the stem's requirement for manual revocation of an individual lease rather than bulk or prefix-based revocation.

Why this answer

Option C, `vault lease revoke <lease_id>`, is correct because it directly revokes a single lease by its lease ID, immediately invalidating the associated secret and removing it from Vault's lease tracking. Option E, `vault lease revoke -prefix <prefix>`, is correct because the `-prefix` flag revokes all leases whose IDs begin with the given prefix, enabling bulk revocation of leases under a path or hierarchy. Option A, `vault secrets disable <path>`, is not a lease-revocation command; it disables a secrets engine at the given path, which revokes leases as a side effect but is not the manual lease-revocation operation asked for.

Option B, `vault token revoke <token>`, revokes a token and its child tokens, not leases directly. Option D, `vault lease renew <lease_id>`, extends a lease's TTL rather than revoking it.

Exam trap

In the HashiCorp Vault exam, candidates often confuse lease revocation with token revocation, leading them to mistakenly choose `vault token revoke` (option B) when the question specifically asks about leases, not tokens.

11
MCQhard

After a Vault migration, some leases are no longer valid and cause errors. What is the best way to force a cleanup of all leases under a specific mount without affecting other mounts?

A.Restart Vault servers
B.Disable and re-enable the secret engine
C.Use vault lease revoke -prefix <mount>
D.Reduce the mount's max_lease_ttl to 0
AnswerC

The -prefix flag revokes every lease whose ID begins with the given mount path, clearing all stale leases under that mount in one operation. Scoping by prefix confines the cleanup to the affected mount, leaving leases on other mounts untouched.

Why this answer

The `vault lease revoke -prefix <mount>` command is specifically designed to revoke all leases associated with a given mount path without affecting other mounts. This command iterates through all leases under that prefix and forces their revocation, cleaning up invalid leases efficiently. It is the targeted, non-disruptive approach for lease cleanup in Vault.

Exam trap

Candidates often think that restarting Vault or disabling/re-enabling a mount is the simplest way to clear leases, but the trap here is that these actions are either ineffective or overly destructive, while the `revoke -prefix` command provides a precise, non-disruptive solution.

How to eliminate wrong answers

Option A is wrong because restarting Vault servers does not force cleanup of leases; leases persist in storage and will be re-evaluated on restart, not removed. Option B is wrong because disabling and re-enabling the secret engine is overly disruptive, as it removes all secrets and configuration for that mount, not just leases, and may cause data loss or service interruption. Option D is wrong because reducing the mount's `max_lease_ttl` to 0 only affects future lease creation and renewal, not existing leases; it does not force revocation of current invalid leases.

12
MCQeasy

What happens when a lease reaches its TTL?

A.The lease is marked as expired and can no longer be renewed.
B.The lease is automatically renewed.
C.The secret is automatically revoked.
D.The lease is deleted from storage.
AnswerA

Once a lease hits its TTL, the system transitions it to an expired state, and renewal is no longer permitted. This satisfies the stem's constraint by ensuring stale leases cannot be extended, forcing the holder to acquire a fresh lease instead.

Why this answer

When a lease reaches its Time-To-Live (TTL), it becomes expired and cannot be renewed. Vault does not automatically delete the lease from storage at the moment of TTL expiry; rather, the lease is marked as expired and is eventually garbage-collected. This cleanup is separate from revocation of the underlying secret, which must be performed explicitly or via a different mechanism.

Exam trap

Candidates often mistakenly think that a lease reaching its TTL triggers revocation of the underlying secret, when in fact Vault only marks the lease as expired and relies on separate revocation logic for the actual secret.

How to eliminate wrong answers

Option A is wrong because a lease that reaches its TTL is not marked as expired and left in storage; it is deleted entirely, and Vault does allow renewal before the TTL expires, not after. Option B is wrong because leases are not automatically renewed; renewal must be explicitly requested by the client before the TTL expires. Option C is wrong because the secret associated with the lease is not automatically revoked when the lease reaches its TTL; revocation is a separate action that can occur before or after TTL, but at TTL the lease is simply deleted, and the secret may still be valid if it has a longer lifetime.

13
MCQhard

An organization uses Vault to issue certificates via the PKI secrets engine. They have set the default lease TTL on the PKI mount to 72h, and the role's ttl to 24h. A user requests a certificate with a requested TTL of 48h. What will be the actual TTL of the issued certificate?

A.The request will be rejected because the requested TTL exceeds the role's ttl.
B.48h
C.24h
D.72h
AnswerC

Vault caps the issued certificate's TTL at the smallest applicable value. The role's ttl of 24h overrides both the mount's 72h default and the requested 48h, so the certificate is issued with a 24h TTL.

Why this answer

(24h) because when a certificate request is made, Vault applies the most restrictive TTL among the role's configured `ttl`, the mount's default lease TTL, and the requested TTL. Here, the role's `ttl` of 24h is the shortest, so it overrides both the requested 48h and the mount default of 72h, resulting in a certificate with a 24-hour validity.

Exam trap

The trap here is that candidates often assume the requested TTL is honored as long as it is within the mount's default lease TTL, overlooking that the role's ttl is the authoritative cap and that Vault silently truncates rather than rejects the request.

How to eliminate wrong answers

Option A is wrong because the requested TTL of 48h does not exceed the role's ttl of 24h; it exceeds it, but Vault does not reject the request—it silently caps the TTL to the role's maximum. Option B is wrong because Vault does not honor a requested TTL that is longer than the role's configured ttl; the role's ttl acts as a hard upper limit. Option D is wrong because the mount's default lease TTL of 72h is a system-wide fallback, not a per-role cap; the role's ttl takes precedence over the mount default when it is shorter.

14
MCQmedium

An operator inspects a Vault policy and finds a rule granting read on database/creds/reporting. Applications using tokens bound to this policy can fetch credentials but receive permission denied when they attempt to extend them. Which capability must be added to the policy to allow lease renewal?

A.create on sys/leases/renew
B.sudo on database/creds/reporting
C.read on sys/leases/lookup
D.update on sys/leases/renew
AnswerD

Lease renewal is an update operation against sys/leases/renew, so a policy needs the update capability on that path for the token to extend a lease. Read on the creds path only permits generating credentials; it grants nothing on the renewal endpoint, which explains the permission denied errors observed.

Why this answer

Renewing a lease is an update to the sys/leases/renew endpoint, so the policy must grant update there. Reading lease metadata, using sudo on the generation path, or granting create instead of update all leave the renewal call unauthorized, which is exactly the failure the applications are hitting.

Exam trap

The trap here is assuming that read access to the credentials path also covers lease maintenance operations, when renewal is a separate update-authorized endpoint.

15
MCQeasy

A platform engineer has issued dynamic AWS credentials through Vault's AWS secrets engine and wants to extend the usable lifetime of that credential before it expires. Which Vault CLI command allows the engineer to request additional time on the lease?

A.vault lease renew <lease_id>
B.vault token renew <token>
C.vault write aws/creds/my-role ttl=1h
D.vault lease revoke <lease_id>
AnswerA

The vault lease renew command extends the lease of a secret that was already issued. When run against an AWS secrets engine lease, Vault asks the backend to extend the credential's validity, subject to the role's max_ttl. This directly matches the engineer's goal of gaining additional usable time before the credential expires.

Why this answer

Leases on dynamic secrets can be extended with vault lease renew, which asks the secrets engine to grant more time within the role's max_ttl boundary. Revoking destroys the credential, renewing a token affects authentication rather than the secret, and re-writing the creds path issues a separate credential instead of extending the current one.

Exam trap

The trap here is confusing token renewal with lease renewal, assuming that renewing the token also extends the lifetime of secrets issued under it.

16
MCQmedium

A DevOps team is using Vault's database secrets engine to generate dynamic credentials for a PostgreSQL database. They notice that the lease duration is set to 24 hours, but security policy requires that credentials expire after 1 hour. What should the team do to enforce the 1-hour expiration without changing the default lease TTL for all secrets?

A.Set the mount's max_lease_ttl to 1h.
B.Ask each developer to set the TTL when requesting credentials.
C.Configure the role with a ttl of 1h.
D.Use a periodic token with a period of 1h.
AnswerC

Setting a ttl of 1h on the specific database role overrides the engine's default lease TTL for credentials issued through that role only, enforcing the one-hour expiry without altering global defaults for other secrets or roles.

Why this answer

The database secrets engine allows role-level TTL configuration that overrides the default lease duration for credentials generated from that role. By setting the role's `ttl` to 1h, the team enforces a 1-hour expiration for credentials created under that specific role without affecting the default lease TTL for all secrets or other roles. This directly meets the security policy requirement while maintaining flexibility for other secrets.

Exam trap

The trap here is that candidates often confuse mount-level TTL settings with role-level TTL settings, assuming that changing the mount's `max_lease_ttl` is the only way to enforce expiration, when in fact role-level configuration provides granular control without affecting other secrets.

How to eliminate wrong answers

Option A is wrong because setting the mount's `max_lease_ttl` to 1h would enforce a hard upper limit on all secrets generated from that mount, including other roles or engines, which violates the requirement to not change the default lease TTL for all secrets. Option B is wrong because relying on each developer to set the TTL when requesting credentials is error-prone and does not enforce the policy centrally; developers might forget or intentionally set a longer TTL, leading to non-compliance. Option D is wrong because periodic tokens are used for long-lived tokens that automatically renew, not for database credentials; they do not control the TTL of dynamic credentials generated by the database secrets engine.

17
MCQmedium

An admin is troubleshooting a Vault cluster where some dynamic secrets leases are not being revoked after their TTL expires. The admin confirms that the TTLs are set correctly. Which Vault component is responsible for revoking expired leases?

A.The audit device
B.The expiration manager
C.The Vault storage backend
D.The secrets engine plugin
AnswerB

Vault's expiration manager is responsible for tracking lease TTLs and revoking leases when they expire. It runs as part of the Vault core and periodically checks for expired leases. If leases are not being revoked, the expiration manager may be disabled or malfunctioning, making it the correct component to investigate.

Why this answer

The expiration manager is the Vault internal component that tracks lease TTLs and triggers revocation when leases expire. If leases are not being revoked despite correct TTLs, the expiration manager is the primary suspect. It runs within the Vault core and coordinates with secrets engines to revoke credentials.

Other components like storage, audit, and secrets engines do not initiate revocation.

Exam trap

The trap here is assuming that the secrets engine or storage backend handles lease expiration, when in fact the expiration manager is the dedicated component for that task.

18
MCQeasy

A Vault admin needs to revoke all leases under the `database/creds/readonly` path without revoking leases from other paths. Which command should the admin use?

A.vault lease revoke -prefix database/creds/readonly
B.vault lease revoke -force database/creds/readonly
C.vault lease revoke database/creds/readonly
D.vault lease revoke -all database/creds/readonly
AnswerA

The `vault lease revoke -prefix` command revokes all leases whose IDs start with the given prefix. Specifying `database/creds/readonly` targets exactly the leases created by that role, leaving other paths untouched. This is the correct way to perform a scoped, bulk revocation of leases under a specific secrets engine path.

Why this answer

To revoke all leases under a specific secrets engine path, the admin must use `vault lease revoke -prefix <path>`. The `-prefix` flag tells Vault to revoke every lease whose ID begins with the given string, which effectively targets all leases generated by that path. Other flags either expect a full lease ID or revoke everything cluster-wide.

Exam trap

The trap here is confusing the `-prefix` flag with other flags or omitting it, leading to either an invalid lease ID error or an overly broad revocation.

19
MCQhard

A Vault administrator is investigating a production incident where an application's dynamic database credentials stopped working earlier than expected, even though the lease had not reached its maximum TTL. The administrator reviews the role configuration and finds default_ttl=1h and max_ttl=24h. The application typically renews its lease every 30 minutes. Which factor most likely explains why the credentials became invalid before max_ttl was reached?

A.Vault's max_ttl of 24h was reached because the application renewed too frequently, exhausting the lease budget.
B.The application's Vault token expired, so Vault automatically revoked all leases created by that token.
C.The default_ttl of 1h caused Vault to revoke the credential after one hour regardless of renewals.
D.The underlying database user's password was rotated or the user was dropped outside of Vault, invalidating the credential independently of the lease.
AnswerD

Vault leases track Vault-side validity, but the actual credential lives in the target system. If an external process rotates the database password or drops the user, the credential fails even though the Vault lease remains active and renewable. This is the most plausible cause when credentials fail before max_ttl despite normal renewal behavior.

Why this answer

Vault leases govern Vault-side lifecycle, but the credential's validity in the target system is separate. If a database administrator rotates the password or removes the user outside Vault, the credential stops working even though the Vault lease is still active and renewable. This mismatch between Vault lease state and external system state is a common cause of premature credential failure.

Exam trap

The trap here is assuming Vault lease validity always matches credential validity, overlooking that external changes to the target system can invalidate credentials independently.

20
MCQhard

A Vault administrator is troubleshooting a batch of revoked database credentials. An application reported that its lease stopped working even though the application had been renewing it every few minutes. Reviewing the mount configuration, the administrator sees default_lease_ttl set to 15m and max_lease_ttl set to 2h. The application log shows successful renewals until roughly the two-hour mark, after which the renew call returned an error and the credential failed. What is the most likely explanation?

A.The database engine rotated its root credentials, which invalidated every outstanding dynamic credential at once.
B.The application's token expired, causing all leases it created to be revoked automatically at the same time.
C.The lease reached the mount's max_lease_ttl, so renewal could no longer extend it and the credential had to be reissued.
D.The application exceeded its allowed renewal count, and Vault rejected the renewal after a fixed number of attempts.
AnswerC

Renewal extends a lease only up to the cumulative maximum defined by the mount's max_lease_ttl. Once a lease has lived for two hours, further renewal attempts fail and the credential expires, regardless of how frequently the client renewed. The application must request a new credential rather than continuing to renew the exhausted lease.

Why this answer

The mount's max_lease_ttl defines the absolute cumulative lifetime of a lease, and renewal cannot push a lease past that boundary. The application's renewals succeeded until the lease reached two hours, at which point renewal failed and the credential expired. The correct remediation is for the application to request a new credential when renewal is no longer granted.

Exam trap

The trap here is attributing a renewal failure at a fixed interval to token expiry or renewal limits instead of the lease's cumulative maximum TTL.

21
Matchingmedium

Match each Vault term to its definition.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Encrypted state requiring unseal

Decrypt master key to access data

Encryption layer protecting storage

Key splitting for unseal

Superuser token with full access

Why these pairings

Correct matches: Secret is sensitive data; Token is an authentication credential. Common confusions: Policy vs. Auth Method — policies control access, auth methods authenticate users.

22
MCQmedium

A Vault operator discovers that a service account token was compromised, and that token had created several dynamic database credentials across multiple roles. The operator needs to invalidate every lease created by that token as quickly as possible rather than waiting for each lease to expire. Which action accomplishes this?

A.Seal the Vault cluster, which revokes all outstanding leases cluster-wide and requires unsealing afterward.
B.Revoke the database secrets engine mount, which forcibly expires all credentials issued from any token.
C.Revoke the compromised token, which also revokes the leases that were created by that token.
D.Rotate the database root credentials, which immediately invalidates every dynamic credential in the database.
AnswerC

When a token is revoked, Vault revokes the leases associated with that token as part of the revocation process. This provides a fast, targeted way to invalidate credentials created by the compromised identity without disturbing leases owned by other tokens or applications. It is the appropriate containment action for a leaked token that has spawned dynamic credentials.

Why this answer

Revoking a token causes Vault to revoke the leases created by that token, providing precise containment for a compromised identity. This targets only the credentials spawned by the leaked token while leaving unrelated leases intact. More disruptive actions such as revoking the mount or sealing the cluster are unnecessary and cause collateral impact.

Exam trap

The trap here is reaching for a broad action like revoking the mount or rotating root credentials when revoking the specific token already cascades to its leases.

23
MCQhard

A Vault admin wants to revoke a specific lease for a dynamic database credential. The admin has the lease ID. Which command should the admin use?

A.vault lease revoke -prefix <lease_id>
B.vault lease revoke <lease_id>
C.vault lease revoke -force <lease_id>
D.vault lease revoke -all <lease_id>
AnswerB

The `vault lease revoke` command with a full lease ID revokes that specific lease. This is the correct way to revoke a single lease without affecting others. The command calls the secrets engine's revocation logic for that lease, ensuring the underlying credential is also revoked. It is precise and safe for targeted revocation.

Why this answer

To revoke a single lease, the admin should run `vault lease revoke <lease_id>` without any additional flags. This command targets exactly that lease and triggers the appropriate secrets engine to revoke the underlying credential. Using `-prefix` would revoke multiple leases, while `-all` and `-force` are either invalid or overly broad.

Exam trap

The trap here is adding unnecessary flags like `-prefix` or `-all`, which either broaden the scope or cause errors, instead of using the simple revoke command for a single lease.

24
MCQhard

A security team wants to ensure that database credentials generated by Vault are never renewed and have a fixed lifespan of 30 minutes. They configure the role with default_ttl=30m and max_ttl=30m, and set renewable=false. However, they find that some users are able to renew the leases anyway. What could be the reason?

A.The renewable flag requires the role to be updated after existing leases are issued.
B.The renewable flag is not respected when max_ttl equals default_ttl.
C.The renewable flag is only applicable to token auth methods, not secrets engines.
D.The lease's renewable property is controlled by the client token's renewable status.
AnswerA

The renewable flag is evaluated when a lease is issued, so leases created before the role update retain their original renewability. Existing leases must be revoked or allowed to expire for the non-renewable setting to take effect.

Why this answer

The `renewable=false` setting on a Vault role only affects newly issued leases; it does not retroactively apply to leases that were already issued before the role was updated. Since the security team configured the role after some users had already obtained credentials, those existing leases retain their original `renewable=true` property, allowing users to renew them despite the new role setting. Vault enforces the `renewable` flag at lease creation time, not dynamically during renewal requests.

Exam trap

The trap in Vault is that the `renewable` flag on a role only affects new leases issued after the role update, not existing leases. Candidates often incorrectly assume that changing the role setting immediately prevents renewals, but Vault applies the flag at lease creation time.

How to eliminate wrong answers

Option B is wrong because the `renewable` flag is fully independent of TTL values; setting `max_ttl` equal to `default_ttl` does not override or disable the `renewable` flag. Option C is wrong because the `renewable` flag is applicable to both token auth methods and secrets engines (e.g., database, AWS, PKI) when generating dynamic credentials; it is not limited to token auth methods. Option D is wrong because the lease's `renewable` property is controlled by the role configuration of the secrets engine that issued the lease, not by the client token's `renewable` status; the client token's renewability is a separate concern.

25
MCQmedium

An operator runs vault lease list and sees many expired leases. Why are expired leases still listed?

A.The leases are not actually expired.
B.The operator has a permission to see expired leases.
C.Vault keeps expired leases for auditing until cleaned up by garbage collection.
D.Expired leases are never removed.
AnswerC

Expired leases persist because Vault retains them for auditing purposes until garbage collection removes them. This satisfies the stem's observation that `vault lease list` shows expired entries: the audit trail requirement means leases are not deleted immediately upon expiry, but only when the garbage collection process later reclaims them.

Why this answer

Vault does not immediately remove expired leases; they are cleaned up by a periodic garbage collection process. Until then, they may appear in listing.

26
MCQmedium

A platform team runs Vault with a transit secrets engine mount at transit/. An application requests a new data encryption key with a 30-minute TTL, and the returned lease_id is recorded by the app. Twenty minutes later, the app calls the renew endpoint for that lease. The mount was configured with max_lease_ttl of 1h. What is the maximum TTL the lease can be extended to by this renewal?

A.The lease can be renewed indefinitely as long as the client keeps renewing before expiration, because transit keys have no maximum lifetime.
B.The lease can be renewed only up to the original 30-minute TTL, because transit leases cannot be extended beyond creation TTL.
C.The lease can be renewed up to 1 hour total from its original creation time, because the mount's max_lease_ttl caps the cumulative lease lifetime.
D.The lease can be renewed to 30 minutes from the moment of the renewal call, giving it a total lifetime of 50 minutes.
AnswerC

Vault caps a lease's total lifetime at the mount's max_lease_ttl, which here is 1h. Renewal can extend the remaining time, but it cannot push the lease past that cumulative limit from creation. Since the lease was created 20 minutes ago, a renewal can extend it only to the 1-hour mark, after which it expires and must be re-created.

Why this answer

A renewable lease is bounded by the mount's max_lease_ttl, which acts as a cumulative ceiling measured from lease creation. Renewal can extend the lease's expiration toward that ceiling but never beyond it. With a 1-hour max and 20 minutes already elapsed, the lease can be renewed only to the 1-hour mark, after which it must be reissued.

Exam trap

The trap here is assuming a renewal adds a fresh TTL interval from the renewal moment instead of counting against the mount's cumulative max_lease_ttl.

27
Multi-Selecthard

An organization uses Vault's AWS secrets engine to generate temporary IAM credentials. The Vault administrator has set the default lease TTL on the AWS mount to 15 minutes. A developer creates a role with role TTL of 30 minutes and explicit max TTL of 1 hour. Which TWO statements are true regarding the lease behavior for credentials generated under this role?

Select 2 answers
A.The initial lease duration will be 30 minutes (the role TTL).
B.The lease can be renewed up to a total lifetime of 1 hour (explicit max TTL).
C.The lease can be renewed indefinitely up to the system max TTL.
D.The initial lease duration will be 15 minutes (the default lease TTL).
E.The lease duration is the minimum of default lease and role TTL.
AnswersA, B

The role TTL overrides the mount's default lease TTL, so credentials issued under this role receive an initial lease of 30 minutes rather than the mount's 15-minute default. The explicit max TTL of 1 hour caps renewal, not the initial issuance, satisfying the stem's role-level TTL constraint.

Why this answer

Option A is correct because when a role specifies its own TTL, that role TTL overrides the mount's default lease TTL, so the initial lease duration for credentials generated under this role is 30 minutes. Option B is correct because the role's explicit max TTL of 1 hour caps the total lifetime of the lease, meaning renewals can extend it only up to that 1-hour maximum. Option D is incorrect because the 15-minute default lease TTL applies only when the role does not define its own TTL.

Option C is incorrect because an explicit max TTL prevents indefinite renewal and overrides the system max TTL. Option E is incorrect because Vault does not take the minimum of the default lease TTL and role TTL; the role TTL takes precedence for the initial lease duration.

Exam trap

HashiCorp often tests the distinction between initial lease duration (role TTL) and total allowable lifetime (explicit max TTL), and the trap here is assuming the default mount TTL or a minimum calculation governs the initial lease when a role TTL is explicitly configured.

28
MCQeasy

Which of the following best describes a Vault lease?

A.A permission to access a path.
B.A time-limited agreement that governs the lifecycle of a secret.
C.A contract to use a secret for a certain duration.
D.The actual secret value.
AnswerB

Vault leases bind every secret to a defined TTL and renewal or revocation cycle, so credentials expire automatically rather than persisting indefinitely. This time-bound lifecycle directly satisfies the question's focus on a time-limited agreement governing secrets.

Why this answer

A Vault lease is a time-bound agreement that governs the lifecycle of a secret, including its validity period, renewal, and revocation. When a secret is read from Vault, it is returned with a lease ID and a lease duration (TTL), after which the secret is automatically revoked unless renewed. This ensures that secrets are not valid indefinitely, reducing the risk of exposure.

Exam trap

HashiCorp often tests the distinction between the lease itself (the lifecycle management agreement) and the secret value, leading candidates to mistakenly choose Option D because they think the lease is the actual secret.

How to eliminate wrong answers

Option A is wrong because a Vault lease is not merely a permission to access a path; permissions are defined by policies attached to tokens or auth methods, not by leases. Option C is wrong because a lease is not a contract to use a secret for a certain duration; it is a technical mechanism that automatically manages the secret's lifecycle, including renewal and revocation, not a contractual agreement. Option D is wrong because the actual secret value is the data returned by Vault (e.g., a password or API key), while the lease is the metadata (lease ID, TTL, renewable flag) that controls that secret's lifecycle.

29
MCQmedium

A developer wants to ensure that their application automatically renews its secret leases before expiration. Which approach is recommended?

A.Set the lease TTL to infinite.
B.Use a cron job to call vault lease renew periodically.
C.Use Vault agent with a template and renew capability.
D.Use periodic tokens with auto-renewal.
AnswerC

Vault Agent runs alongside the application, authenticates automatically, and its template stanza renders secrets to a file while renewing the lease before expiry. This satisfies the requirement for automatic renewal without embedding renewal logic in application code.

Why this answer

Vault Agent's template and renew capability is the recommended approach because it automatically manages the lifecycle of dynamic secrets, including renewing leases before they expire. Vault Agent runs as a sidecar or daemon and uses its built-in renewer to periodically extend the lease TTL, ensuring the application always has a valid secret without manual intervention or external scheduling.

Exam trap

HashiCorp often tests the distinction between renewing a token (which can use periodic tokens) versus renewing a secret lease (which requires Vault Agent or explicit lease renewal), causing candidates to mistakenly choose periodic tokens for secret lease renewal.

How to eliminate wrong answers

Option A is wrong because setting the lease TTL to infinite is not supported by Vault; leases always have a finite TTL defined by the secret engine's default or maximum, and infinite TTL would violate security best practices by never forcing rotation. Option B is wrong because using a cron job to call vault lease renew is brittle and not recommended; it introduces a single point of failure, lacks awareness of lease expiration timing, and does not handle Vault Agent's automatic renewal or template rendering. Option D is wrong because periodic tokens with auto-renewal are used for long-lived tokens, not for renewing secret leases; secret leases (e.g., database credentials, AWS IAM keys) require explicit lease renewal via the /sys/leases/renew endpoint, and periodic tokens do not automatically renew those leases.

30
MCQmedium

A Vault administrator wants to configure a role for dynamic secrets with a default TTL of 1 hour and a max TTL of 4 hours. They also want to allow renewal but only up to the max TTL. Which configuration achieves this?

A.default_ttl=1h, max_ttl=4h, renewable=false
B.default_ttl=4h, max_ttl=1h, renewable=true
C.default_ttl=1h, max_ttl=4h, renewable=true
D.default_ttl=1h, max_ttl=4h, renewable=true, ttl=1h
AnswerC

Setting default_ttl=1h and max_ttl=4h with renewable=true lets tokens be renewed repeatedly, but Vault caps each renewal at the max_ttl ceiling, so the lease cannot outlive four hours. This satisfies both the one-hour default and the four-hour renewal limit.

Why this answer

It sets the default TTL to 1 hour, the maximum TTL to 4 hours, and enables renewal (renewable=true). In Vault, dynamic secret leases can be renewed up to the max_ttl, so with this configuration the initial lease is 1 hour, and each renewal extends the lease until the total lifetime reaches 4 hours, after which no further renewals are allowed.

Exam trap

A common trap is confusing the order of default_ttl and max_ttl. Remember that default_ttl sets the initial lease duration, while max_ttl limits the total lifetime including renewals. Also, renewable=true must be set to allow renewal up to the max_ttl.

How to eliminate wrong answers

Option A is wrong because renewable=false prevents any renewal, so the lease would expire after 1 hour and cannot be extended to the max TTL of 4 hours. Option B is wrong because it sets default_ttl=4h and max_ttl=1h, which is invalid—the default TTL cannot exceed the max TTL; Vault would reject this configuration or cap the default to the max. Option D is wrong because it includes an extra ttl=1h parameter, which is not a valid role parameter for dynamic secrets (the correct parameters are default_ttl and max_ttl); adding an undefined parameter may cause an error or be ignored, but the core issue is that it introduces confusion without adding value.

31
MCQeasy

What command is used to view the remaining time on a lease?

A.vault lease lookup <lease_id>
B.vault lease info <lease_id>
C.vault status <lease_id>
D.vault read <lease_id>
AnswerA

The vault lease lookup command retrieves a lease's metadata, including its expiry time and remaining TTL, given the lease ID. This directly answers the requirement to view how much time remains before the lease expires.

Why this answer

The correct command to view the remaining time on a lease is `vault lease lookup <lease_id>`. This command retrieves the lease metadata, including the issue time, duration (TTL), and remaining time, directly from the Vault server. It is the standard method for inspecting lease details without extending or modifying the lease.

Exam trap

HashiCorp often tests the distinction between `vault lease lookup` and `vault read`, where candidates mistakenly think `vault read` can inspect lease details because it is used to read secrets, but lease metadata requires a dedicated lease API command.

How to eliminate wrong answers

Option B is wrong because `vault lease info` is not a valid Vault CLI command; the correct subcommand is `lookup`. Option C is wrong because `vault status` displays the seal status and HA state of the Vault server, not lease information. Option D is wrong because `vault read` is used to read secrets or data from a path, not to inspect lease metadata; it would attempt to read the path as a secret, which would fail or return unrelated data.

32
Multi-Selectmedium

An operations team manages Vault leases for dynamic database credentials. They need to extend the life of an active lease without issuing a new credential, and they also want to confirm the lease's remaining time before doing so. Which two commands or operations should they use? (Choose two.)

Select 2 answers
A.vault lease lookup database/creds/app-role/abc123
B.vault lease revoke database/creds/app-role/abc123
C.vault lease renew database/creds/app-role/abc123
D.vault write database/creds/app-role
E.vault token renew -accessor <accessor-id>
AnswersA, C

The vault lease lookup command returns details about a lease, including its issue time, expiration time, and remaining TTL. This is the correct way to confirm how much time is left before attempting a renewal. It is a read-only operation and does not alter the lease.

Why this answer

To extend an active lease without issuing new credentials, use vault lease renew with the lease ID. To check how much time remains before renewal, use vault lease lookup, which reports the lease's expiration and TTL. Together these operations let the team confirm the remaining lifespan and then extend the existing lease in place.

Exam trap

The trap here is confusing token renewal or credential reissuance with secret lease renewal, when only vault lease renew extends the existing secret lease.

33
Multi-Selecteasy

Which two of the following are valid lease operations? (Choose two.)

Select 2 answers
A.vault lease renew
B.vault lease create
C.vault lease delete
D.vault lease generate
E.vault lease revoke
AnswersA, E

This is a valid command to renew leases.

Why this answer

`vault lease renew` is a valid Vault CLI command used to extend the lifetime of a lease before it expires. In HashiCorp Vault, leases are associated with dynamic secrets (e.g., database credentials, AWS IAM keys) and must be periodically renewed to maintain access. The `renew` operation is a core lease lifecycle operation supported by the Vault API and CLI.

Exam trap

HashiCorp often tests the distinction between lifecycle operations that are explicitly supported (renew, revoke) versus operations that are not part of the Vault CLI (create, delete, generate), leading candidates to assume all CRUD-like verbs are valid.

34
Drag & Dropmedium

Drag and drop the steps to configure Vault's audit logging to a file into the correct order.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

The correct sequence for configuring Vault's audit logging to a file is: first enable the audit device (e.g., 'vault audit enable file file_path=...'), then perform operations (e.g., read/write secrets) to generate audit log entries, and finally verify the log file to confirm entries are being recorded. Common mistakes include enabling after generating logs, verifying too early, or skipping the generation step.

35
Multi-Selecteasy

Which TWO of the following actions can reduce the number of active leases in Vault? (Select two.)

Select 2 answers
A.Reducing the default lease TTL
B.Revoking a lease
C.Creating a new lease
D.Increasing the max lease TTL
E.Renewing a lease
AnswersA, B

Leases expire when their TTL elapses, so lowering the default lease TTL causes leases to be revoked sooner and reduces how many remain active at any moment. This directly decreases the count of outstanding leases Vault must track.

Why this answer

Option A is correct because reducing the default lease TTL shortens the lifetime of newly issued leases, so they expire and are revoked sooner, decreasing the count of active leases at any given time. Option B is correct because revoking a lease explicitly invalidates it, immediately removing it from the set of active leases tracked by Vault. Option C is incorrect because creating a new lease adds another active lease rather than reducing the count.

Option D is incorrect because increasing the max lease TTL allows leases to live longer, which tends to keep more leases active. Option E is incorrect because renewing a lease extends its lifetime, keeping it active instead of reducing the number of active leases.

Exam trap

HashiCorp often tests the misconception that increasing TTL values or renewing leases reduces active leases, but both actions actually prolong lease lifetimes and can increase the active count if new leases are created concurrently.

36
MCQhard

A Vault cluster is sealed. An operator attempts to renew a lease but gets an error. What is the most likely error?

A.Vault is sealed
B.Upstream error
C.Permission denied
D.Lease not found
AnswerA

A sealed Vault node cannot service any API requests, including lease renewal, because the barrier is active and the storage backend is inaccessible. The operator receives a "Vault is sealed" error, directly reflecting the stem's constraint that the cluster is sealed. Unsealing restores lease operations.

Why this answer

When Vault is sealed, it cannot process any operations, including lease renewal. The error would indicate the sealed state.

37
MCQhard

A financial services company uses Vault's PKI secrets engine to issue short-lived TLS certificates to internal services. An administrator configured the PKI role with default_ttl=24h and max_ttl=72h. A service requests a certificate with an explicit TTL of 120h. What will Vault do in this situation?

A.Vault rejects the request with an error because the requested TTL exceeds max_ttl.
B.Vault issues the certificate with a TTL of 120h because the requested TTL overrides the role's max_ttl.
C.Vault issues the certificate with a TTL of 24h, the role's default_ttl, ignoring the requested value entirely.
D.Vault issues the certificate with a TTL capped at 72h, the role's max_ttl.
AnswerD

When a requested TTL exceeds the role's max_ttl, Vault caps the issued lease at max_ttl. The certificate will be valid for 72 hours rather than the requested 120 hours. This enforces the administrator-defined upper bound on credential lifetime, which is the core purpose of max_ttl.

Why this answer

The max_ttl on a PKI role establishes the absolute maximum lifetime for any certificate issued by that role. When a client requests a TTL beyond that value, Vault clamps the issued lease to max_ttl, so the certificate is valid for 72 hours. The default_ttl only applies when no TTL is specified.

Exam trap

The trap here is assuming a client-requested TTL can override max_ttl, or that exceeding max_ttl causes an error rather than a silent cap.

38
MCQmedium

A platform team runs a Vault cluster with a transit secrets engine mount at transit/. An application holds a token with a policy granting only "update" on transit/encrypt/orders and "read" on transit/keys/orders. The application's token has a TTL of 1h with a max_ttl of 4h, and it renews itself every 30 minutes using the token renewal endpoint. After roughly four hours of continuous operation, the application's API calls begin failing with a permission denied error even though the token was renewed successfully each time. Which Vault behavior explains this failure?

A.The transit secrets engine automatically revoked the token when the application exceeded its allowed number of encrypt operations per hour.
B.The policy attached to the token expired at the same time as the token's initial TTL and had to be reattached before further API calls could succeed.
C.The token reached its max_ttl, so renewal requests stopped extending its lifetime and the token expired, invalidating all requests made with it.
D.Renewing a token more than once silently converts it into a periodic token whose capabilities are stripped until it is re-authenticated.
AnswerC

Vault tokens carry both a TTL and a max_ttl. Each successful renewal extends the token only up to the max_ttl ceiling; once that absolute lifetime is reached, Vault no longer extends the token and it expires. When the token expires, every request authenticated with it fails, which matches the permission denied errors appearing after roughly four hours of renewals.

Why this answer

Service tokens are bounded by both a renewable TTL and an absolute max_ttl. Each renewal extends the token's lifetime only until the max_ttl ceiling is reached; beyond that point Vault refuses to extend it, and the token expires. Expiration invalidates the token immediately, so subsequent API calls authenticated with it fail with permission denied, exactly as the application observes after about four hours.

Exam trap

The trap here is assuming that a successfully renewed token can be renewed forever, when in fact renewals stop extending the token once its max_ttl ceiling is reached.

Ready to test yourself?

Try a timed practice session using only Manage Vault leases questions.