Courseiva

CCNA Create Vault policies Questions

26 questions · Create Vault policies · All types, answers revealed

1
MCQhard

A Vault administrator needs to create a policy that grants users read access only to the secrets that belong to their own team. The team membership is stored in an external identity provider and mapped to Vault entity aliases. The administrator wants to use a templated policy that references the entity's metadata. Which policy syntax accomplishes this goal?

A.path "secret/data/{{identity.entity.metadata.team}}/*" { capabilities = ["read", "list"] }
B.path "secret/data/{{entity.metadata.team}}/*" { capabilities = ["read", "list"] }
C.path "secret/data/{{.team}}/*" { capabilities = ["read", "list"] }
D.path "secret/data/{{identity.entity.aliases.team}}/*" { capabilities = ["read", "list"] }
AnswerA

The templated path interpolates identity.entity.metadata.team, so each user's entity metadata resolves to their own team's secret path. This grants read and list capabilities only within that team's namespace, satisfying the requirement for per-team access scoped by external identity provider membership.

Why this answer

It uses the proper templating syntax `{{identity.entity.metadata.team}}` to reference the `team` metadata key stored on the Vault entity. This allows the policy to dynamically grant read and list access to the path `secret/data/<team>/*`, ensuring users only see secrets belonging to their own team as defined by the external identity provider.

Exam trap

Vault often tests the distinction between entity metadata and alias metadata, and the trap here is that candidates confuse `{{identity.entity.metadata}}` with `{{identity.entity.aliases}}` or use invalid shorthand like `{{entity.metadata}}` or `{{.team}}`.

How to eliminate wrong answers

Option B is wrong because it uses `{{entity.metadata.team}}` which is not valid ACL policy templating syntax; the correct prefix must be `identity.entity.metadata`. Option C is wrong because `{{.team}}` is a shorthand used in Consul templates, not in Vault ACL policies, and does not reference entity metadata. Option D is wrong because `{{identity.entity.aliases.team}}` incorrectly attempts to access a metadata key directly under aliases; team membership is stored in entity metadata, not in the alias object itself.

2
MCQeasy

A security team needs to grant a service account the ability to read secrets from the path 'secret/data/backup' and also to update the secret at that same path. Which policy correctly implements this requirement?

A.path "secret/backup" { capabilities = ["read", "update"] }
B.path "secret/data/backup" { capabilities = ["read", "create"] }
C.path "secret/data/backup/*" { capabilities = ["read", "update"] }
D.path "secret/data/backup" { capabilities = ["read", "update"] }
AnswerD

This policy grants read and update capabilities on the exact path secret/data/backup. In Vault, update capability allows modifying an existing secret, which includes creating a new version or changing the secret data. This matches the requirement to read and update the secret at that path.

Why this answer

For KV v2 secrets, reading and updating a secret at a specific path requires capabilities read and update on secret/data/<path>. The update capability allows modifying an existing secret, which is necessary here. Using create instead of update would not allow modifying an existing secret.

Specifying the exact path without a wildcard ensures least privilege.

Exam trap

The trap here is confusing create and update capabilities; create allows writing a new secret but not modifying an existing one, while update is required to change an existing secret.

3
MCQmedium

A platform team stores KV v2 secrets under the mount 'kv-prod'. They need a policy that lets an application read only the metadata (not the underlying secret values) for every path under 'kv-prod/apps/', including the ability to enumerate keys. Which policy stanza satisfies this requirement?

A.path "kv-prod/data/apps/*" { capabilities = ["read", "list"] }
B.path "kv-prod/metadata/apps/*" { capabilities = ["read"] }
C.path "kv-prod/metadata/apps/*" { capabilities = ["read", "list"] }
D.path "kv-prod/apps/*" { capabilities = ["read", "list"] }
AnswerC

