Which of the following Vault policies will allow a Vault client to read a secret stored at secrets/applications/app01/api_key?
Answer(s): C
Comprehensive and Detailed in DepthThis question requires identifying a policy that permits reading the secret at secrets/applications/app01/api_key. Vault policies use paths and capabilities to control access. Let's evaluate:A: path "secrets/applications/" { capabilities = ["read"] allowed_parameters = { "certificate" = [] } } This policy allows reading at secrets/applications/, but not deeper paths like secrets/applications/app01/api_key. The allowed_parameters restriction is irrelevant for reading secrets. Incorrect.B: path "secrets/*" { capabilities = ["list"] }The list capability allows listing secrets under secrets/, but not reading their contents. Reading requires the read capability. Incorrect.C: path "secrets/applications/+/api_*" { capabilities = ["read"] } The + wildcard matches one segment (e.g., app01), and api_* matches api_key. This policy grants read access to secrets/applications/app01/api_key. Correct.D: path "secrets/applications/app01/api_key/*" { capabilities = ["update", "list", "read"] } This policy applies to subpaths under api_key/, not the exact path api_key. It includes read, but the path mismatch makes it incorrect for this specific secret.Overall Explanation from Vault Docs:"Wildcards (*, +) allow flexible path matching... read capability is required to retrieve secret data." Option C uses globbing to precisely target the required path.
https://developer.hashicorp.com/vault/tutorials/policies/policies
You want to encrypt a credit card number using the Transit secrets engine. You enter the following command and receive an error. What can you do to ensure that the credit card number is properly encrypted and the ciphertext is returned?$ vault write -format=json transit/encrypt/creditcards plaintext="1234 5678 9101 1121" Error: * illegal base64 data at input byte 4
Answer(s): A
Comprehensive and Detailed in DepthThe error indicates a problem with the plaintext input format. Let's analyze:A: The Transit engine requires plaintext to be base64-encoded for safe transport, as it may include non-text data. The error illegal base64 data occurs because "1234 5678 9101 1121" isn't base64- encoded. Correct: use plaintext=$(base64 <<< "1234 5678 9101 1121").B: Permission errors would return a 403, not a base64 error. Incorrect.C: Transit supports encrypting sensitive data like credit card numbers. Incorrect.D: Spaces aren't the issue; the format must be base64. Incorrect.Overall Explanation from Vault Docs:"When you send data to Vault for encryption, it must be base64-encoded plaintext... This ensures safe transport of binary or text data."
https://developer.hashicorp.com/vault/docs/secrets/transit#usage
Which of the following token attributes can be used to renew a token in Vault (select two)?
Answer(s): B,D
Comprehensive and Detailed in DepthToken renewal extends a token's TTL. Let's evaluate:A: TTL - Defines expiration time, not used for renewal. Incorrect.B: Token ID - The token's unique identifier; can be specified to renew it (e.g., vault token renew <token-id>). Correct.C: Identity policy - Relates to access control, not renewal. Incorrect.D: Token accessor - A unique identifier for operations like renewal without exposing the token (e.g., vault token renew -accessor <accessor>). Correct.Overall Explanation from Vault Docs:"Tokens can be renewed with vault token renew using either the token ID or accessor... TTL is not an attribute for renewal."
https://developer.hashicorp.com/vault/docs/commands/token/renew#token-renew
When generating dynamic credentials, Vault also creates associated metadata, including information like time duration, renewability, and more, and links it to the credentials. What is this referred to as?
Comprehensive and Detailed in DepthA: Secrets are the credentials themselves, not the metadata. Incorrect.B: Tokens authenticate clients, not the metadata for credentials. Incorrect.C: A lease is metadata tied to dynamic secrets, managing their lifecycle (TTL, renewability). Correct.D: Secrets engines generate secrets, not the metadata. Incorrect.Overall Explanation from Vault Docs:"With every dynamic secret... Vault creates a lease: metadata containing TTL, renewability, etc."
https://developer.hashicorp.com/vault/docs/concepts/lease
You are using an orchestrator to deploy a new application. Even though the orchestrator creates a new AppRole secret ID, security requires that only the new application has the combination of the role ID and secret ID. What feature can you use to meet these requirements?
Answer(s): B
Comprehensive and Detailed in DepthA: Exposes the secret ID, violating the requirement. Incorrect.B: Response wrapping delivers the secret ID in a single-use token, ensuring only the application unwraps it. Correct.C: Batch tokens don't address secret ID delivery security. Incorrect.D: TLS secures communication but doesn't restrict access to the secret ID. Incorrect.Overall Explanation from Vault Docs:"Response wrapping... wraps the secret in a single-use token, ensuring only the intended recipient unwraps it."
https://developer.hashicorp.com/vault/tutorials/auth-methods/approle
Post your Comments and Discuss HashiCorp HCVA0-003 exam prep with other Community members: