|
1 | 1 | ---
|
2 | 2 | layout: docs
|
3 |
| -page_title: Identity-based and collective rate limits |
| 3 | +page_title: Rate limit quotas - collective, by IP, by entity |
4 | 4 | description: >-
|
5 | 5 | Implement protections to prevent misbehaving applications and clients from impacting Vault performance.
|
6 | 6 | ---
|
7 | 7 |
|
8 |
| -# Identity-based and collective rate limits |
| 8 | +# Rate limit quotas - collective, by IP, by entity |
9 | 9 |
|
10 | 10 | 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: |
82 | 51 |
|
83 | 52 | - many workloads using the same IP
|
84 | 53 | - single workloads using many IPs which may scale up or down
|
@@ -107,9 +76,9 @@ limit quota takes effect on the requests.
|
107 | 76 |
|
108 | 77 | ### Example
|
109 | 78 |
|
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 |
111 | 80 | 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. |
113 | 82 |
|
114 | 83 | ```shell-session
|
115 | 84 | $ vault write sys/quotas/rate-limit/my-rate \
|
|
0 commit comments