On a KV v2 mount the metadata endpoint is reached at '<mount>/metadata/<path>'. Granting read and list on kv-prod/metadata/apps/* lets the client list keys and inspect version metadata such as created_time and current_version, while never touching the data endpoint that returns secret values. This is exactly the least-privilege requirement described.

Why this answer

KV v2 splits each secret into a data endpoint that returns values and a metadata endpoint that returns version information. To inspect versions without exposing secret material, the policy must target the metadata path and include list so the prefix can be enumerated. Pointing the stanza at the data path leaks values, and omitting list breaks key discovery.

Exam trap

The trap here is assuming the KV v1 path layout still applies, so the policy is written against the bare mount path instead of the metadata sub-path that KV v2 actually uses.

4
MCQhard

A security team needs to create a Vault policy that allows a token to read secrets under 'secret/data/finance/*' but explicitly denies access to 'secret/data/finance/salaries'. The policy must also allow listing all secrets under 'secret/data/finance/'. Which policy definition correctly achieves this?

A.path "secret/data/finance/*" { capabilities = ["read", "list"] } path "secret/data/finance/salaries" { capabilities = ["read", "list"] allowed_parameters = { "deny" = [] } }
B.path "secret/data/finance/*" { capabilities = ["read", "list"] } path "secret/data/finance/salaries" { capabilities = ["read"] }
C.path "secret/data/finance/*" { capabilities = ["read", "list"] denied_parameters = ["salaries"] }
D.path "secret/data/finance/*" { capabilities = ["read", "list"] } path "secret/data/finance/salaries" { capabilities = ["deny"] }
AnswerD

This policy grants read and list on all paths under finance, then explicitly denies access to the salaries path. In Vault, a deny capability takes precedence over any other capability, even if a more specific path rule grants access. The order of path blocks does not matter; the deny rule overrides. This correctly restricts access to salaries while allowing everything else.

Why this answer

Vault policies use a deny capability that overrides any other capability on a path. To deny access to a specific path while allowing a broader wildcard, you create a separate path block for the denied path with capabilities = ["deny"]. The order of blocks is irrelevant because Vault evaluates all matching paths and deny always wins.

This is the correct and supported method.

Exam trap

The trap here is thinking that a more specific path with allow capabilities overrides a wildcard deny, but in Vault deny always takes precedence regardless of path specificity.

5
Multi-Selecthard

A Vault policy must allow a service to read secrets from "secret/data/app" and also be able to renew its own token. Which two policy statements are necessary and sufficient for this requirement? (Select two.)

Select 2 answers
A.path "secret/data/app" { capabilities = ["read"] }
B.path "auth/token/renew-self" { capabilities = ["update"] }
C.path "auth/token/renew" { capabilities = ["update"] }
D.path "secret/data/app/*" { capabilities = ["read"] }
E.path "sys/auth" { capabilities = ["read"] }
AnswersA, B

Grants read capability on the exact KV v2 data path, satisfying the secret-retrieval half of the requirement. Without this statement the service cannot fetch credentials, so it is necessary; the token-renewal half is covered separately by the renew-self path.

Why this answer

The policy must grant read access to the specific path 'secret/data/app' for the service to retrieve secrets. Option B is correct because renewing a token requires the 'update' capability on the 'auth/token/renew-self' endpoint, which allows the service to extend its own token's TTL without needing broader token management privileges.

Exam trap

HashiCorp Vault often tests the distinction between 'auth/token/renew-self' and 'auth/token/renew', where candidates mistakenly choose the broader 'renew' path instead of the self-service endpoint, overlooking the requirement for the service to renew only its own token.

6
MCQhard

A security team must delegate policy management to a group of operators without giving them the ability to grant themselves capabilities on protected paths such as 'sys/*' or 'auth/token/*'. Which combination of policy rules best implements this delegation safely?

A.Grant 'create' and 'update' on 'sys/policies/acl/*' and additionally restrict the operators through a Sentinel or policy-as-code layer that rejects stanzas referencing 'sys/*' or 'auth/token/*'.
B.Grant 'create' and 'update' on 'sys/policies/acl/*' plus 'read' on 'sys/policies/acl', and rely on Vault's default behavior that operators can only write policies they themselves could exercise.
C.Grant 'create' and 'update' on 'sys/policies/acl/*' and require operators to authenticate with a token that has a short TTL, since Vault re-evaluates policy contents against the author's ACL at token creation time.
D.Grant 'sudo' on 'sys/policies/acl/*' along with 'create' and 'update', because the sudo capability makes Vault validate that submitted policies do not exceed the author's own privileges.
AnswerA

Vault's ACL system does not constrain the contents of a policy an operator may write, so write access to the policy endpoint is inherently a path to privilege escalation unless an external guard inspects the submitted document. Adding a policy-as-code or Sentinel validation layer that rejects protected path stanzas closes that gap while still allowing day-to-day policy authoring.

Why this answer

Because Vault treats a policy document as opaque content and does not verify that the author could exercise the capabilities being granted, write access to the policy endpoint is effectively administrative. Safe delegation therefore requires an external validation layer that inspects submitted stanzas and rejects protected paths, rather than relying on sudo, TTLs or imagined self-escalation checks.

Exam trap

The trap here is assuming Vault enforces that policy authors cannot grant more than they themselves hold, a property that does not exist in the ACL system.

7
MCQeasy

An organization is implementing Vault policies for the first time. They want to ensure that policies are easy to manage and follow the principle of least privilege. Which approach should they take when creating policies?

A.Create policies with broad paths and then restrict via ACL tokens.
B.Create a single policy with a wildcard path '*' and full capabilities for all administrators.
C.Create a single policy with all paths and capabilities for all users.
D.Create separate policies for each application and use group aliases to attach them.
AnswerD

Separate per-application policies keep each rule set minimal and auditable, while group aliases map identity-provider groups to those policies without duplicating rules per user. This satisfies least privilege and simplifies ongoing management as applications and team memberships change.

Why this answer

It aligns with the principle of least privilege by creating separate policies for each application, ensuring that each application only has access to the specific paths and capabilities it requires. Using group aliases to attach these policies allows for centralized management and simplifies policy updates, as changes can be made at the group level rather than per user or token. This approach also leverages Vault's identity-based policies, which are evaluated based on the entity's group memberships, providing a scalable and maintainable policy structure.

Exam trap

A common misconception in Vault is that using broad policies with wildcards simplifies management, but the correct approach is to create granular, application-specific policies to enforce least privilege and maintain auditability.

How to eliminate wrong answers

Option A is wrong because creating policies with broad paths and then restricting via ACL tokens violates the principle of least privilege by initially granting excessive access, and ACL tokens are not a mechanism for restricting policies—policies themselves define capabilities, and tokens inherit them. Option B is wrong because a single policy with a wildcard path '*' and full capabilities for all administrators grants unrestricted access to all secrets and operations, which is a security risk and directly contradicts the principle of least privilege. Option C is wrong because a single policy with all paths and capabilities for all users provides no granularity, allowing every user to access every secret and perform all operations, which is insecure and unmanageable.

8
MCQmedium

A company has deployed Vault with an LDAP auth method and has created entity aliases for all users. The company uses KV v2 secrets engine mounted at 'secret/'. Each team's secrets are stored under a path like 'secret/data/team_<team_name>/'. They have multiple teams (engineering, marketing, sales). Currently, an administrator manually creates a separate policy for each team, e.g., path "secret/data/team_engineering/*" { capabilities = ["read", "list"] }. This is becoming cumbersome as new teams are added. The administrator wants to create a single policy that dynamically grants read access to the secrets path corresponding to the user's team, which is stored in the entity's metadata as 'team'. The LDAP auth method is configured to sync group memberships and map to entity aliases, and the entity metadata is correctly populated. Which approach should the administrator take?

A.Create a policy using a wildcard alias for each team in the entity alias.
B.Create a policy that uses the 'default' policy to allow all reads and then restrict with ACL tokens.
C.Create a policy using a templated path: path "secret/data/{{identity.entity.metadata.team}}/*" { capabilities = ["read", "list"] }.
D.Create a policy with path "secret/data/*" { capabilities = ["read", "list"] } and assign it to all users.
AnswerC

Templated policies interpolate identity entity metadata at request time, so {{identity.entity.metadata.team}} resolves to each user's team value. One policy then grants read and list on that team's path, eliminating per-team policies as new teams are added, satisfying the dynamic single-policy requirement.

Why this answer

Vault's ACL policy templating allows dynamic path construction using entity metadata. By using `{{identity.entity.metadata.team}}` in the policy path, the policy automatically resolves to the team name stored in the user's entity metadata, granting read/list access only to that team's secrets path. This eliminates the need for per-team policies while maintaining least-privilege access.

Exam trap

Vault often tests the distinction between static wildcard paths and dynamic templated paths, where candidates mistakenly think a simple wildcard like `secret/data/*` is sufficient, ignoring the need for metadata-driven access control.

How to eliminate wrong answers

Option A is wrong because wildcard aliases are not a Vault feature; entity aliases map external identities to Vault entities but do not support wildcards for policy path construction. Option B is wrong because the 'default' policy is a built-in policy that cannot be modified to restrict reads; ACL tokens are used for authentication, not for restricting permissions after a policy grants access. Option D is wrong because granting read/list on `secret/data/*` would give every user access to all team secrets, violating the principle of least privilege and the requirement for team-specific access.

9
MCQmedium

A Vault administrator is writing a policy for a monitoring tool that must be able to list all secrets under the 'secret/metadata/finance/' path and read the metadata of individual secrets, but must not read the secret data itself. Which policy snippet correctly grants only these permissions?

A.path "secret/data/finance/*" { capabilities = ["list", "read"] }
B.path "secret/metadata/finance/*" { capabilities = ["read"] }
C.path "secret/metadata/finance/*" { capabilities = ["list", "read"] }
D.path "secret/finance/*" { capabilities = ["list", "read"] }
AnswerC

This snippet grants list and read capabilities on the metadata path for all secrets under finance. In KV v2, metadata operations like listing and reading secret metadata are performed on the metadata/ path, so this precisely meets the requirement without granting access to the actual secret data.

Why this answer

In Vault's KV v2 secrets engine, metadata operations such as listing secrets and reading secret metadata are performed on the metadata/ path, while reading and writing secret data uses the data/ path. To allow listing and reading metadata without accessing secret data, the policy must grant list and read on secret/metadata/finance/*. The other options either target the wrong path or omit required capabilities.

Exam trap

The trap here is assuming that list and read on the data/ path will allow listing secrets and reading metadata, when in fact KV v2 separates metadata and data operations into distinct paths.

10
Drag & Dropmedium

Drag and drop the steps to create and use a periodic service token in Vault into the correct order.

Drag or tap steps into the slots.

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

Why this order

First create the role, then generate a token with a TTL, use it, and renew periodically.

11
MCQmedium

Refer to the exhibit. A user with this policy attempts to read the secret at path "secret/data/team-a/admin". What will happen?

A.The read fails because the path does not exist.
B.The read succeeds because the first path grants read.
C.The read succeeds because deny only applies to write operations.
D.The read is denied because the deny policy takes precedence.
AnswerD

Vault evaluates all matching policies together, and any matching deny rule overrides grants regardless of specificity or order. The deny on that path therefore blocks the read even if another policy grants it, so access is refused.

Why this answer

The deny policy takes precedence over any allow policy in Vault, regardless of the path specificity. Even though the first path grants read access to 'secret/data/team-a/*', the second path explicitly denies all capabilities (including read) on 'secret/data/team-a/admin', which is a more specific path. Vault's policy evaluation uses a deny-overrides model, so the deny action blocks the read operation.

Exam trap

Candidates often mistakenly think Vault uses a first-match or most-specific-path-wins model, similar to firewall rules, when in fact deny always overrides allow regardless of path specificity.

How to eliminate wrong answers

Option A is wrong because the path 'secret/data/team-a/admin' exists in the policy (it is explicitly listed in the deny statement), so the failure is not due to a missing path. Option B is wrong because Vault does not use a first-match-wins model; deny policies take precedence over allow policies, even if the allow path is broader. Option C is wrong because the deny policy applies to all capabilities (read, write, list, delete, etc.) unless specific capabilities are listed; the deny statement here has no capabilities list, so it denies all operations, including read.

12
MCQhard

A Vault administrator is creating a policy for an application that needs to read a PKI role configuration and also generate certificates using that role. The PKI secrets engine is mounted at 'pki/'. Which policy snippet grants the minimum required capabilities?

A.path "pki/roles/app-role" { capabilities = ["read", "list"] } path "pki/issue/app-role" { capabilities = ["read"] }
B.path "pki/roles/app-role" { capabilities = ["read"] } path "pki/sign/app-role" { capabilities = ["create", "update"] }
C.path "pki/roles/app-role" { capabilities = ["read"] } path "pki/issue/app-role" { capabilities = ["create", "update"] }
D.path "pki/roles/app-role" { capabilities = ["read"] } path "pki/issue/app-role" { capabilities = ["sudo"] }
AnswerC

This snippet grants read on the role configuration and create/update on the issue path. In Vault's PKI secrets engine, reading a role uses the roles/ path, and generating a certificate uses the issue/ path with a write operation, which requires create or update capability. This meets the requirement with least privilege.

Why this answer

The PKI secrets engine uses pki/roles/<role> for reading role configuration and pki/issue/<role> for generating certificates. Generating a certificate is a write operation, so the policy must grant create or update on the issue path. Reading the role requires read on the roles path.

The sign endpoint is for signing CSRs, not for generating certificates.

Exam trap

The trap here is confusing the issue and sign endpoints; issue generates a new certificate and private key, while sign only signs an existing CSR, and they require different capabilities on different paths.

13
Multi-Selectmedium

A Vault administrator is building a policy for an application team that needs to manage PKI certificates issued by the 'pki_int' intermediate mount. The team must be able to generate new certificates from the 'web-server' role and revoke certificates, but must not be able to modify the role, generate a root CA, or configure the mount. (Choose two.)

Select 2 answers
A.path "pki_int/issue/web-server" { capabilities = ["create", "update"] }
B.path "pki_int/root/generate/internal" { capabilities = ["create", "update"] }
C.path "pki_int/revoke" { capabilities = ["create", "update"] }
D.path "pki_int/config/*" { capabilities = ["create", "update"] }
E.path "pki_int/roles/web-server" { capabilities = ["create", "update"] }
AnswersA, C

Issuing a certificate against a PKI role is performed by writing to the issue endpoint, so create and update on pki_int/issue/web-server permits generating certificates for that role only. It does not allow altering the role definition, touching other roles, or generating root material, which keeps the team within the intended boundary while satisfying the certificate-generation requirement.

Why this answer

Vault PKI separates consuming a role from managing it. Writing to the issue endpoint generates certificates, and writing to the revoke endpoint revokes them, so those two statements cover the operational needs. Role definitions, root generation, and mount configuration are administrative surfaces that must remain outside the team's policy to satisfy the stated restrictions.

Exam trap

The trap here is confusing the path that issues certificates from a role with the path that defines the role, and granting write access to the definition.

14
MCQeasy

A junior administrator writes a policy file and applies it with 'vault policy write app-read app-read.hcl'. Later, a token created against this policy can read secrets it was never meant to see. The administrator wants to confirm exactly what the policy grants before rotating credentials. Which command displays the parsed, effective rules of the stored policy?

A.vault policy list
B.vault policy read app-read
C.vault read sys/policy/app-read
D.vault token capabilities app-read
AnswerB

The policy read subcommand fetches the named policy from Vault's storage and prints its contents exactly as the server has parsed and stored it. Because it reads the server-side copy rather than the local file, it reveals any drift between the HCL on disk and what is actually enforced, which is precisely what the administrator needs before rotating credentials.

Why this answer

Stored policies are inspected with the dedicated policy read subcommand, which returns the server-side document as parsed, exposing any difference from the local HCL file. Listing policies only yields names, the raw sys endpoint returns an opaque string, and the capabilities subcommand requires a token and a path rather than a policy name.

Exam trap

The trap here is assuming the local HCL file is authoritative, when the server may hold a different version that was written earlier or overwritten by another operator.

15
MCQmedium

An administrator is troubleshooting a policy where a token unexpectedly has permission to read 'secret/data/finance/payroll' even though the attached policy only contains a statement for 'secret/data/hr/*'. The administrator confirms the policy is attached correctly and the path is not covered by any wildcard in it. What is the most likely explanation?

A.Wildcard matching in Vault is greedy, so the hr wildcard also matches sibling prefixes like finance.
B.Reading a KV v2 secret requires only the metadata path, so the finance secret is exposed through an unrelated metadata grant.
C.The policy was written with a trailing wildcard that Vault silently strips, leaving a root-level grant.
D.The token also has the default policy or another policy attached that contains a matching statement for the finance path.
AnswerD

Vault merges all policies attached to a token, and permissions are additive, so any additional policy with a statement covering the finance path grants the access regardless of what the hr policy says. The default policy is commonly attached automatically and may include broad read paths in some configurations, and operators often overlook extra policies during troubleshooting. Inspecting the token's full policy list resolves the discrepancy.

Why this answer

Vault authorization is the union of every policy attached to the token, and a single matching statement anywhere in that set is enough to allow a request. A policy scoped to the hr prefix cannot grant finance access by itself, so the presence of extra policies, including the default policy, is the logical explanation. Auditing the token's complete policy list confirms it.

Exam trap

The trap here is assuming a single policy determines access, when Vault grants permissions as the union of all policies attached to the token.

16
MCQeasy

A policy must allow a user to revoke their own token. Which endpoint and capability are required?

A.path "auth/token/revoke" { capabilities = ["update"] }
B.path "auth/token/revoke-self" { capabilities = ["write"] }
C.path "sys/leases/revoke" { capabilities = ["update"] }
D.path "auth/token/revoke-self" { capabilities = ["update"] }
AnswerD

The revoke-self endpoint operates on the caller's own token, identified from the client token supplied with the request. Because it modifies token state rather than reading it, the policy requires the update capability on that exact path, letting users invalidate their own token without broader revoke permissions.

Why this answer

To allow a user to revoke their own token, the policy must grant the 'update' capability on the 'auth/token/revoke-self' endpoint. Vault's token revocation for self uses the update capability on that specific path, not write or the general revoke endpoint.

Exam trap

VA-003 often tests the exact capability required for Vault token endpoints — candidates confuse 'write' with 'update' and pick the wrong endpoint like auth/token/revoke instead of revoke-self.

How to eliminate wrong answers

Option A is wrong because 'auth/token/revoke' is for revoking other tokens (requires sudo/root or specific policies) and uses update, but it does not target self-revocation. Option B is wrong because 'auth/token/revoke-self' requires the 'update' capability, not 'write' — Vault's token endpoints use update for these operations. Option C is wrong because 'sys/leases/revoke' is for revoking leases by lease ID, not for self-token revocation, and it requires sudo.

17
Multi-Selectmedium

An organization is creating Vault policies to manage access to secrets across multiple application teams. According to HashiCorp best practices, which two approaches should be taken when designing policies? (Choose two.)

Select 2 answers
A.Avoid using negative capabilities (deny) when possible.
B.Grant maximum permissions initially and then restrict as needed.
C.Use a single all-encompassing policy for each environment.
D.Use path templating to incorporate entity metadata.
E.Name policies based on the application or team they serve.
AnswersD, E

Templating reduces duplication and ties access to identity attributes.

Why this answer

HashiCorp recommends using path templating with entity metadata (e.g., {{identity.entity.metadata.team}}) to dynamically scope policies to specific teams or applications. This approach reduces policy sprawl and ensures that permissions are automatically applied based on the authenticated entity's attributes, aligning with the principle of least privilege.

Exam trap

HashiCorp often tests candidates' understanding that Vault policies are purely additive (no deny) and that path templating is a key best practice for scaling policy management across multiple teams, tempting candidates to select 'avoid deny' or 'single policy' due to familiarity with other IAM systems.

18
MCQeasy

Refer to the exhibit. A user with this policy tries to write a new secret to "secret/data/production/db". What will happen?

A.The write succeeds if the secret already exists.
B.The write succeeds because the path matches.
C.The write fails because the policy only allows read on production.
D.The write fails because the user does not have list capability.
AnswerC

The policy grants only read capability on the production path, so any write operation is denied by Vault's default-deny posture. Creating a secret at "secret/data/production/db" requires create or update capability on that exact path, which the policy omits, causing the write to fail.

Why this answer

The policy only grants 'read' capability on the 'secret/data/production/*' path, which allows reading secrets but not creating or updating them. Writing a new secret requires 'create' or 'update' capabilities (or 'write' which encompasses both). Since the policy lacks these capabilities, the write operation fails regardless of whether the secret already exists.

Exam trap

A common misunderstanding in HashiCorp Vault is that path matching alone is sufficient for an operation to succeed, overlooking that each capability (e.g., read, create, update) must be explicitly granted in the policy.

How to eliminate wrong answers

Option A is wrong because even if the secret already exists, the policy does not grant 'update' capability, so the write fails. Option B is wrong because the path matches, but capability matching is also required; the policy only allows 'read', not 'write'. Option D is wrong because the failure is due to missing 'create'/'update' capability, not missing 'list' capability; 'list' is irrelevant for a write operation.

19
MCQhard

A company uses Vault's Kubernetes authentication method to provide secrets to pods. Pods in the 'production' namespace need to read secrets from the path 'secret/data/app/prod'. The administrator has created a Vault role that maps the service account to a policy with capabilities ['read', 'list'] on path 'secret/data/app/*'. However, pods report 'permission denied' when trying to read the secrets. The administrator verifies that the service account has the correct Vault role attached and that the Vault token is being used correctly. What is the most likely cause?

A.The Vault mount for 'secret' is KV v1, so the path should be 'secret/app/prod' without 'data'.
B.The policy should include the 'sudo' capability.
C.The pods are using a token with insufficient TTL.
D.The Vault role is not bound to the correct Kubernetes namespace.
AnswerA

KV v2 inserts a mandatory `data/` segment between the mount and the secret path, so a policy written for the v2 layout cannot match a v1 mount. The role's policy grants `secret/data/app/*`, which never matches the actual v1 path `secret/app/prod`, producing the permission denied. Correcting the path to omit `data` resolves it.

Why this answer

The most likely cause is that the Vault mount for 'secret' is using KV v1, which does not use the 'data' segment in the path. The policy is written with 'secret/data/app/*' (KV v2 path), but because the mount is KV v1, the actual path is 'secret/app/prod'. This path mismatch leads to 'permission denied' because the policy does not apply to the correct path.

Exam trap

HashiCorp Vault often tests the distinction between KV v1 and KV v2 path structures, trapping candidates who assume all 'secret' mounts use the same path format without checking the engine version.

How to eliminate wrong answers

Option B is wrong because the 'sudo' capability is not required for reading secrets; it is used for privileged operations like updating mount configurations or policies, not for standard read/list actions. Option C is wrong because insufficient TTL would cause token expiration, not a 'permission denied' error; the token is being used correctly as verified, so TTL is not the issue. Option D is wrong because the administrator has already verified that the service account has the correct Vault role attached, implying the role binding to the Kubernetes namespace is correct; the error stems from path structure, not namespace binding.

20
MCQhard

A Vault administrator is writing a policy that uses a templated path to allow each user to access their own secrets. The policy is: path "secret/data/users/{{identity.entity.id}}/*" { capabilities = ["read", "list"] } When a user with entity ID "1234" attempts to read 'secret/data/users/1234/profile', they receive a permission denied error. The secret exists, and the user's token has this policy attached. What is the most likely reason for the failure?

A.Templated policies are only supported in Vault Enterprise, not in Vault Open Source.
B.The policy path uses 'identity.entity.id' but the token is not associated with an entity, so the template cannot be resolved.
C.The template variable 'identity.entity.id' is incorrect; it should be 'identity.entity.id' without the curly braces.
D.The policy must use 'identity.entity.name' instead of 'identity.entity.id' to match the user's entity ID.
AnswerB

Templated policies rely on the token being associated with an entity. If the token is not linked to an entity (e.g., a token created without an entity), the template variable cannot be resolved, and the path becomes invalid, resulting in a permission denied error. The user must have an entity and the token must be tied to it.

Why this answer

Templated policies require the token to be associated with an entity. If the token lacks an entity association, the template variable cannot be resolved, and Vault denies access. The user must have an entity in the identity store, and the token must be linked to that entity.

This is a common oversight when using templated policies.

Exam trap

The trap here is assuming that templated policies work with any token, when in fact they require the token to be associated with an entity for the template to resolve.

21
MCQmedium

An administrator wants to create a policy that grants the ability to list all authentication methods enabled on the Vault server. Which path and capability are required?

A.path "sys/auth" { capabilities = ["list"] }
B.path "sys/auth" { capabilities = ["read", "list"] }
C.path "sys/auth" { capabilities = ["read"] }
D.path "auth/*" { capabilities = ["list"] }
AnswerA

Listing enabled auth methods queries the sys/auth endpoint, which enumerates mounted authentication backends. The list capability on that path is the minimum privilege required; read or sudo would not permit enumerating mounts, and other paths expose unrelated secrets.

Why this answer

Option A. To list all enabled authentication methods, the required path is 'sys/auth' with the 'list' capability. The 'list' action returns the names of all auth methods.

Option B is incorrect because it includes 'read', which is unnecessary and not required for listing. Option C is also incorrect because it only has 'read', which would only retrieve a specific method if the name is known. Option D uses a wildcard 'auth/*', which would grant list capability on all sub-paths under 'auth/', but the standard path for listing auth methods is 'sys/auth'.

Therefore, option A is the most precise and correct.

22
MCQmedium

A team maintains a shared policy that many tokens reference. An administrator needs to add a new path stanza to the policy while preserving every existing rule, without risking a typo that silently removes access. Which approach is correct?

A.Edit the existing HCL to append the new stanza, then run 'vault policy write shared-policy shared-policy.hcl' to replace the policy with the complete updated document.
B.Delete the policy with 'vault policy delete shared-policy', recreate it with the additional stanza, and let Vault reattach it to all dependent tokens automatically.
C.Run 'vault policy write shared-policy -' and pipe in only the new stanza, because Vault merges the submitted document with the stored policy.
D.Run 'vault policy patch shared-policy' with the new stanza, since the patch subcommand performs a partial update of an existing policy.
AnswerA

Because policy write performs a full replacement, the safe procedure is to start from the current complete document, add the new stanza, and submit the whole file. The stored policy then contains the old rules plus the addition, and dependent tokens continue to work with their existing ACLs.

Why this answer

Policy writes in Vault are full replacements, not merges or patches. The reliable method is to retrieve the current document, append the new stanza locally, and write the complete file back so every prior rule is preserved. Deleting and recreating the policy does not propagate changes to already-issued tokens, and no patch subcommand exists.

Exam trap

The trap here is expecting merge or patch semantics from the policy write command, when it actually overwrites the entire stored document.

23
MCQmedium

A developer has a policy that grants 'create' capability on path 'secret/data/team/*'. They successfully create a new secret using 'vault kv put secret/data/team/db', but when they try to update the same secret with new data, they get a permission denied error. What is the most likely cause?

A.The developer does not have the 'create' capability on the parent path.
B.The policy does not include the 'update' capability, which is required for modifying existing secrets.
C.The policy needs the 'list' capability on the path.
D.The developer's token lacks the 'sudo' capability for updates.
AnswerB

Vault's key-value v2 secrets engine treats creation and modification as distinct operations. The 'create' capability permits the initial write to a new path, but updating an existing secret requires the separate 'update' capability, which the policy omits, causing the permission denied error.

Why this answer

In Vault, the 'kv put' command performs a 'create' operation when the secret does not exist, but an 'update' operation when it does. The policy only grants 'create' capability on 'secret/data/team/*', which allows the initial write but not subsequent modifications. To update an existing secret, the policy must also include the 'update' capability on the same path, as Vault's ACL system enforces separate capabilities for creating and updating secrets.

Exam trap

A common misconception in Vault is that 'kv put' is a single operation, when in fact Vault treats the first write as 'create' and subsequent writes as 'update', requiring separate capabilities in the policy.

How to eliminate wrong answers

Option A is wrong because the developer successfully created the secret, which requires 'create' capability on the exact path 'secret/data/team/db' — the parent path 'secret/data/team/*' is irrelevant since the policy already covers the child path. Option C is wrong because the 'list' capability is only needed for listing secrets under a path (e.g., 'vault kv list'), not for updating an existing secret. Option D is wrong because Vault does not require 'sudo' capability for updates; 'sudo' is a special capability for certain privileged operations (e.g., writing to 'sys/') and is unrelated to KV secret updates.

24
MCQhard

A Vault policy includes the following statement: path "secret/data/+/app" { capabilities = ["read"] }. Which paths would match this policy? (Assume KV v2)

A.secret/data/team-a/app/db
B.secret/data/team-a/team-b/app
C.secret/data/app
D.secret/data/team-a/app
AnswerD

In Vault KV v2, the API path inserts data/ between the mount and the key. The single + wildcard matches exactly one path segment, so secret/data/team-a/app satisfies secret/data/+/app, while deeper or shallower paths do not.

Why this answer

In Vault KV v2, the path structure is `secret/data/<path>`, and the `+` glob matches a single path segment. The policy `secret/data/+/app` matches exactly one segment between `data/` and `/app`. Option D, `secret/data/team-a/app`, has a single segment `team-a` before `app`, so it matches.

Options with additional segments (A, B) or missing the required segment (C) do not match.

Exam trap

The glob pattern `+` matches exactly one path segment. In KV v2, the path must include the `data/` prefix. Candidates may mistakenly believe that `+` can match multiple segments (like `*`) or that the `data/` prefix is not required, but this question tests both concepts.

How to eliminate wrong answers

Option A is wrong because `secret/data/team-a/app/db` has two segments after `data/` (`team-a/app/db`), and the `+` glob matches only one segment, so the extra `/db` segment causes a mismatch. Option B is wrong because `secret/data/team-a/team-b/app` has three segments after `data/` (`team-a/team-b/app`), exceeding the single-segment match of `+`. Option C is wrong because `secret/data/app` has zero segments between `data/` and `app`; the `+` requires exactly one segment, so this path does not match.

25
MCQhard

A Vault cluster has several policies. One policy, "app-policy", contains: path "secret/data/app/*" { capabilities = ["create", "update"] }. Another policy, "admin-policy", includes: path "secret/data/app/db" { capabilities = ["deny"] }. A token is attached with both policies. Can the token write to "secret/data/app/db"?

A.No, because the paths conflict.
B.No, because deny takes precedence over allow.
C.Yes, because policies are additive.
D.Yes, because the first policy allows create/update.
AnswerB

Deny capabilities override any granted capabilities in Vault's policy evaluation, regardless of policy order or token attachment. Because "admin-policy" explicitly denies "secret/data/app/db", the token cannot write there even though "app-policy" grants create and update on the wildcard path. The explicit deny constraint in the stem therefore blocks the write.

Why this answer

B is correct because in Vault, the 'deny' capability takes precedence over all other capabilities. When a token has multiple policies attached, Vault evaluates all matching paths and applies the most restrictive result. Since 'admin-policy' explicitly denies access to 'secret/data/app/db', the token cannot write to that path, regardless of the 'create' and 'update' capabilities granted by 'app-policy'.

Exam trap

A common pitfall in Vault is assuming that policies are purely additive, overlooking that a 'deny' capability in any matching policy overrides all other capabilities.

How to eliminate wrong answers

Option A is wrong because path conflicts are resolved by capability precedence, not by blocking the operation outright; Vault uses a most-restrictive model where 'deny' overrides all allows. Option C is wrong because while policies are additive for non-conflicting capabilities, 'deny' is not additive—it is an absolute override that negates any allow on the same path. Option D is wrong because the first policy's 'create' and 'update' capabilities are overridden by the explicit 'deny' in the second policy; Vault does not use a first-match or additive model when 'deny' is present.

26
MCQmedium

A security administrator wants to create a policy that allows a service to renew its own token and list its own token capabilities, but not create new tokens. Which policy statements should be included?

A.path "auth/token/renew-self" { capabilities = ["update"] }; path "auth/token/capabilities-self" { capabilities = ["read"] }
B.path "auth/token/renew-self" { capabilities = ["create"] }; path "auth/token/lookup-self" { capabilities = ["read"] }
C.path "auth/token/renew-self" { capabilities = ["update"] }; path "auth/token/capabilities-self" { capabilities = ["update"] }
D.path "auth/token/renew" { capabilities = ["update"] }; path "auth/token/capabilities" { capabilities = ["read"] }
AnswerA

Renewing a token maps to the update capability on `auth/token/renew-self`, while listing capabilities requires read on `auth/token/capabilities-self`. Both paths are self-scoped, so the service acts only on its own token, satisfying the constraint that it must not create new tokens.

Why this answer

It uses the correct endpoints and capabilities: update for renew-self and read for capabilities-self. Option B uses create for renew-self, which is incorrect (renew-self requires update). Option C uses update for capabilities-self, which is wrong (capabilities-self requires read).

Option D uses non-self endpoints (renew and capabilities) which would allow renewing or checking capabilities of any token, granting broader privileges than intended.

Ready to test yourself?

Try a timed practice session using only Create Vault policies questions.