VAULT-ASSOCIATE practice question 15 of 15
You have been tasked with writing a policy that will allow read permissions for all secrets at path secret/bar. The users that are assigned this policy should also be able to list the secrets. What should this policy look like?
Full set: 57 questionsThis policy correctly grants the required permissions for the Key/Value (KV) Version 2 secrets engine, which is the modern default. In KV v2, secret data and metadata are stored on separate API paths. To read the content of secrets under secret/bar, a user needs read capability on the secret/data/bar/ path. To list the available secrets under secret/bar, the user requires the list capability on the secret/metadata/bar path. This policy correctly separates these two concerns into the appropriate stanzas, fulfilling all requirements of the request.
A: This policy is missing the list capability and uses an incorrect path (secret/bar) for reading secret data in a KV v2 engine. B: This policy uses an incorrect path for both reading and listing secrets in KV v2. The list capability is required on the metadata path, not the data path. D: This policy applies only to the literal path secret/bar, not the secrets stored under it, and uses incorrect paths for KV v2 operations.
1. HashiCorp Vault Documentation, "KV Secrets Engine - Version 2", Policies section: This document explicitly states the pathing requirements for KV v2. It clarifies: "To perform a list on the secrets at a path, the policy must grant list capability on kv/metadata/." and "To read a version of a secret, the policy must grant read capability on kv/data/." The policy in option C directly implements this guidance.
Source: HashiCorp, Vault Documentation, "KV Secrets Engine", Section: "Policies". Available at: https://developer.hashicorp.com/vault/docs/secrets/kv/kv-v2#policies
2. HashiCorp Learn, "Vault Policies" Tutorial: This guide provides practical examples of policy creation. In the "Build a Vault Policy for the KV secrets engine" section, it demonstrates the distinct paths for data and metadata access in KV v2, reinforcing the structure shown in the correct answer.
Source: HashiCorp Learn, Get Started - Vault, "Vault Policies". Available at: https://developer.hashicorp.com/vault/tutorials/policies/policies (Refer to the KV v2 policy example).
3. HashiCorp Vault Documentation, "Policies" Concepts: This page defines the core components of a Vault policy, including the path and capabilities stanzas. It defines the read capability as allowing data to be read from a path and list as allowing the listing of values at a path, which are the fundamental operations required by the question.
Source: HashiCorp, Vault Documentation, "Concepts - Policies". Available at: https://developer.hashicorp.com/vault/docs/concepts/policies
Keep practicing
Take the free VAULT-ASSOCIATE practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other VAULT-ASSOCIATE practice questions
- Question 1To give a role the ability to display or output all of the end points under the /secrets/…
- Question 4Which of the following cannot define the maximum time-to-live (TTL) for a token?
- Question 6What can be used to limit the scope of a credential breach?
- Question 8What is the Vault CLI command to query information about the token the client is currentl…
- Question 10When unsealing Vault, each Shamir unseal key should be entered:
- Question 11You have a 2GB Base64 binary large object (blob) that needs to be encrypted. Which of the…
