Deny by default, policies attached by name to tokens, least privilege per path, the default and root policies, and changes that apply to existing tokens.
Study it
Why policies: deny by default, least privilege, default and root policies
Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 1
A token was issued an hour ago with the policies default and app-read. An operator now uses vault policy write to remove read on secret/data/app/* from app-read. The token has 20 minutes of TTL left. What happens to its next read of secret/data/app/config?
AIt succeeds until the token is renewed, because rules are copied into the token at login
BIt succeeds until the token expires, because policy changes apply only to new tokens
CIt is denied only after the token is revoked and a new one is issued
DIt is denied, because Vault evaluates the policy's current rules on every request
Show the answer and why
AIt succeeds until the token is renewed, because rules are copied into the token at login
Incorrect
Tokens hold policy names, not copies of the rules; nothing waits for a renewal.
BIt succeeds until the token expires, because policy changes apply only to new tokens
Incorrect
Policy changes take effect for existing tokens on their next request.
CIt is denied only after the token is revoked and a new one is issued
Incorrect
Revocation is needed to change which policies a token has, not to change what a policy contains.
DIt is denied, because Vault evaluates the policy's current rules on every request
Correct
Tokens reference policies by name, and policy contents are parsed whenever the token is used, so the change applies at once.
The set of policy names on a token is fixed at issue, but the rules behind those names are read on every call. Tightening a policy takes effect immediately for all tokens that carry it.
A token carries only the policy app-read, which mentions the single path secret/data/app/*. The token tries to read secret/data/billing/api. What happens?
AThe read succeeds, because a token may read any path no policy denies
BThe read succeeds, because read is granted on all paths by default
CIt is denied, since the policies grant only the paths they name
DThe read returns the path's metadata but not its values
Show the answer and why
AThe read succeeds, because a token may read any path no policy denies
Incorrect
Vault works the other way round: everything is denied unless a policy allows it.
BThe read succeeds, because read is granted on all paths by default
Incorrect
No capability is granted by default; the default policy covers only a few token and cubbyhole paths.
CIt is denied, since the policies grant only the paths they name
Correct
Policies are deny by default, so any path no attached policy allows is refused.
DThe read returns the path's metadata but not its values
Incorrect
A denied request returns a permission error, not partial data.
An empty policy grants no permission. Every allowed action must be named by a policy attached to the token.