Keep policy rule paths within their own directory #158

Merged
benvin merged 4 commits from benvin/policy-path-scope-check into master 2026-09-28 22:12:15 +10:00
Member

Nothing stopped a policy under policies/x/y/ from granting a rule path outside its own directory, so an over-broad grant read as ordinary review noise and only surfaced once applied to Vault.

  • add tests/test_policies.py: a pydantic model rejecting unknown keys, empty rules and non-Vault capabilities
  • check every rule path segment-wise against the policy's own directory, stripping the kv-v2 data/metadata segment
  • relocate the rules that reached outside their directory, carrying capabilities and auth bindings verbatim
  • run the suite from a local pre-commit hook and from make test
Nothing stopped a policy under policies/x/y/ from granting a rule path outside its own directory, so an over-broad grant read as ordinary review noise and only surfaced once applied to Vault. - add tests/test_policies.py: a pydantic model rejecting unknown keys, empty rules and non-Vault capabilities - check every rule path segment-wise against the policy's own directory, stripping the kv-v2 data/metadata segment - relocate the rules that reached outside their directory, carrying capabilities and auth bindings verbatim - run the suite from a local pre-commit hook and from make test
unkin-agent added 1 commit 2026-09-27 17:40:56 +10:00
Check policy rule paths stay in their own directory
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
733d1211b4
unkin-agent added 3 commits 2026-09-28 21:25:33 +10:00
unkin-agent changed title from Check policy rule paths stay within their own directory to Keep policy rule paths within their own directory 2026-09-28 21:25:44 +10:00
benvin merged commit 890d666a53 into master 2026-09-28 22:12:15 +10:00
benvin deleted branch benvin/policy-path-scope-check 2026-09-28 22:12:15 +10:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/terraform-vault#158