Skip to content

Commit 9f641d1

Browse files
committed
Incorporate the review feedback
1 parent e77774e commit 9f641d1

File tree

3 files changed

+57
-85
lines changed

3 files changed

+57
-85
lines changed

website/content/docs/configuration/create-rate-limit-quota.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,15 @@ Create a rate limit quota using the following parameters:
164164
- `block_interval` `(string: "")` - If set, when a client reaches a rate limit
165165
threshold, Vault prohibits the client from any further requests until after
166166
the `block_interval` has elapsed.
167-
- `inheritable` `(boolean: false)` - **Vault Enterprise:** Determine whether to
167+
- `inheritable` `(boolean: false)` - <EnterpriseAlert product="vault" inline /> Determine whether to
168168
apply the quota rule to child namespaces.
169-
- `group_by` `(string: "")` - **Vault Enterprise:** Define how to group incoming
169+
- `group_by` `(string: "")` - <EnterpriseAlert product="vault" inline /> Define how to group incoming
170170
requests. Refer to the [identity-based rate limit quotas](/vault/docs/configuration/identity-based-rate-limit) for more details.
171+
- `secondary_rate` `(float: 0.0)` – <EnterpriseAlert product="vault" inline /> Can only be set
172+
for the `group_by` modes `entity_then_ip` or `entity_then_none`. This is the rate limit applied
173+
to the requests that fall under the "ip" or "none" groupings, while the authenticated requests
174+
that contain an entity ID are subject to the `rate` field instead. Defaults to the same value
175+
as `rate`.
171176

172177

173178
<Tabs>

website/content/docs/configuration/identity-based-rate-limit.mdx

Lines changed: 44 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,53 @@
11
---
22
layout: docs
3-
page_title: Identity-based and collective rate limits
3+
page_title: Rate limit quotas - collective, by IP, by entity
44
description: >-
55
Implement protections to prevent misbehaving applications and clients from impacting Vault performance.
66
---
77

8-
# Identity-based and collective rate limits
8+
# Rate limit quotas - collective, by IP, by entity
99

