main
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4280ebb2ca |
a request budget says who it is pausing, and one source can be let out
The budget listing has carried three numbers per budget since OPEN-68 — sources
counted, windows running, over budget now — and no name. "3 over budget" is the
half an operator cannot act on, and the only lever for one of those three was
`DELETE /admin-api/rate-rules/{id}`: take the budget off every source on the site
to release one office behind one NAT. The edge-wide budget never had this hole,
because /admin-api/rate names its sources.
* GET /admin-api/rate-rules/{id}/sources — who this budget is inside right now:
sourceKey, count against the limit, when the window ends and how many seconds
are left, overBudget. Busiest first, live windows only, paged with
X-Total-Count / X-Truncated like every other listing. `total` is the same
number the listing's `liveWindows` reports and the over-budget count matches
`overBudgetNow`: the names come from the same state as the three counters,
not from a second ledger.
* DELETE /admin-api/rate-rules/{id}/sources?source=<key> — drop one source's
window on one budget. Not an exemption, and the answer says so: the window
restarts at zero and the budget counts this source again from there, while
every other source stays paused. An operator who types an address gets the
key this edge files it under, and the answer names the key it dropped,
because the others sharing it are still paused. A second clear answers
`cleared: false` and writes no second record; the first is in the change log
under `rate rule / changed`.
* Console: a `who` button per budget row, and a `let out` button per source.
Rulings kept: the entries are source keys with the prefix rule printed beside
them (a /24 in the list is the point, not a bug); the limit is passed in from the
rule row rather than copied into the counter, so one number is enforced once;
reading spends nothing, so the page that exists to show a pause cannot cause one;
an empty list says which kind of empty it is — "counting, nobody inside a window"
and "this budget has expired" are different answers; and the read-only token gets
a 403 on the clear, not a 401, because the token is known and its level is the
answer.
What the run caught, on this tree: two console scenes failed with `answered 403`
because the gate's own probes are refusals and the streak pillar had banned the
probe addresses — a correct edge, and a scene that cannot retry past a one-hour
ban. Both now clear that one ban by name, leaving the engine bans the netblock
scene reads standing. The first run of the feature also caught the clear
reporting `cleared: false` after actually dropping the window: the derived-key
branch dropped the state and never set the flag.
build 0 warnings / 0 errors, unit 377/377, integration 365/365 in 31 s,
console 129 assertions / 0 failed, smoke passed 202 / failed 0, compose 317
passed / 0 failed against the built image at 262 MB.
Refs OPEN-71.
|
||
|
|
bcfc83db40 |
one address in, and the edge answers everything it knows about it
An operator investigating one source had to open six admin calls — blocks,
allow, streaks, observations, alerts, the dry run — and hold the join in their
head. The join is where the wrong answers are: a v6 address looked up in full
when the ban is filed on the /64, a CIDR ban looked up by equality that never
finds it, an exemption that expired last week read as a live one, a streak
counted in one process read as the deployment's.
GET /admin-api/source?ip=<address>[&path=<path>] answers it in one call, by
asking the same objects the request path asks rather than a second copy of
their logic. Three rulings hold it together:
* Containment, not equality. operatorBlock carries cameFromRange and the
match that covered the address, through the same NetworkBanIndex the wire
matches with (longest prefix first) and NetworkMatch for the allowlist.
There is no second matcher in this build to drift.
* The key, not the address. sourceKey and the prefix lengths that produced
it travel in the answer: bans, streaks and budgets are filed under the key,
the allowlist and the range bans are matched against the address, and the
answer separates them.
* `none` and "not visible here" are different words. A live engine ban under
Observe mode reports applies: false with a verdict of none; an expired row
reports live: false rather than null, because "this address used to be
exempt" is a fact an operator acts on.
Nothing is written and nothing is spent — the dry run's rule applied to the
whole dossier. RateRuleTracker.WindowsFor is a new read that lists every path
budget a source is already inside without being handed a path, so the dossier
does not have to guess from a path it was not given, and N dossiers leave every
counter where they found it. ip is required and must be a full address: a typo
is a 400 naming the value, never a none. The read-only token may ask it.
What the run caught, on this tree: the console scene waited for "an answer is
in the box", which the previous answer still sitting there satisfies — three
assertions read the address asked one click earlier. The scene now empties the
box and waits for the address it asked by name, and matches a range row by the
key its delete button holds rather than by a cell that prints a `range` badge.
build 0 warnings / 0 errors, unit 374/374, integration 356/356 in 39 s,
console 126 assertions / 0 failed, smoke passed 192 / failed 0, compose 311
passed / 0 failed against the built image at 262 MB.
Refs OPEN-70.
|
||
|
|
6a65cbf344 |
the dry run says what the volume pillar would answer for that source
`GET /admin-api/decide` answers what would happen to a named request and which pillar said so, and it stayed silent about the one pillar whose number the operator is choosing. The count is kept in the guard rather than read off a snapshot, so the preview printed `rate: not_evaluated` and left "would this source be rate-limited" as the one question the surface exists to answer could not ask. The rulings this had to make, and the answer each one got: * Reading, never spending, is the invariant. The section is built from peek reads of both trackers, so N dry runs leave `count` exactly where it was and write no alert. A preview that answered by counting its own question would refuse the next real request because somebody pressed a button — the tool for finding an over-tight budget would itself be the cause of it. * Four silences stay apart: `not_counted` (the pillar is off, so there is no budget to cross), `no_source` (no address was asked, and a budget is a claim about a source), `refused_now`, `would_be_counted`. A fifth, `over_budget_not_enforced`, exists because "over budget" and "would be refused" are two answers separated by the mode, and collapsing them is how an observe budget becomes a surprise the day someone switches it on. * `reached: false` says an earlier pillar answers the request, so the guard would never consult the counter for it. The volume section still reports the counters — they are true — but the note stops talking about a budget this request would never touch. * A budget in force for the path with nothing counted for this source yet prints `counted: false`, not `count: 0`. "0 of 2" and "nothing yet" are answers an operator acts on differently. * The path budgets are matched by the same `PathPattern.Matches`, in the same order, as the guard: a preview that matched differently would be a preview of a different edge. * The counters are this process's (`scope: "this-process"`), said in the answer rather than left for the operator to remember. * The `rate` pillar row keeps `not_evaluated` — the engine really did not evaluate it — and its note now points at the section that did, instead of ending as a silence. What the runs caught, in order: * The first version answered `refused_now` for an Observe crossing. The counters were right and the sentence was wrong: observe enforces nothing. The mode is now part of the verdict. * An integration expectation asserted the note of the `rate` pillar row after a crossing, and read the engine ban the crossing itself had written instead — the request was no longer reaching the volume pillar. The assertion moved to the preview taken before the crossing, and the ban case now asserts the honest note. * Rewording that note broke an older preview test that keyed on the word "preview" in it; the wording keeps the word, and the older test is the one that caught the rewording. * The smoke scene compared a listing's over-budget count against a request count, which would have passed for the wrong reason; it now asserts the pair (tracked, over) before and after six previews. Gates at this commit, each stage on its own: build 0 warnings / 0 errors, unit 371/371, integration 345/345 in 43 s, console 122 assertions 0 failed, smoke passed 182 failed 0, compose 304 passed 0 failed against the built image at 262 MB, 0 containers left behind. Refs OPEN-69. |
||
|
|
7beaa7e463 |
a source's request budget can be written for one path
The edge-wide budget is one number for the whole site, and for a login path that number is always wrong: a hundred requests a minute does not stop a credential-stuffing run that makes twenty attempts a minute — twenty looks like a person — while five a minute locks an honest office behind one NAT out of every page they own. The only way to make both statements true is to price the paths differently. The rulings this had to make, and the answer each one got: * A rate rule is not a path rule. A path rule refuses a request because of what it asked for; a budget refuses it because of how often that source asked. The pattern language is shared because the thing being described — this path and what hangs off it — is the same. * Crossing a budget writes no engine ban. The claim is about one path, so a ban would refuse the rest of the site as punishment for a login-page rate. The answer is 429 with Retry-After for the rest of that source's window, and the reason names the rule, its count, its limit and the pattern it was written for. * The counters are a separate tracker, not a scope inside RateTracker. The edge-wide counter reads its limit and window from the policy; a rule carries its own. One map whose parameters change per entry is a map whose eviction and idle rules stop meaning anything. * The budgets hang off rateMode rather than getting a switch of their own: Enforce refuses, Observe counts and raises one rate_breach alert per source per window naming the pattern, Off counts nothing at all. A half-counting edge is the state an operator cannot reason about. * A second live budget for one pattern is a 409 — two live numbers for one path mean the stricter one wins by accident rather than by the operator's choice. * The bounds are the policy's own (1..100000 requests, 1..3600 seconds), so one vocabulary of numbers covers both budgets and a document cannot bring in a budget the API would have refused. * The listing answers with three counters — sources counted, windows running, over budget now — because "nobody has blown this" and "nobody can" look identical on paper and are different decisions. What the runs caught, in order: * The smoke scene first ran on 198.51.100.0/24, which an earlier scene of the same gate allowlists. An allowlisted source never reaches the counter, so the scene would have printed a row of 200s while measuring nothing. It runs on TEST-NET-1 now. * The console scene drew three 404s of its own and the streak pillar banned the address, so the reopen assertion read the streak's 403 instead of the absence of the budget. The engine list is cleared before that probe and the comment says which pillar the clearing belongs to. * The compose assertion compared a JSON boolean against the word "yes". * The change-log vocabulary test still listed six sections; there are seven now. * A unit expectation counted requests where the tracker holds windows: one (rule, source) pair is one window, and the count inside it is what the budget is measured against. Gates at this commit, each stage on its own: build 0 warnings / 0 errors, unit 361/361, integration 337/337 in 30 s, console 120 assertions 0 failed, smoke passed 169 failed 0, compose 300 passed 0 failed against the built image at 262 MB, 0 containers left behind. Refs OPEN-68. |