-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[Docs] Adding identity-based rate limit #30717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CI Results: |
Build Results: |
<tr> | ||
<td><code>ip</code></td> | ||
<td> | ||
Creates buckets based on the IP addresses. (Default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these more explanatory docs I think we should explain what we mean by "buckets" before using such terminology to explain something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Maybe something like:
For rate limit quotas, we use a concept called a "bucket". This essentially defines a group of requests based on a certain characteristic they have in common. For example, if we have chosen to group_by IP, there would be one bucket for each IP that is sending requests. Each bucket has the rate limit R which is set at the namespace, path, mount, role, or global level.
<tr> | ||
<td><code>entity_then_none</code></td> | ||
<td> | ||
Groups requests on namespace, mount, or path by entity ID. The rate applies to the each bucket created. Requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think explicitly calling out "namespace, mount or path" might imply that a quota's group_by
mode has something to do with whether or not a quota matches against a given request, when in fact it does not.
Quotas can be configured at a global, namespace, mount, path or role levels, which only affects the decision of which (if any) quota applies to any given request. Then, that matching quota can be configured to group requests by different attributes, namely "ip", "none", "entity_then_ip" and "entity_then_none", which affect how that matching quota is applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. At the same time, though, I want to make sure we're being explicit about how they can use the rate limit quotas - there are a lot of customer misconceptions that they can impose a limit on a specific user, for example, and I want to make it clear that that's not what we're allowing them to do.
</tr> | ||
|
||
<tr> | ||
<td><code>secondary_rate</code></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secondary_rate
is not a group_by
mode, they're both separate fields in the RLQ definition. As you described above, for requests without an associated entity Id we group by either IP (on entity_then_ip
) or all together (on entity_then_none
), allowing all buckets rate
requests per second, but if secondary_rate
is set then we use that instead for the secondary (IP/collective) bucket
website/content/docs/configuration/identity-based-rate-limit.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/configuration/identity-based-rate-limit.mdx
Outdated
Show resolved
Hide resolved
|
||
<Note title="Rate limit granularity"> | ||
|
||
You can define quotas on namespaces, mounts, and paths. The most granular rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's also possible to define an RLQ for a role. Role-based RLQs have the highest priority. You can find a more thorough description of the evaluation priority in this section of the RFC https://docs.google.com/document/d/1puB0Yfsmew35Z7YdliFqvgHXldlmTsux9hAtwtV37EY/edit?tab=t.0#heading=h.5g040uvfvj1q
Description
🎫 Jira ticket
This PR updates resource quota docs for Vault 1.20.0:
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.