Task 2.5: Configure Vault policies using the UI and CLI
vault policy write, read, list, fmt and delete, the sys/policy endpoints, ACL policies in the UI, and checking a token with vault token capabilities.
Study it
Writing and checking policies with the CLI and the UI
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 1
An operator wrote app.hcl, wants to upload it as the policy app-read, and then wants to check what an application's token can do on secret/data/app/config without sending a request to that path. Which pair of commands does this?
A developer wants to know exactly which policy the command vault kv put kv/secret value=x needs before asking an operator for access. What should the developer run?
ARun it again with the -output-policy flag added
Bvault policy fmt on the developer's current policy
Cvault token lookup on the developer's token
Dvault path-help kv/secret
Show the answer and why
ARun it again with the -output-policy flag added
Correct
-output-policy builds a minimal policy that grants what the command needs.
Bvault policy fmt on the developer's current policy
Incorrect
fmt only reformats a policy file.
Cvault token lookup on the developer's token
Incorrect
lookup shows token properties and policy names, not what a command needs.
Dvault path-help kv/secret
Incorrect
path-help explains an endpoint; it does not produce a policy.
-output-policy is the quickest way to draft least-privilege policies for CLI workflows.