create, read, update, patch, delete and list mapped to HTTP verbs, sudo for root-protected paths, deny that overrides everything, and parameter constraints.
Study it
Capabilities: HTTP verbs, sudo, deny and parameter constraints
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
An application must generate credentials from database/creds/report and renew the leases it receives through sys/leases/renew. Which two capabilities does its policy need? (Choose TWO.)
Aread on database/creds/report
Bcreate on database/creds/report
Cupdate on sys/leases/renew
Dsudo on sys/leases/renew
Elist on database/creds/report
Show the answer and why
Aread on database/creds/report
Correct
Generating credentials is an HTTP GET, and capabilities map to the verb, so it needs read.
Bcreate on database/creds/report
Incorrect
Although credentials are created in the database, the request is a GET, which create does not cover.
Cupdate on sys/leases/renew
Correct
The renew endpoint takes a POST or PUT, which maps to update.
Dsudo on sys/leases/renew
Incorrect
sudo is for root-protected paths; renewing a lease is not one of them.
Elist on database/creds/report
Incorrect
list allows LIST requests that return keys; it does not generate credentials.
Capabilities follow the HTTP verb, not the effect: reading a dynamic secret path creates a credential but needs only read.
An incident team needs a policy that lets it revoke, in one call, every lease issued under aws/creds, and nothing else under sys/. Which stanza meets the requirement?
A team names KV keys after customers' tax IDs. A token has list on the folder but read on only one secret in it. What does a LIST of the folder return?
AEvery key name under it, since list results are not filtered by policy
BOnly the one key the token can read, since Vault trims lists to readable keys
CAn error, because list requires read on every key under the prefix
DThe keys with their values masked
Show the answer and why
AEvery key name under it, since list results are not filtered by policy
Correct
Keys returned by a list are not filtered, so sensitive data must not be encoded in key names.
BOnly the one key the token can read, since Vault trims lists to readable keys
Incorrect
Vault does not trim list results to readable keys.
CAn error, because list requires read on every key under the prefix
Incorrect
list needs only the list capability on the prefix.
DThe keys with their values masked
Incorrect
list returns names only, never values.
Treat key names as visible to anyone with list on the prefix.