VAULT-ASSOCIATE-002 · Question #90
Which path will this policy allow? path "kv/+/team_*" { capabilities = [ "read" ] }
The correct answer is C. kv/us-west/team_edu. The policy path "kv/+/team_*" allows read access to paths within the kv secrets engine where the first segment after kv/ is any single segment, followed by team_ and then any characters.
Question
Options
- Akv/team_edu
- Bkv/us-west/team
- Ckv/us-west/team_edu
- Dkv/us-west/ca/team_edu
How the community answered
(39 responses)- A18% (7)
- B3% (1)
- C72% (28)
- D8% (3)
Why each option
The policy `path "kv/+/team_*"` allows read access to paths within the `kv` secrets engine where the first segment after `kv/` is any single segment, followed by `team_` and then any characters.
`kv/team_edu` is incorrect because the `+` wildcard requires exactly one segment between `kv/` and `team_*`, which `team_edu` does not provide.
`kv/us-west/team` is incorrect because the `*` wildcard in `team_*` requires at least `team_` followed by zero or more characters, but `team` alone does not fulfill this pattern.
In Vault policies, `+` is a wildcard that matches exactly one path segment, and `*` matches zero or more characters within a path segment. Thus, `kv/+/team_*` correctly matches `kv/us-west/team_edu`, as `us-west` matches `+` and `team_edu` matches `team_*`.
`kv/us-west/ca/team_edu` is incorrect because the `+` wildcard matches only *one* path segment, whereas `us-west/ca` represents two segments.
Concept tested: Vault policy path matching (wildcards)
Source: https://developer.hashicorp.com/vault/docs/concepts/policies#path-matching
Topics
Community Discussion
No community discussion yet for this question.