HCVA0-003 practice question 35 of 35

Which of the following policies would permit a user to generate dynamic credentials on a database?

Full set: 285 questions
Answer options
A: path "database/creds/read_only_role" { capabilities = ["generate"] }
B: path "database/creds/read_only_role" { capabilities = ["update"] }
C: path "database/creds/read_only_role" { capabilities = ["list"] }
D: path "database/creds/read_only_role" { capabilities = ["read"] } Correct answer
Correct Answer:
D. path "database/creds/read_only_role" { capabilities = ["read"] }
Explanation

In the Hahicorp Vault Database Secrets Engine, dynamic credentials are not stored at rest but are generated on-demand. The action of requesting a new set of credentials for a specific role is performed by issuing a read operation against the corresponding path, which is database/creds/. Therefore, a policy must grant the read capability on this path to allow a client to trigger the generation and retrieval of these dynamic credentials. The Vault server interprets this read request, connects to the database, creates a new user, and returns the credentials.

Why Incorrect

A. generate is not a valid capability within the Hahicorp Vault policy syntax.
B. The update capability is used for writing or overwriting data at a path, not for generating dynamic credentials from this endpoint.
C. The list capability would be used on the parent path (database/creds/) to discover available roles, not to generate credentials for a specific one.

References

1. HashiCorp Vault Official Documentation, Database Secrets Engine API, "Read Credentials": The documentation for the /database/creds/:name endpoint explicitly states that the HTTP method is GET, which corresponds to the read capability in Vault policies. It notes, "This endpoint generates a new set of dynamic credentials for a given role."

Source: HashiCorp Vault Documentation.

Section: Secrets Engines -> Database -> API -> Read Credentials.

2. HashiCorp Learn, "Dynamic Secrets with Database Secrets Engine" Tutorial: This official tutorial provides a sample policy for a user that needs to fetch database credentials. The policy explicitly uses the read capability.

Source: HashiCorp Learn Platform.

Section: "Step 4: Generate Dynamic Credentials" -> "Policy Requirements". The example policy shown is: path "database/creds/my-role" { capabilities = ["read"] }.

3. HashiCorp Learn, "Vault Policies" Tutorial: This guide explains the fundamental capabilities. It clarifies that the read capability is used to "Allows reading data from the given path." In the context of dynamic secrets, this "read" action triggers the generation mechanism.

Source: HashiCorp Learn Platform.

Section: "Capabilities".

Scroll to Top