003 · Domain 9: Access management architecture · 5% of the exam
Task 9.1: Describe the Vault Agent
A client daemon with auto-auth and sinks, templates rendered from secrets, caching, process supervisor mode, the Kubernetes agent injector, and Vault Proxy for API proxying.
Study it
Vault Agent: auto-auth, templates, caching and process supervisor mode
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 2
Which two features does Vault Agent provide? (Choose TWO.)
ASyncing Vault secrets into Kubernetes Secret objects
BAuto-auth, which logs in and keeps the resulting token renewed
CTemplates that render secrets into files for an application
DUnsealing Vault server nodes when they start
EServing as the recommended proxy for Vault's API
Show the answer and why
ASyncing Vault secrets into Kubernetes Secret objects
Incorrect
Writing Kubernetes Secrets is what the Vault Secrets Operator does.
BAuto-auth, which logs in and keeps the resulting token renewed
Correct
Auto-auth authenticates to Vault and manages token renewal.
CTemplates that render secrets into files for an application
Correct
Agent renders user-supplied templates using the auto-auth token.
DUnsealing Vault server nodes when they start
Incorrect
Unsealing is done by the server's seal, either Shamir shares or auto unseal.
EServing as the recommended proxy for Vault's API
Incorrect
Agent's API proxy is deprecated, so Agent is not the recommended proxy.
Vault Agent is a client daemon: auto-auth, templating, caching and process supervisor mode bring secrets to applications that do not call Vault themselves.
A legacy application on a virtual machine reads its database credentials from a configuration file and cannot be changed to call Vault. The credentials come from the database secrets engine and must be renewed and written again to the file for as long as the application runs. Which setup fits?
AVault Proxy with auto-auth and caching, with the application pointed at the proxy's listener address
BThe Vault Secrets Operator syncing the credentials to a secret
CVault Agent with a template for the file and exit_after_auth set to true
DVault Agent with auto-auth and a template that renders the credentials into the file
Show the answer and why
AVault Proxy with auto-auth and caching, with the application pointed at the proxy's listener address
Incorrect
Vault Proxy renders no files, and the application cannot call an API.
BThe Vault Secrets Operator syncing the credentials to a secret
Incorrect
The operator syncs into Kubernetes Secrets; it does not run on a plain virtual machine.
CVault Agent with a template for the file and exit_after_auth set to true
Incorrect
With exit_after_auth the agent stops after the first render, so nothing renews or rewrites the file.
DVault Agent with auto-auth and a template that renders the credentials into the file
Correct
Agent logs in, renews its token and leases, and re-renders templates, so the application keeps reading a file.
Templates plus auto-auth are the standard path for applications that read files; the agent keeps the token and leases alive behind them.
Vault Agent uses AppRole auto-auth with role_id_file_path and secret_id_file_path. Shortly after the agent starts, the SecretID file is gone from the host, yet the agent keeps logging in and renewing. What explains this?
AThe SecretID expired, and Vault removed the file from the host
BA template rendered over the SecretID file with its first secret
CThe agent moved the SecretID into a cubbyhole for safekeeping
DBy default the agent deletes the SecretID file after reading it
Show the answer and why
AThe SecretID expired, and Vault removed the file from the host
Incorrect
Vault cannot touch files on a client host; the agent removed it.
BA template rendered over the SecretID file with its first secret
Incorrect
Templates write to their own destination paths.
CThe agent moved the SecretID into a cubbyhole for safekeeping
Incorrect
Auto-auth caches the values in the agent; it does not store them in Vault.
DBy default the agent deletes the SecretID file after reading it
Correct
remove_secret_id_file_after_reading defaults to true; the agent caches the value and reads any new file at the next authentication.
Set remove_secret_id_file_after_reading to false to keep the file; new files written at the same path are picked up at the next authentication.
A Kubernetes CronJob uses the Vault Agent injector. Its pods never finish, because the agent sidecar keeps running after the job's work is done. Which annotation fixes this?