Skip to content

Commit 7dfad54

Browse files
authored
VAULT-39667 Add docs for breaking changes to allowed_ and denied_parameters (#1120)
This PR adds documentation about Vault's breaking change to the `allowed_parameters` and `denied_parameters` behavior when comparing list parameters. Jira: [VAULT-39667](https://hashicorp.atlassian.net/browse/VAULT-39667) Internal draft: [Documentation for denied_parameters breaking change](https://docs.google.com/document/d/1FJldPo9Nc2wNjk3j5Zp-sTIJu1yxMCX1ergHrijLd70/edit?tab=t.0) [VAULT-39667]: https://hashicorp.atlassian.net/browse/VAULT-39667?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
2 parents 341dc2e + b172101 commit 7dfad54

File tree

13 files changed

+149
-1
lines changed

13 files changed

+149
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
### Item-by-item list comparison for allowed_parameters and denied_parameters ((#allowed-parameters-list))
2+
3+
| Change | Affected version | Vault edition
4+
| ------------ | ---------------- | -------------
5+
| Breaking | 1.21.0+ | All
6+
7+
Previous versions of Vault only matched list parameters when the associated
8+
policy defined the list as a whole. As a result, Vault allowed lists containing
9+
denied values as long as the policy did not deny that exact list and denied
10+
lists containing allowed values because the policy did not allow the exact list.
11+
12+
Vault now checks each value in a list parameter against allowed/denied values
13+
in the applicable Vault policy and allows or denies requests if the policy
14+
defines the list as a whole or every/any individual element of the list. For
15+
example, if the request includes a list like `['a', 'b', 'c']`, it still matches
16+
to a policy that includes `['a', 'b', 'c']` but also matches to an approve
17+
policy that includes all the individual values `a`, `b`, and `c` or a deny
18+
policy that includes any of the individual values.
19+
20+
#### Recommendation
21+
22+
Workflows that previously succeeded may now fail due to permission checks
23+
involving `denied_parameters` because the new matching behavior correctly
24+
identifies the fact that the list contains individually denied values even when
25+
the exact list does not appear in the policy.
26+
27+
To address the broken workflow:
28+
- Check whether or not your policies are overly restrictive.
29+
- Update your workflows to avoid including explicitly denied values in lists.
30+
31+
Refer to [list parameter evaluation](/vault/docs/concepts/policies#list-parameter-evaluation) for more information.
32+
33+
You can temporarily revert to the deprecated matching behavior by setting the
34+
`VAULT_LEGACY_EXACT_MATCHING_ON_LIST` environment variable on your Vault server.

content/vault/global/partials/important-changes/summary-tables/1_21.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Introduced | Recommendations | Edition | Change
44
---------- | --------------- | ---------- | ------
55
1.21.0 | **Yes** | All | [Audiences required for Kubernetes authentication roles](/vault/docs/v1.21.x/updates/important-changes#k8-audience-required)
6+
1.21.0 | **Yes** | All | [Item-by-item list comparison for allowed_parameters and denied_parameters](/vault/docs/v1.21.x/updates/important-changes#allowed-parameters-list)
67

78

89
### New behavior
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Warning title="Parameter list behavior">
2+
3+
Vault evaluates list parameters matching `allowed_parameters` and `denied_parameters` by
4+
looking for the whole list instead of each element in the list.
5+
6+
When restricting list parameters we strongly recommend using allow rules instead of deny
7+
rules. Refer to [list parameter evaluation](#list-parameter-evaluation) for more details.
8+
9+
</Warning>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#### List parameter evaluation
2+
3+
When a request parameter carrying a list value matches an
4+
`allowed_parameters` or `denied_parameters` policy rule, Vault checks for
5+
an exact match between each allowed or denied value in the policy and
6+
the **entire** list value in the request parameter. The fact that Vault
7+
looks for matches to the entire list can produce unexpected results.
8+
9+
For example, if you set `allowed_parameters` to `"X": ["A", "B"]`:
10+
11+
- Vault only allows requests with parameter `"X": "A"` or `"X": "B"`.
12+
- Vault denies all other requests. . For example, Vault denies
13+
requests with parameter `"X": ["A", "B"]`, `"X": ["B", "A"]` or
14+
even `"X": ["A"]`, because the parameter value does not
15+
**exactly** match one of the allowed values ("A" or "B").
16+
17+
The same logic applies to `denied_parameters`. If you create a policy with
18+
`denied_parameters` set to `"Y": ["C", "D"]`:
19+
20+
- Vault only denies requests with parameter `"X": "C"` or `"X": "D"`.
21+
- Vault allows all other requests. For example, Vault allows requests with
22+
parameter `"Y": ["C", "D"]`, which can lead to unauthorized access if you
23+
intended to deny any request that included "C", "D", or both.
24+
25+
As a result, we **strongly recommend** using `allowed_parameters`
26+
instead of `denied_parameters` for list parameters.
27+
28+
Additionally, Vault does not treat comma-separated strings in request
29+
parameters as lists when evaluating `allowed_parameters` and `denied_parameters`.
30+
For instance, configuring `denied_parameters` as `"Z": ["C", "D", ["C"], ["D"], ["C", "D"], ["D", "C"]]`
31+
does not block requests that set `"Z": "C,D"` or `"Z": "D,C"`
32+
33+
<Tip title="Consider upgrading to 1.21.x or later">
34+
35+
Vault addressed the unexpected behavior of
36+
`allowed_parameters` and `denied_parameters` in 1.21.x with
37+
more intuitive list processing.
38+
39+
</Tip>

content/vault/v1.16.x/content/docs/concepts/policies.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ path take precedence over permissions on parameters.
347347

348348
~> **Note:** The `allowed_parameters`, `denied_parameters`, and `required_parameters` fields are not supported for policies used with the [version 2 kv secrets engine](/vault/docs/secrets/kv/kv-v2).
349349

350+
@include '../../../global/partials/policies/allowed_parameters_warning.mdx'
351+
350352
See the [API Specification](/vault/api-docs/secret/kv/kv-v2) for more information.
351353

352354
Policies can take into account HTTP request parameters to further
@@ -571,6 +573,8 @@ path "secret/foo" {
571573
}
572574
```
573575

576+
@include '../../../global/partials/policies/list-allowed-parameters.mdx'
577+
574578
### Required response wrapping TTLs
575579

576580
These parameters can be used to set minimums/maximums on TTLs set by clients

content/vault/v1.17.x/content/docs/concepts/policies.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ path take precedence over permissions on parameters.
354354

355355
~> **Note:** The `allowed_parameters`, `denied_parameters`, and `required_parameters` fields are not supported for policies used with the [version 2 kv secrets engine](/vault/docs/secrets/kv/kv-v2).
356356

357+
@include '../../../global/partials/policies/allowed_parameters_warning.mdx'
358+
357359
See the [API Specification](/vault/api-docs/secret/kv/kv-v2) for more information.
358360

359361
Policies can take into account HTTP request parameters to further
@@ -578,6 +580,8 @@ path "secret/foo" {
578580
}
579581
```
580582

583+
@include '../../../global/partials/policies/list-allowed-parameters.mdx'
584+
581585
### Required response wrapping TTLs
582586

583587
These parameters can be used to set minimums/maximums on TTLs set by clients

content/vault/v1.18.x/content/docs/concepts/policies.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ path take precedence over permissions on parameters.
354354

355355
~> **Note:** The `allowed_parameters`, `denied_parameters`, and `required_parameters` fields are not supported for policies used with the [version 2 kv secrets engine](/vault/docs/secrets/kv/kv-v2).
356356

357+
@include '../../../global/partials/policies/allowed_parameters_warning.mdx'
358+
357359
See the [API Specification](/vault/api-docs/secret/kv/kv-v2) for more information.
358360

359361
Policies can take into account HTTP request parameters to further
@@ -578,6 +580,8 @@ path "secret/foo" {
578580
}
579581
```
580582

583+
@include '../../../global/partials/policies/list-allowed-parameters.mdx'
584+
581585
### Required response wrapping TTLs
582586

583587
These parameters can be used to set minimums/maximums on TTLs set by clients

content/vault/v1.19.x/content/docs/concepts/policies.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,8 @@ path take precedence over permissions on parameters.
354354

355355
~> **Note:** The `allowed_parameters`, `denied_parameters`, and `required_parameters` fields are not supported for policies used with the [version 2 kv secrets engine](/vault/docs/secrets/kv/kv-v2).
356356

357+
@include '../../../global/partials/policies/allowed_parameters_warning.mdx'
358+
357359
See the [API Specification](/vault/api-docs/secret/kv/kv-v2) for more information.
358360

359361
Policies can take into account HTTP request parameters to further
@@ -578,6 +580,8 @@ path "secret/foo" {
578580
}
579581
```
580582

583+
@include '../../../global/partials/policies/list-allowed-parameters.mdx'
584+
581585
### Required response wrapping TTLs
582586

583587
These parameters can be used to set minimums/maximums on TTLs set by clients

content/vault/v1.20.x/content/docs/concepts/policies.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ path take precedence over permissions on parameters.
356356

357357
~> **Note:** The `allowed_parameters`, `denied_parameters`, and `required_parameters` fields are not supported for policies used with the [version 2 kv secrets engine](/vault/docs/secrets/kv/kv-v2).
358358

359+
@include '../../../global/partials/policies/allowed_parameters_warning.mdx'
360+
359361
See the [API Specification](/vault/api-docs/secret/kv/kv-v2) for more information.
360362

361363
Policies can take into account HTTP request parameters to further
@@ -580,6 +582,8 @@ path "secret/foo" {
580582
}
581583
```
582584

585+
@include '../../../global/partials/policies/list-allowed-parameters.mdx'
586+
583587
### Required response wrapping TTLs
584588

585589
These parameters can be used to set minimums/maximums on TTLs set by clients

content/vault/v1.21.x (rc)/content/docs/concepts/policies.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,13 @@ constrain requests, using the following options:
433433
}
434434
```
435435

436+
- When a request includes a parameter that contains a list value, Vault allows the request
437+
if `allowed_parameters` contains all values in the list or the list as a whole. Previously, Vault
438+
only allowed the request when the entire list matched an allowed value. During the
439+
deprecation period, you can restore the old behavior by setting the
440+
`VAULT_LEGACY_EXACT_MATCHING_ON_LIST` environment variable on the server.
441+
442+
436443
- `denied_parameters` - A list of keys and values that are not permitted on the given
437444
path. Any values specified here take precedence over `allowed_parameters`.
438445

@@ -485,6 +492,12 @@ constrain requests, using the following options:
485492
- If any parameters are specified, all non-specified parameters are allowed,
486493
unless `allowed_parameters` is also set, in which case normal rules apply.
487494

495+
- When a request includes a parameter that contains a list value, Vault denies the request
496+
if `denied_parameters` contains any value in the list or the list as a whole. Previously, Vault
497+
only denied the request when the entire list matched a denied value. During the
498+
deprecation period, you can restore the old behavior by setting the
499+
`VAULT_LEGACY_EXACT_MATCHING_ON_LIST` environment variable on the server.
500+
488501
Parameter values also support prefix/suffix globbing. Globbing is enabled by
489502
prepending or appending or prepending a splat (`*`) to the value:
490503

@@ -580,6 +593,22 @@ path "secret/foo" {
580593
}
581594
```
582595

596+
#### List parameter evaluation
597+
598+
In Vault v1.21.0 and later, when a request parameter carrying a list value matches
599+
an `allowed_parameters` or `denied_parameters` policy rule, Vault checks each
600+
element in the list against the list of allowed or denied values in the policy,
601+
as well as the list as a whole. This means that if `allowed_parameters` is set to
602+
`"X": ["A", "B"]`, Vault would allow all of the following values for "X": `"A"`,
603+
`"B"`, `["A", "B"]`, `["B", "A"]`, `["A"]`, `["B"]`, `"A,B"`, and `"B,A"`.
604+
605+
Previous versions of Vault did not treat list values in this way, which led to
606+
unexpected behavior. For more information refer to this same section in the
607+
documentation for Vault v1.20.x and earlier. During the deprecation period, you
608+
can restore the old behavior by setting the `VAULT_LEGACY_EXACT_MATCHING_ON_LIST`
609+
environment variable on the Vault server.
610+
611+
583612
### Required response wrapping TTLs
584613

585614
These parameters can be used to set minimums/maximums on TTLs set by clients

0 commit comments

Comments
 (0)