BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp Exam Vault-Associate Topic 3 Question 5 Discussion

Actual exam question for HashiCorp's Vault-Associate exam
Question #: 5
Topic #: 3
[All Vault-Associate Questions]

Which of the following statements are true about Vault policies? Choose two correct answers.

Show Suggested Answer Hide Answer
Suggested Answer: C, E

Vault policies are written in HCL or JSON format and are attached to tokens or roles by name. Policies define the permissions and restrictions for accessing and performing operations on certain paths and secrets in Vault.Policies are deny by default, which means that an empty policy grants no permission in the system, and any request that is not explicitly allowed by a policy is implicitly denied1. Some of the features and benefits of Vault policies are:

Policies are path-based, which means that they match the request path to a set of rules that specify the allowed or denied capabilities, such as create, read, update, delete, list, sudo, etc2.

Policies are additive, which means that if a token or a role has multiple policies attached, the effective policy is the union of all the individual policies.The most permissive capability is granted if there is a conflict3.

Policies can use glob patterns, such as * and +, to match multiple paths or segments with a single rule.For example, path ''secret/*'' matches any path starting with secret/, and path ''secret/+/config'' matches any path with two segments after secret/ and ending with config4.

Policies can use templating to interpolate certain values into the rules, such as identity information, time, randomness, etc.For example, path ''secret/{{identity.entity.id}}/*'' matches any path starting with secret/ followed by the entity ID of the requester5.

Policies can be managed by using the vault policy commands or the sys/policy API endpoints.You can write, read, list, and delete policies by using these interfaces6.

The default policy is a built-in policy that is attached to all tokens by default and cannot be deleted. However, the default policy can be modified by using the vault policy write command or the sys/policy API endpoint.The default policy provides common permissions for tokens, such as renewing themselves, looking up their own information, creating and managing response-wrapping tokens, etc7.

You do not have to use YAML to define policies, as Vault supports both HCL and JSON formats.HCL is a human-friendly configuration language that is also JSON compatible, which means that JSON can be used as a valid input for policies as well8.

Vault does not need to be restarted in order for a policy change to take effect, as policies are stored and evaluated in memory. Any change to a policy is immediately reflected in the system, and any token or role that has that policy attached will be affected by the change.


Contribute your Thoughts:

Farrah
7 months ago
Alright, let's see here. I'm going with C and E as well. Policies are all about controlling access, and the default is to deny everything unless you explicitly allow it. As for the other options, I'm leaning towards A being false - you can definitely modify the default policy. And D is just plain wrong, no need to restart Vault for policy changes.
upvoted 0 times
...
Allene
7 months ago
Haha, yeah, Vault exams are always a fun ride. I think B is a trick question - you can use either YAML or JSON to define policies. And I'm with you guys on C and E being the correct answers. As for the default policy, I'm pretty sure you can modify it, you just have to be careful.
upvoted 0 times
...
Garry
7 months ago
I agree with C and E, those seem pretty straightforward. But I'm not sure about modifying the default policy - I thought that was actually possible. And I'm pretty sure you don't need to restart Vault for policy changes to take effect. This exam loves to throw in trick questions, doesn't it?
upvoted 0 times
Sherita
7 months ago
Absolutely, paying attention to those little details can make all the difference in getting the right answer.
upvoted 0 times
...
Frederick
7 months ago
I know, it's always important to read the questions carefully to catch those tricks.
upvoted 0 times
...
Tawanna
7 months ago
Yeah, this exam definitely likes to keep us on our toes with those tricky questions.
upvoted 0 times
...
Tarra
7 months ago
And you don't need to restart Vault for policy changes to take effect.
upvoted 0 times
...
Tarra
7 months ago
You're correct about those two! The default policy can actually be modified.
upvoted 0 times
...
Doretha
7 months ago
E) Policies deny by default (empty policy grants no permission)
upvoted 0 times
...
Lashawnda
7 months ago
C) Policies provide a declarative way to grant or forbid access to certain paths and operations in Vault
upvoted 0 times
...
...
Abel
7 months ago
Hmm, this is a tricky one. I think the correct answers are C and E - policies provide a declarative way to grant or forbid access, and they deny by default if no permissions are specified. But I'm not totally sure about B, using YAML to define policies. Isn't it also possible to use JSON?
upvoted 0 times
...

Save Cancel