1010
As the number of Vault client applications increases, the incoming requests to
11-
Vault can degrade Vault's performance. The issue is often caused by
12-
applications that are:
13-
14-
- Generating an unbounded number of leases and/or loading too much data into
15-
Vault leading to exhausting storage backend's available memory
16-
- Consuming an erroneously large amount of bandwidth leading to internal
17-
throttling of the Vault cluster as a whole
18-
19-
Use [rate limit quotas](/vault/docs/configuration/create-lease-count-quota) and
20-
[lease count quotas](/vault/docs/configuration/create-rate-limit-quota) to
21-
protect your Vault environment's stability and network, as well as storage
22-
resource consumption from runaway application behavior and distributed denial of
23-
service (DDoS) attack.
24-
25-
26-
Vault Enterprise permits organizations to define more fine-grained rate limits
27-
to how traffic enters their Vault cluster. Identity-based rate limit quotas use
28-
`group_by` options to create buckets for requests.
29-
30-
<table>
31-
<thead>
32-
<tr>
33-
<th style={{verticalAlign: 'middle'}}>Group_by option</th>
34-
<th style={{verticalAlign: 'middle'}}>Description</th>
35-
</tr>
36-
</thead>
37-
38-
<tbody>
39-
40-
<tr>
41-
<td><code>ip</code></td>
42-
<td>
43-
Creates buckets based on the IP addresses. (Default)
44-
</td>
45-
</tr>
46-
47-
<tr>
48-
<td><code>entity_then_none</code></td>
49-
<td>
50-
Groups requests on namespace, mount, or path by entity ID. The rate applies to the each bucket created. Requests
51-
without associated entity ID are handled by a collective secondary quota.
52-
</td>
53-
</tr>
54-
55-
<tr>
56-
<td><code>entity_then_ip</code></td>
57-
<td>
58-
Groups requests on namespace, mount, or path by entity ID. The rate applies to the each bucket created. Requests without associated entity ID are bucketed by IP, and the rate applies to each bucket. This option is recommended if your organization has reliably mappable IPs.
59-
</td>
60-
</tr>
61-
62-
<tr>
63-
<td><code>secondary_rate</code></td>
64-
<td>
65-
Allows organizations to set a separate rate for entity ID.<br/><br/>
66-
</td>
67-
</tr>
68-
69-
<tr>
70-
<td><code>none</code></td>
71-
<td>
72-
Creates one bucket for the namespace, path, or mount and collectively limits all traffic to that target.
73-
</td>
74-
</tr>
75-
76-
</tbody>
77-
</table>
78-
79-
The default behavior is to group requests by IP addresses. Group requests by
80-
entity (`entity_than_none` or `entity_then_ip`) option creates buckets based on
81-
the attached entity. This helps when your organization have:
11+
Vault can degrade Vault's performance. To protect your Vault environment's
12+
stability and network, as well as storage resource consumption from runaway
13+
application behavior and distributed denial of service (DDoS) attack, use [rate
14+
limit quotas](/vault/docs/configuration/create-lease-count-quota) and [lease
15+
count quotas](/vault/docs/configuration/create-rate-limit-quota).
16+
17+
For Vault Enterprise clusters, the rate limit quota supports **`group_by`**
18+
option to define more fine-grained rate limits to control how traffic enters
19+
their cluster.
20+
21+
The available `group_by` modes are:
22+
23+
- `ip` - groups requests by their source IP address (`group_by` defaults to `ip`
24+
if unset)
25+
26+
<Note title="Vault Community Edition">
27+
28+
The `ip` mode is the only supported mode in the community edition of Vault.
29+
30+
</Note>
31+
32+
- `none` - groups together all requests that match the rate limit quota rule
33+
34+
- `entity_then_ip` - groups requests by their entity ID for authenticated
35+
requests that carry one, or by their IP for unauthenticated requests (or
36+
requests whose authentication is not connected to an entity)
37+
38+
- `entity_then_none` - groups requests by their entity ID when available, but
39+
the rest is all grouped together (for example, unauthenticated requests, and
40+
requests with authentication that is not connected to an entity)
41+
42+
The `group_by` option with `entity_then_ip` or `entity_then_none` mode allows
43+
you to set a secondary rate limit (**`secondary_rate`**). This rate limit applies to
44+
the requests that fall under the `ip` or `none` groupings, while the
45+
authenticated requests that contain an entity ID are subject to the primary rate
46+
limit set by the `rate` parameter.
47+
48+
The default behavior is to group requests by their source IP addresses. The
49+
`entity_then_none` or `entity_then_ip` mode groups requests based on their
50+
attached entity. This helps when your organization have:
8251

8352
- many workloads using the same IP
8453
- single workloads using many IPs which may scale up or down
@@ -107,9 +76,9 @@ limit quota takes effect on the requests.
10776

10877
### Example
10978

110-
The command below creates a rate limit quota with rate of 1000 requests per
79+
The command below creates a rate limit quota with rate of 1,000 requests per
11180
second with `group_by` is set to `entity_then_none`, and the secondary rate is
112-
2000 requests per second.
81+
2,000 requests per second.
11382

11483
```shell-session
11584
$ vault write sys/quotas/rate-limit/my-rate \

website/data/docs-nav-data.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,9 @@
279279
]
280280
},
281281

282-
283282
{ "divider": true },
284283
{ "heading": "OPERATIONS" },
285284

286-
287285
{
288286
"title": "Get Vault",
289287
"routes": [
@@ -358,7 +356,7 @@
358356
}
359357
]
360358
},
361-
359+
362360
{
363361
"title": "Configure Vault",
364362
"routes": [
@@ -396,7 +394,7 @@
396394
"path": "configuration/create-rate-limit-quota"
397395
},
398396
{
399-
"title": "Identity-based and collective rate limits",
397+
"title": "Rate limit quotas by IP or entity",
400398
"badge": {
401399
"text": "ENT",
402400
"type": "filled",
@@ -416,10 +414,10 @@
416414
"color": "neutral"
417415
},
418416
"path": "configuration/entropy-augmentation"
419-
},
420-
417+
},
418+
421419
{ "heading": "Configuration stanzas" },
422-
420+
423421
{
424422
"title": "<code>adaptive_overload_protection</code>",
425423
"badge": {
@@ -2603,7 +2601,7 @@
26032601
},
26042602
{
26052603
"title": "Rollback upgrades",
2606-
"path" : "plugins/rollback"
2604+
"path": "plugins/rollback"
26072605
},
26082606
{
26092607
"title": "Plugin development",

0 commit comments

Comments
 (0)