Free HashiCorp HCVA0-003 Exam Questions (page: 13)

After encrypting data using the Transit secrets engine, you've received the following output.
Which of the following is true based on the output displayed below? Key: ciphertext Value:
vault:v2:45f9zW6cglbrzCjI0yCyC6DBYtSBSxnMgUn9B5aHcGEit71xefPEmmjMbrk3

  1. The original encryption key has been rotated at least once
  2. The data is stored in Vault using a KV v2 secrets engine
  3. This is the second version of the encrypted data
  4. Similar to the KV secrets engine, the Transit secrets engine was enabled using the transit v2 option

Answer(s): A

Explanation:

Comprehensive and Detailed in Depth
A: v2 shows the key was rotated once. Correct.
B: Transit doesn't store data. Incorrect.
C: v2 is the key version, not data version. Incorrect.
D: No transit v2 option exists. Incorrect.
Overall Explanation from Vault Docs:
"Ciphertext is prepended with the key version (e.g., v2)... Indicates rotation."


Reference:

https://developer.hashicorp.com/vault/tutorials/encryption-as-a-service/eaas- transit#rotate-the-encryption-key



What could you do with the feature found in the screenshot below (select two)?

  1. Using a short TTL, you could encrypt data in order to place only the encrypted data in Vault
  2. Encrypt the Vault master key that is stored in memory
  3. Encrypt sensitive data to send to a colleague over email
  4. Use response-wrapping to protect data

Answer(s): C,D

Explanation:

Comprehensive and Detailed in Depth
The screenshot highlights Vault's response wrapping feature, accessible via the UI's "Wrap" option.

This feature wraps a Vault response (e.g., a secret or token) in a single-use token with a configurable TTL, ensuring secure delivery to an intended recipient. Let's evaluate each option against this capability:
Option A: Using a short TTL, you could encrypt data in order to place only the encrypted data in Vault This misinterprets response wrapping. Wrapping doesn't encrypt data for storage in Vault; it secures a response for transmission outside Vault. Encryption for storage would involve the Transit secrets engine, not wrapping. The TTL in wrapping limits the wrapped token's validity, not the data's encryption lifecycle. This option conflates two unrelated features and is incorrect. Vault Docs Insight: "Response wrapping does not store data in Vault; it delivers it securely to a recipient." (No direct storage implication.)
Option B: Encrypt the Vault master key that is stored in memory The master key in Vault is already encrypted at rest (in storage) and decrypted in memory during operation using the unseal process (e.g., Shamir shares or auto-unseal). Response wrapping doesn't interact with the master key--it's a client-facing feature for secret delivery, not an internal encryption mechanism. This is a fundamental misunderstanding of Vault's architecture and wrapping's purpose. Incorrect.
Vault Docs Insight: "The master key is managed by the seal mechanism, not client-facing features like wrapping." (See seal/unseal docs.)
Option C: Encrypt sensitive data to send to a colleague over email This aligns perfectly with response wrapping. You can retrieve a secret (e.g., vault read secret/data/my-secret), wrap it with a short TTL (e.g., 5 minutes), and receive a token (e.g., hvs.<token>). You email this token to a colleague, who unwraps it with vault unwrap <token> to access the secret. The data is encrypted within the token, secure during transit, and expires after the TTL. This is a textbook use case for wrapping. Correct. Vault Docs Insight: "Response wrapping... can be used to securely send sensitive data to another party, such as over email, with a limited lifetime." (Directly supported use case.) Option D: Use response-wrapping to protect data
This is the essence of the feature. Wrapping protects data by encapsulating it in a single-use token, accessible only via an unwrap operation. For example, vault write -wrap-ttl=60s secret/data/my- secret returns a wrapped token, protecting the secret until unwrapped. This ensures confidentiality and controlled access, making it a core benefit of the feature. Correct. Vault Docs Insight: "Vault can wrap a response in a single-use token... protecting the data until unwrapped by the recipient." (Core definition.)
Detailed Mechanics:
Response wrapping works by taking a Vault API response (e.g., a secret's JSON payload) and storing it in the cubbyhole secrets engine under a newly generated single-use token. The token's TTL (e.g., 60s) limits its validity. The API call POST /v1/sys/wrapping/wrap with a payload (e.g., {"ttl": "60s", "data": {"key": "value"}}) returns {"wrap_info": {"token": "hvs.<token>"}}. The recipient uses vault unwrap hvs.<token> (or POST /v1/sys/wrapping/unwrap) to retrieve the original data. Once unwrapped, the token is revoked, ensuring one-time use. This leverages Vault's encryption and token system for secure data exchange.
Real-World Example:
You generate an API key in Vault: vault write secret/data/api key=abc123. In the UI, you click "Wrap" with a 5-minute TTL, getting hvs.XYZ. You email hvs.XYZ to a colleague, who runs vault unwrap hvs.XYZ within 5 minutes to get key=abc123. After unwrapping, the token is invalid, and the secret is safe from interception.
Overall Explanation from Vault Docs:
"Vault includes a feature called response wrapping.
When requested, Vault can take the response it would have sent to an HTTP client and instead insert it into the cubbyhole of a single-use token, returning that token instead... This is useful for securely delivering sensitive data." The feature excels at protecting data in transit (e.g., email) and enforcing one-time access, not internal key management or storage encryption.


Reference:

https://developer.hashicorp.com/vault/docs/concepts/response-wrapping Additional

https://developer.hashicorp.com/vault/docs/secrets/cubbyhole



From the options below, select the benefits of using the PKI (x.509 certificates) secrets engine (select three):

  1. TTLs on Vault certs are longer to ensure certificates are valid for a longer period of time
  2. Reducing, or eliminating certificate revocations
  3. Reduces time to get a certificate by eliminating the need to generate a private key and CSR
  4. Vault can act as an intermediate CA

Answer(s): B,C,D

Explanation:

Comprehensive and Detailed in Depth
The PKI secrets engine in Vault generates dynamic X.509 certificates, acting as a certificate authority (CA) to streamline certificate management. Let's assess each option based on its documented benefits:
Option A: TTLs on Vault certs are longer to ensure certificates are valid for a longer period of time This is misleading. Vault's PKI engine allows configurable TTLs, but the recommendation is for short TTLs (e.g., hours or days) to reduce the need for revocation and enhance security. Long TTLs increase exposure if a certificate is compromised, requiring revocation and larger Certificate Revocation Lists (CRLs). The engine's benefit isn't longer validity--it's flexibility and automation, not extended lifetimes. Incorrect.
Vault Docs Insight: "By keeping TTLs relatively short, revocations are less likely... helping scale to large workloads." (Short TTLs are preferred.)
Option B: Reducing, or eliminating certificate revocations A key advantage of the PKI engine is issuing short-lived certificates. With short TTLs (e.g., 24h), certificates expire naturally before revocation is needed, minimizing CRL maintenance. For example, an app can fetch a new cert daily, reducing revocation events compared to traditional multi-year certs. This aligns with Vault's ephemeral certificate model. Correct. Vault Docs Insight: "By keeping TTLs relatively short, revocations are less likely to be needed, keeping CRLs short..." (Direct benefit.)
Option C: Reduces time to get a certificate by eliminating the need to generate a private key and CSR Traditionally, obtaining a certificate involves generating a private key, creating a Certificate Signing Request (CSR), and submitting it to a CA--a manual, time-consuming process. The PKI engine automates this: vault write pki/issue/my-role common_name=app.example.com instantly generates a private key and signed certificate. This eliminates manual steps, speeding up issuance significantly.
Correct.
Vault Docs Insight: "Services can get certificates without... generating a private key and CSR, submitting to a CA, and waiting..." (Automation reduces time.)

Option D: Vault can act as an intermediate CA
The PKI engine can be configured as an intermediate CA, signed by a root CA (internal or external). For example, vault write pki/intermediate/generate/internal common_name="Intermediate CA" creates an intermediate, which can issue certificates under a trust chain. This supports hierarchical PKI setups, a major feature. Correct.
Vault Docs Insight: "The PKI secrets engine can act as an intermediate CA... issuing certificates on behalf of a root CA." (Explicit capability.)
Detailed Mechanics:
The PKI engine operates at paths like pki/ (root) or pki_int/ (intermediate). Roles (e.g., my-role) define parameters like TTL and allowed domains. Issuing a cert (vault write pki/issue/my-role...) returns a JSON payload with certificate, private_key, and issuing_ca. Short TTLs leverage Vault's lease system, auto-revoking certs on expiry. As an intermediate CA, it signs certificates with its key,

validated against a root, enhancing trust management.
Real-World Example:
An app needs a cert: vault write pki/issue/web common_name=web.example.com ttl=24h. Vault returns a cert and key instantly, valid for 24 hours. No CSR, no revocation needed--expires tomorrow. Another PKI mount at pki_int/ issues certs under a corporate root CA.
Overall Explanation from Vault Docs:
"The PKI secrets engine generates dynamic X.509 certificates... Services can get certificates without the usual manual process... By keeping TTLs short, revocations are less likely... Vault can act as an intermediate CA, issuing certificates efficiently." These benefits--automation, reduced revocation, and CA flexibility--define its value.


Reference:

https://developer.hashicorp.com/vault/docs/secrets/pki



According to the screenshot below, what auth method did this client use to log in to Vault? (Screenshot shows a lease path: auth/userpass/login/student01)

  1. Userpass
  2. Auth
  3. Root token
  4. Child token

Answer(s): A

Explanation:

Comprehensive and Detailed in Depth
The screenshot provides a lease path: auth/userpass/login/student01, which reveals the authentication method used to generate the token tied to this lease. Vault's auth methods create tokens at specific paths, and the path structure indicates the method.
Option A: Userpass
The path auth/userpass/login/student01 explicitly includes userpass, matching the userpass auth method. This method authenticates users with a username (e.g., student01) and password, typically via vault login -method=userpass username=student01. The /login endpoint confirms a login operation, and the lease ties to the resulting token. This is the clear, correct answer based on the path. Correct.

Vault Docs Insight: "The userpass auth method allows users to authenticate with a username and password... mounted at auth/userpass by default." (Matches the path.) Option B: Auth
"Auth" isn't an auth method--it's the namespace prefix (auth/) for all auth methods in Vault (e.g., auth/token, auth/userpass). The screenshot specifies userpass within auth/, not a generic "auth" method. This option is a misnomer and incorrect.
Vault Docs Insight: "All auth methods are mounted under auth/... `auth' itself is not a method." (Clarifies structure.)
Option C: Root token
A root token is a privileged token type, not an auth method. It's created during Vault initialization or via auth/token/create with root privileges, not through a login path like auth/userpass/login. The screenshot's path indicates a userpass login, not a root token usage. Incorrect.

Vault Docs Insight: "Root tokens are created at initialization... not tied to a specific auth method login path." (Distinct from userpass.)
Option D: Child token
A child token is a token created by a parent token (e.g., via vault token create), not an auth method. The path auth/userpass/login/student01 shows a login event, not a token creation event (which would be auth/token/create). This option confuses token hierarchy with authentication. Incorrect. Vault Docs Insight: "Child tokens are created by parent tokens... not directly via login endpoints." (Different mechanism.)
Detailed Mechanics:
When a user logs in with vault login -method=userpass -path=userpass username=student01, Vault hits the endpoint POST /v1/auth/userpass/login/student01 with a password payload. Success generates a token, and a lease is created at auth/userpass/login/student01 with a TTL. The screenshot's lease path directly reflects this process, pinpointing userpass as the method.
Real-World Example:
Enable userpass: vault auth enable userpass. Add user: vault write auth/userpass/users/student01 password=secret. Login: vault login -method=userpass username=student01. The token's lease appears as auth/userpass/login/student01.
Overall Explanation from Vault Docs:
"The lease shown lives at auth/userpass/login/<username> and indicates the userpass auth method was used to obtain a token... The userpass method authenticates via username/password at its mount path." The path structure is a definitive indicator.


Reference:

https://developer.hashicorp.com/vault/docs/auth/userpass



Viewing page 13 of 73
Viewing questions 49 - 52 out of 285 questions



Post your Comments and Discuss HashiCorp HCVA0-003 exam prep with other Community members:

HCVA0-003 Exam Discussions & Posts