@radicaltools/cli 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +353 -33
  2. package/dist/hub-catalogue/concern/concern-api-collections.radical +1136 -0
  3. package/dist/hub-catalogue/concern/concern-api-errors.radical +1180 -0
  4. package/dist/hub-catalogue/concern/concern-api-evolution.radical +1174 -0
  5. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +1218 -0
  6. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +1102 -0
  7. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +1210 -0
  8. package/dist/hub-catalogue/concern/concern-architecture-style.radical +1268 -0
  9. package/dist/hub-catalogue/concern/concern-audit-trail.radical +1096 -0
  10. package/dist/hub-catalogue/concern/concern-authentication.radical +895 -0
  11. package/dist/hub-catalogue/concern/concern-authorization.radical +1686 -0
  12. package/dist/hub-catalogue/concern/concern-availability.radical +1028 -0
  13. package/dist/hub-catalogue/concern/concern-backend-stack.radical +1037 -0
  14. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +1560 -0
  15. package/dist/hub-catalogue/concern/concern-caching.radical +1294 -0
  16. package/dist/hub-catalogue/concern/concern-capacity.radical +915 -0
  17. package/dist/hub-catalogue/concern/concern-code-documentation.radical +1397 -0
  18. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +1409 -0
  19. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +1416 -0
  20. package/dist/hub-catalogue/concern/concern-code-style.radical +1058 -0
  21. package/dist/hub-catalogue/concern/concern-communication-style.radical +1508 -0
  22. package/dist/hub-catalogue/concern/concern-data-classification.radical +970 -0
  23. package/dist/hub-catalogue/concern/concern-data-consistency.radical +1112 -0
  24. package/dist/hub-catalogue/concern/concern-data-store.radical +1282 -0
  25. package/dist/hub-catalogue/concern/concern-decomposition.radical +1318 -0
  26. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +1214 -0
  27. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +966 -0
  28. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +1345 -0
  29. package/dist/hub-catalogue/concern/concern-deployment.radical +1203 -0
  30. package/dist/hub-catalogue/concern/concern-encryption.radical +1318 -0
  31. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +1197 -0
  32. package/dist/hub-catalogue/concern/concern-eu-dora.radical +1321 -0
  33. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +1647 -0
  34. package/dist/hub-catalogue/concern/concern-incident-management.radical +1204 -0
  35. package/dist/hub-catalogue/concern/concern-infrastructure.radical +2183 -0
  36. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +1116 -0
  37. package/dist/hub-catalogue/concern/concern-messaging.radical +973 -0
  38. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +867 -0
  39. package/dist/hub-catalogue/concern/concern-observability.radical +997 -0
  40. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +1249 -0
  41. package/dist/hub-catalogue/concern/concern-personal-data.radical +1949 -0
  42. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +1091 -0
  43. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +1445 -0
  44. package/dist/hub-catalogue/concern/concern-release-versioning.radical +1358 -0
  45. package/dist/hub-catalogue/concern/concern-retention.radical +1399 -0
  46. package/dist/hub-catalogue/concern/concern-secrets.radical +1284 -0
  47. package/dist/hub-catalogue/concern/concern-secure-coding.radical +1379 -0
  48. package/dist/hub-catalogue/concern/concern-secure-development.radical +1245 -0
  49. package/dist/hub-catalogue/concern/concern-security-detection.radical +1153 -0
  50. package/dist/hub-catalogue/concern/concern-supply-chain.radical +1386 -0
  51. package/dist/hub-catalogue/concern/concern-technical-debt.radical +1450 -0
  52. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +1145 -0
  53. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +1440 -0
  54. package/dist/hub-catalogue/concern/concern-test-strategy.radical +1212 -0
  55. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +1143 -0
  56. package/dist/index.js +12712 -7144
  57. package/package.json +5 -3
@@ -0,0 +1,1445 @@
1
+ {
2
+ "hub": {
3
+ "id": "concern-rate-limiting",
4
+ "category": "concern",
5
+ "name": "Rate limiting and abuse",
6
+ "description": "Entry points from outside: how much one caller may ask, how it is counted and where, and how oversized and automated requests are stopped. Whether an element is reachable from outside at all is not decided here (network segmentation is a pack of its own).",
7
+ "tags": [
8
+ "security",
9
+ "rate-limiting",
10
+ "abuse",
11
+ "availability",
12
+ "bots",
13
+ "api"
14
+ ],
15
+ "requiredMetamodel": "c4-ddd-governance-builtin",
16
+ "concern": {
17
+ "id": "rate-limiting",
18
+ "trigger": "LIST RELATIONS WHERE (source.type = \"person\" OR source.external = true) AND target.external != true AND (target.type = \"system\" OR target.type = \"container\" OR target.type = \"webapp\" OR target.type = \"component\")",
19
+ "applyTo": "target",
20
+ "why": "these elements take requests from outside, so how much one caller may ask, and what stops abuse, has to be decided.",
21
+ "group": "security"
22
+ },
23
+ "sources": [
24
+ {
25
+ "title": "OWASP API Security Top 10 2023, API4:2023 Unrestricted Resource Consumption",
26
+ "url": "https://owasp.org/API-Security/editions/2023/en/0xa4-unrestricted-resource-consumption/"
27
+ },
28
+ {
29
+ "title": "OWASP API Security Top 10 2023, API6:2023 Unrestricted Access to Sensitive Business Flows",
30
+ "url": "https://owasp.org/API-Security/editions/2023/en/0xa6-unrestricted-access-to-sensitive-business-flows/"
31
+ },
32
+ {
33
+ "title": "RFC 6585, Additional HTTP Status Codes (4. 429 Too Many Requests)",
34
+ "url": "https://www.rfc-editor.org/rfc/rfc6585"
35
+ },
36
+ {
37
+ "title": "RFC 9110, HTTP Semantics (10.2.3 Retry-After, 15.5.14 413 Content Too Large)",
38
+ "url": "https://www.rfc-editor.org/rfc/rfc9110"
39
+ },
40
+ {
41
+ "title": "OWASP Denial of Service Cheat Sheet",
42
+ "url": "https://cheatsheetseries.owasp.org/cheatsheets/Denial_of_Service_Cheat_Sheet.html"
43
+ },
44
+ {
45
+ "title": "OWASP Automated Threats to Web Applications",
46
+ "url": "https://owasp.org/www-project-automated-threats-to-web-applications/"
47
+ },
48
+ {
49
+ "title": "IETF draft, RateLimit header fields for HTTP",
50
+ "url": "https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/"
51
+ }
52
+ ],
53
+ "templateParams": [
54
+ {
55
+ "key": "EXPOSURE",
56
+ "title": "Exposure",
57
+ "label": "Who can reach it?",
58
+ "hint": "Anything on the internet is probed and scraped within hours of going live; a partner API has known callers and agreed limits.",
59
+ "defaultValue": "internet",
60
+ "options": [
61
+ {
62
+ "value": "internet",
63
+ "label": "anyone on the internet",
64
+ "description": "Anonymous people and bots reach it. Pick it for public web apps, sign-up and sign-in pages and public APIs; it needs volumetric protection at the edge and protection of costly operations."
65
+ },
66
+ {
67
+ "value": "partners",
68
+ "label": "known partners and our signed-in users",
69
+ "description": "Every request carries a partner key or a user's credential, checked at the edge, so callers are counted by account or API key, not by address. Pick it for B2B APIs and back offices; limits can be agreed per partner."
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "key": "KEY",
75
+ "title": "Limit key",
76
+ "label": "What is a caller counted by?",
77
+ "hint": "The key decides who shares a limit: too coarse and an office shares one, too fine and an attacker rotates it.",
78
+ "defaultValue": "account",
79
+ "options": [
80
+ {
81
+ "value": "account",
82
+ "label": "its account or API key, else its source address",
83
+ "description": "Signed-in callers by account, anonymous ones by address with a lower limit. Pick it when most traffic is signed in and some pages are public."
84
+ },
85
+ {
86
+ "value": "apikey",
87
+ "label": "its API key",
88
+ "description": "Each calling system by its key, with limits agreed per key; requests without a valid key are refused before counting. Pick it for machine-to-machine APIs."
89
+ },
90
+ {
91
+ "value": "ip",
92
+ "label": "its source address",
93
+ "description": "IPv4 per address, IPv6 per /64. Pick it only when callers are anonymous; offices and mobile carriers share addresses, so allow-list the known ones. Not with known partners, whose every request carries a key to count by."
94
+ }
95
+ ]
96
+ },
97
+ {
98
+ "key": "ALGORITHM",
99
+ "title": "Algorithm",
100
+ "label": "How are requests counted?",
101
+ "hint": "The algorithm decides whether bursts are allowed and how exact the limit is at the edge of a window.",
102
+ "defaultValue": "token-bucket",
103
+ "options": [
104
+ {
105
+ "value": "token-bucket",
106
+ "label": "a token bucket",
107
+ "description": "A steady rate plus a burst allowance. Pick it when real clients send in bursts (a page loading 20 resources, a batch job); AWS API Gateway, Envoy and ASP.NET Core offer it."
108
+ },
109
+ {
110
+ "value": "sliding-window",
111
+ "label": "a sliding window",
112
+ "description": "No 60 seconds may hold more than the limit, wherever they start. Pick it when the limit protects a fixed capacity (a partner's backend, a licence) and must not be exceeded at window edges."
113
+ },
114
+ {
115
+ "value": "fixed-window",
116
+ "label": "a fixed window per minute",
117
+ "description": "A counter per calendar minute, reset at its start; cheapest to run, but a caller can send twice the limit across a minute boundary. Pick it for quotas (per day, per month) and simple per-minute limits."
118
+ }
119
+ ]
120
+ },
121
+ {
122
+ "key": "WHERE",
123
+ "title": "Where enforced",
124
+ "label": "Where is the limit enforced?",
125
+ "hint": "The earlier a request is refused, the less it costs; the later, the more the limit knows about who is calling.",
126
+ "defaultValue": "gateway",
127
+ "options": [
128
+ {
129
+ "value": "gateway",
130
+ "label": "at the API gateway",
131
+ "description": "Kong, NGINX, Envoy, AWS API Gateway or Azure API Management in front of the element, keyed on the token or API key it validates. Pick it when there is a gateway in the path, which most APIs have."
132
+ },
133
+ {
134
+ "value": "waf",
135
+ "label": "at the edge WAF or CDN",
136
+ "description": "Cloudflare, AWS WAF, Azure Front Door or Akamai rate rules before traffic reaches the network. Pick it for public web traffic and floods; counts are approximate and keyed mostly on addresses and headers."
137
+ },
138
+ {
139
+ "value": "app",
140
+ "label": "in the application",
141
+ "description": "Middleware in the element with counters shared in Redis. Pick it when the limit depends on business data (plan, tenant, operation cost) that only the element knows."
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "key": "BOTS",
147
+ "title": "Bots",
148
+ "label": "How are automated callers stopped on costly operations?",
149
+ "hint": "Credential stuffing, fake sign-ups and scraping stay under per-caller limits by spreading over many addresses; they need their own protection.",
150
+ "defaultValue": "challenge",
151
+ "options": [
152
+ {
153
+ "value": "challenge",
154
+ "label": "a challenge after repeated attempts",
155
+ "description": "Cloudflare Turnstile, hCaptcha or reCAPTCHA after a source repeats a costly operation. Pick it for public sign-in, sign-up and contact forms without a bot-management product."
156
+ },
157
+ {
158
+ "value": "managed",
159
+ "label": "managed bot detection at the edge",
160
+ "description": "Cloudflare Bot Management, AWS WAF Bot Control or Akamai Bot Manager score every request. Pick it for high-value public targets (retail, tickets, finance) facing distributed bots."
161
+ },
162
+ {
163
+ "value": "none",
164
+ "label": "costly operations only for identified callers",
165
+ "description": "No bot product; costly operations sit behind sign-in or a partner key. Pick it for partner APIs and back offices, where every caller is known."
166
+ }
167
+ ]
168
+ },
169
+ {
170
+ "key": "LIMIT_PER_MIN",
171
+ "label": "How many requests a minute may one caller make?",
172
+ "defaultValue": "600",
173
+ "type": "number"
174
+ },
175
+ {
176
+ "key": "BURST",
177
+ "label": "How many requests may a caller send at once above that (token bucket)?",
178
+ "defaultValue": "100",
179
+ "type": "number"
180
+ },
181
+ {
182
+ "key": "ANON_LIMIT_PER_MIN",
183
+ "label": "How many requests a minute may one anonymous source address make?",
184
+ "defaultValue": "60",
185
+ "type": "number"
186
+ },
187
+ {
188
+ "key": "MAX_BODY_KB",
189
+ "label": "What is the largest request body accepted (KB)?",
190
+ "defaultValue": "1024",
191
+ "type": "number"
192
+ },
193
+ {
194
+ "key": "MAX_PAGE_ITEMS",
195
+ "label": "How many items may one page of results hold at most?",
196
+ "defaultValue": "100",
197
+ "type": "number"
198
+ },
199
+ {
200
+ "key": "COSTLY_OPS",
201
+ "label": "Which operations are costly or attractive to bots?",
202
+ "defaultValue": "sign-up, sign-in, password reset, search"
203
+ }
204
+ ]
205
+ },
206
+ "nodes": [
207
+ {
208
+ "id": "need",
209
+ "type": "need",
210
+ "label": "No caller takes it down",
211
+ "x": 0,
212
+ "y": 0,
213
+ "kind": "brief",
214
+ "source": "Hub concern pack: Rate limiting and abuse",
215
+ "description": "The element takes requests from outside. One caller, by mistake or on purpose, can send enough to slow it for everyone; bots try passwords, create accounts and scrape data; oversized requests and pages use up memory; and costly operations run up bills because nothing limits them. Real users behind a shared address must not be locked out on the way."
216
+ },
217
+ {
218
+ "id": "req-limit",
219
+ "type": "requirement",
220
+ "label": "Callers limited",
221
+ "x": 260,
222
+ "y": 0,
223
+ "ears_type": "unwanted-behaviour",
224
+ "unwanted_condition": "one caller, counted by {{KEY}}, sends more than {{LIMIT_PER_MIN}} requests a minute",
225
+ "action": "answer the excess with 429 and a Retry-After header, without raising other callers' 95th percentile response time by more than 10 %",
226
+ "rationale": "A fair share each: a misbehaving caller slows only itself, and 429 with Retry-After tells a well-behaved client when to come back (OWASP API4:2023; RFC 6585 4; RFC 9110 10.2.3)."
227
+ },
228
+ {
229
+ "id": "req-size",
230
+ "type": "requirement",
231
+ "label": "Oversized requests refused",
232
+ "x": 260,
233
+ "y": 130,
234
+ "ears_type": "unwanted-behaviour",
235
+ "unwanted_condition": "a request body is larger than {{MAX_BODY_KB}} KB or than its operation allows",
236
+ "action": "refuse it with 413 before reading more than that limit",
237
+ "rationale": "Reading first and checking later is the exhaustion; the limit belongs in the first component that reads the body (OWASP API4:2023, maximum request size; RFC 9110 15.5.14)."
238
+ },
239
+ {
240
+ "id": "req-pages",
241
+ "type": "requirement",
242
+ "label": "Pages bounded",
243
+ "x": 260,
244
+ "y": 260,
245
+ "ears_type": "ubiquitous",
246
+ "action": "return at most {{MAX_PAGE_ITEMS}} items per page of results, and refuse a larger page size with 400",
247
+ "rationale": "One request asking for everything is a flood in a single call (OWASP API4:2023, maximum number of records per page)."
248
+ },
249
+ {
250
+ "id": "req-token-bucket",
251
+ "type": "requirement",
252
+ "label": "Bursts allowed, rate kept",
253
+ "x": 260,
254
+ "y": 390,
255
+ "ears_type": "ubiquitous",
256
+ "action": "let each caller send up to {{BURST}} requests at once above its steady rate, refill its allowance at {{LIMIT_PER_MIN}} requests a minute, and refuse requests while the allowance is empty",
257
+ "rationale": "Real clients send in bursts; a bucket admits them without letting the sustained rate exceed the limit (OWASP Denial of Service Cheat Sheet).",
258
+ "hubWhen": {
259
+ "ALGORITHM": [
260
+ "token-bucket"
261
+ ]
262
+ }
263
+ },
264
+ {
265
+ "id": "req-sliding-window",
266
+ "type": "requirement",
267
+ "label": "No window over the limit",
268
+ "x": 260,
269
+ "y": 520,
270
+ "ears_type": "ubiquitous",
271
+ "action": "count each caller's requests over a sliding 60-second window, so that no 60 seconds hold more than {{LIMIT_PER_MIN}} accepted requests from it, window edges included",
272
+ "rationale": "A fixed window lets a caller send twice the limit across its boundary; a sliding window keeps the limit wherever the minute starts (OWASP Denial of Service Cheat Sheet).",
273
+ "hubWhen": {
274
+ "ALGORITHM": [
275
+ "sliding-window"
276
+ ]
277
+ }
278
+ },
279
+ {
280
+ "id": "req-fixed-window",
281
+ "type": "requirement",
282
+ "label": "Quota per minute shown",
283
+ "x": 260,
284
+ "y": 650,
285
+ "ears_type": "ubiquitous",
286
+ "action": "accept at most {{LIMIT_PER_MIN}} requests per caller in each calendar minute, and return the limit, the requests remaining and the seconds to reset with every response",
287
+ "rationale": "A fixed window is cheap and predictable; showing the remaining quota lets clients pace themselves instead of hitting 429 (IETF RateLimit header fields draft).",
288
+ "hubWhen": {
289
+ "ALGORITHM": [
290
+ "fixed-window"
291
+ ]
292
+ }
293
+ },
294
+ {
295
+ "id": "req-key-account",
296
+ "type": "requirement",
297
+ "label": "Anonymous callers limited lower",
298
+ "x": 260,
299
+ "y": 780,
300
+ "ears_type": "event-driven",
301
+ "trigger": "a request arrives without a credential",
302
+ "action": "count it by its source address (IPv6 by /64) and limit that address to {{ANON_LIMIT_PER_MIN}} requests a minute, apart from the limits of signed-in callers",
303
+ "rationale": "Anonymous traffic has no account to count by; a separate, lower limit keeps it from using up what signed-in users need (OWASP API4:2023).",
304
+ "hubWhen": {
305
+ "KEY": [
306
+ "account"
307
+ ]
308
+ }
309
+ },
310
+ {
311
+ "id": "req-key-apikey",
312
+ "type": "requirement",
313
+ "label": "Keyless calls refused first",
314
+ "x": 260,
315
+ "y": 910,
316
+ "ears_type": "unwanted-behaviour",
317
+ "unwanted_condition": "a request carries no valid API key",
318
+ "action": "refuse it with 401 before it counts against any key's limit, and limit such requests to {{ANON_LIMIT_PER_MIN}} a minute per source address",
319
+ "rationale": "If invalid keys counted against valid ones, anyone could spend a partner's quota; limiting failures by address slows key guessing (OWASP API4:2023, API2:2023).",
320
+ "hubWhen": {
321
+ "KEY": [
322
+ "apikey"
323
+ ]
324
+ }
325
+ },
326
+ {
327
+ "id": "req-key-ip",
328
+ "type": "requirement",
329
+ "label": "Addresses counted fairly",
330
+ "x": 260,
331
+ "y": 1040,
332
+ "ears_type": "ubiquitous",
333
+ "action": "count IPv4 callers per address and IPv6 callers per /64 prefix, take the address only from the trusted proxy's header, and give the addresses on an allow-list of known shared egress (offices, partners) their own higher limits",
334
+ "rationale": "An address taken from any X-Forwarded-For value can be forged, and an IPv6 host owns a whole /64; shared addresses need room or real users are locked out (OWASP Denial of Service Cheat Sheet).",
335
+ "hubWhen": {
336
+ "KEY": [
337
+ "ip"
338
+ ]
339
+ }
340
+ },
341
+ {
342
+ "id": "req-shared-counters",
343
+ "type": "requirement",
344
+ "label": "One limit across instances",
345
+ "x": 260,
346
+ "y": 1170,
347
+ "ears_type": "state-driven",
348
+ "precondition": "the element runs on more than one instance",
349
+ "action": "keep the counters in one shared store, so that the element as a whole accepts no more from one caller than one instance would, within 10 %, and fall back to a per-instance limit rather than none when the store is unreachable",
350
+ "rationale": "A limit counted per instance multiplies with every instance added; failing open would turn a store outage into an open door (OWASP Denial of Service Cheat Sheet).",
351
+ "hubWhen": {
352
+ "WHERE": [
353
+ "app"
354
+ ]
355
+ }
356
+ },
357
+ {
358
+ "id": "req-bots-challenge",
359
+ "type": "requirement",
360
+ "label": "Repeated costly calls challenged",
361
+ "x": 260,
362
+ "y": 1300,
363
+ "ears_type": "unwanted-behaviour",
364
+ "unwanted_condition": "one source calls one of {{COSTLY_OPS}} more than 10 times in 10 minutes",
365
+ "action": "ask for a challenge (Turnstile, hCaptcha or reCAPTCHA) before going on, and never for the first attempt",
366
+ "rationale": "Bots go for what costs us or helps them; a challenge after repetition stops automation without taxing real users (OWASP Automated Threats OAT-007 Credential Cracking, OAT-008 Credential Stuffing, OAT-019 Account Creation).",
367
+ "hubWhen": {
368
+ "BOTS": [
369
+ "challenge"
370
+ ]
371
+ }
372
+ },
373
+ {
374
+ "id": "req-bots-managed",
375
+ "type": "requirement",
376
+ "label": "Automated traffic stopped at the edge",
377
+ "x": 260,
378
+ "y": 1430,
379
+ "ears_type": "unwanted-behaviour",
380
+ "unwanted_condition": "a request to one of {{COSTLY_OPS}} is scored as automated by the edge's bot detection",
381
+ "action": "block or challenge it at the edge before it reaches the element, letting verified bots (search engines, monitoring) through, and report the blocked share every day",
382
+ "rationale": "Distributed bots stay under every per-caller limit; detection on many signals at once is what catches them (OWASP Automated Threats to Web Applications).",
383
+ "hubWhen": {
384
+ "BOTS": [
385
+ "managed"
386
+ ]
387
+ }
388
+ },
389
+ {
390
+ "id": "req-bots-none",
391
+ "type": "requirement",
392
+ "label": "Costly operations need identity",
393
+ "x": 260,
394
+ "y": 1560,
395
+ "ears_type": "ubiquitous",
396
+ "action": "offer {{COSTLY_OPS}} only to callers with a valid account or partner key, so that each can be counted and blocked by who it is",
397
+ "rationale": "Without bot protection, the only defence for a costly operation is that nobody anonymous can reach it (OWASP API6:2023).",
398
+ "hubWhen": {
399
+ "BOTS": [
400
+ "none"
401
+ ]
402
+ }
403
+ },
404
+ {
405
+ "id": "req-internet",
406
+ "type": "requirement",
407
+ "label": "Floods absorbed at the edge",
408
+ "x": 260,
409
+ "y": 1690,
410
+ "ears_type": "ubiquitous",
411
+ "action": "accept internet traffic only through the provider's edge with volumetric DDoS protection, and refuse connections to the origin from anywhere else",
412
+ "rationale": "A flood measured in gigabits cannot be limited by the element it is aimed at; an origin reachable directly bypasses every edge rule (OWASP Denial of Service Cheat Sheet).",
413
+ "hubWhen": {
414
+ "EXPOSURE": [
415
+ "internet"
416
+ ]
417
+ }
418
+ },
419
+ {
420
+ "id": "req-partners",
421
+ "type": "requirement",
422
+ "label": "Limits per partner",
423
+ "x": 260,
424
+ "y": 1820,
425
+ "ears_type": "state-driven",
426
+ "precondition": "a partner has used more than 80 % of its agreed limit for 15 minutes",
427
+ "action": "alert the partner's owner on our side, so that the limit is raised by agreement or the partner is told before it is refused",
428
+ "rationale": "Limits per partner are agreements, not just defences; a partner that hits its limit unannounced is an outage for its users (OWASP API4:2023).",
429
+ "hubWhen": {
430
+ "EXPOSURE": [
431
+ "partners"
432
+ ]
433
+ }
434
+ },
435
+ {
436
+ "id": "sc-limit",
437
+ "type": "scenario",
438
+ "label": "Excess refused",
439
+ "x": 520,
440
+ "y": 0,
441
+ "given": "one caller and ten others at normal load",
442
+ "when": "the one sends ten times {{LIMIT_PER_MIN}} requests a minute for three minutes",
443
+ "then": "at least 99 % of its excess gets 429 with Retry-After, and the others' 95th percentile stays within 10 % of normal"
444
+ },
445
+ {
446
+ "id": "sc-size",
447
+ "type": "scenario",
448
+ "label": "Large body refused",
449
+ "x": 520,
450
+ "y": 130,
451
+ "given": "every write operation of the router",
452
+ "when": "a body of 100 times {{MAX_BODY_KB}} KB is sent to each",
453
+ "then": "each is refused with 413"
454
+ },
455
+ {
456
+ "id": "sc-pages",
457
+ "type": "scenario",
458
+ "label": "Page size capped",
459
+ "x": 520,
460
+ "y": 260,
461
+ "given": "every paginated operation of the router",
462
+ "when": "a caller asks each for a page of 10 000, and then for a page without a size",
463
+ "then": "the first is refused with 400, and the second holds at most {{MAX_PAGE_ITEMS}} items"
464
+ },
465
+ {
466
+ "id": "sc-token-bucket",
467
+ "type": "scenario",
468
+ "label": "Burst admitted",
469
+ "x": 520,
470
+ "y": 390,
471
+ "given": "a caller that has sent nothing for a minute",
472
+ "when": "it sends {{BURST}} requests at once and then twice its rate for a minute",
473
+ "then": "the burst is accepted, and of the minute's requests no more than {{LIMIT_PER_MIN}} plus 10 % are, the rest getting 429",
474
+ "hubWhen": {
475
+ "ALGORITHM": [
476
+ "token-bucket"
477
+ ]
478
+ }
479
+ },
480
+ {
481
+ "id": "sc-sliding-window",
482
+ "type": "scenario",
483
+ "label": "Edge burst refused",
484
+ "x": 520,
485
+ "y": 520,
486
+ "given": "a caller",
487
+ "when": "it sends {{LIMIT_PER_MIN}} requests in the last second of one minute and as many in the first second of the next",
488
+ "then": "the second batch gets 429",
489
+ "hubWhen": {
490
+ "ALGORITHM": [
491
+ "sliding-window"
492
+ ]
493
+ }
494
+ },
495
+ {
496
+ "id": "sc-fixed-window",
497
+ "type": "scenario",
498
+ "label": "Quota visible",
499
+ "x": 520,
500
+ "y": 650,
501
+ "given": "a caller that has made 10 requests this minute",
502
+ "when": "it makes another",
503
+ "then": "the response says the limit is {{LIMIT_PER_MIN}}, that {{LIMIT_PER_MIN}} minus 11 remain, and when the window resets",
504
+ "hubWhen": {
505
+ "ALGORITHM": [
506
+ "fixed-window"
507
+ ]
508
+ }
509
+ },
510
+ {
511
+ "id": "sc-key-account",
512
+ "type": "scenario",
513
+ "label": "Anonymous flood",
514
+ "x": 520,
515
+ "y": 780,
516
+ "given": "a source address without a credential and a signed-in user",
517
+ "when": "the address sends {{ANON_LIMIT_PER_MIN}} requests and 10 more within a minute",
518
+ "then": "the 10 get 429 and the signed-in user's requests are unaffected",
519
+ "hubWhen": {
520
+ "KEY": [
521
+ "account"
522
+ ]
523
+ }
524
+ },
525
+ {
526
+ "id": "sc-key-apikey",
527
+ "type": "scenario",
528
+ "label": "Invalid key ignored",
529
+ "x": 520,
530
+ "y": 910,
531
+ "given": "a partner's key with one request of its limit left",
532
+ "when": "another source sends {{ANON_LIMIT_PER_MIN}} and 10 more requests naming that key with a wrong secret, and then the partner sends its request",
533
+ "then": "the forged requests are refused with 401, then 429 after {{ANON_LIMIT_PER_MIN}}, and the partner's request is accepted",
534
+ "hubWhen": {
535
+ "KEY": [
536
+ "apikey"
537
+ ]
538
+ }
539
+ },
540
+ {
541
+ "id": "sc-key-ip",
542
+ "type": "scenario",
543
+ "label": "Forged header ignored",
544
+ "x": 520,
545
+ "y": 1040,
546
+ "given": "a caller over its limit",
547
+ "when": "it sends a request with a forged X-Forwarded-For value, and then from another address in its /64",
548
+ "then": "both are counted against the same caller and refused",
549
+ "hubWhen": {
550
+ "KEY": [
551
+ "ip"
552
+ ]
553
+ }
554
+ },
555
+ {
556
+ "id": "sc-shared-counters",
557
+ "type": "scenario",
558
+ "label": "Limit holds on two instances",
559
+ "x": 520,
560
+ "y": 1170,
561
+ "given": "two instances sharing a store",
562
+ "when": "one caller sends twice {{LIMIT_PER_MIN}} requests in a minute spread over both, and again with the store stopped",
563
+ "then": "no more than one instance alone accepts plus 10 % are accepted, and with the store stopped the caller is still refused past one instance's limit",
564
+ "hubWhen": {
565
+ "WHERE": [
566
+ "app"
567
+ ]
568
+ }
569
+ },
570
+ {
571
+ "id": "sc-bots-challenge",
572
+ "type": "scenario",
573
+ "label": "Bot challenged",
574
+ "x": 520,
575
+ "y": 1300,
576
+ "given": "one source",
577
+ "when": "its first attempt at one of {{COSTLY_OPS}} is made, and then 10 more in 10 minutes",
578
+ "then": "the first attempt sees no challenge and the 11th is answered with one",
579
+ "hubWhen": {
580
+ "BOTS": [
581
+ "challenge"
582
+ ]
583
+ }
584
+ },
585
+ {
586
+ "id": "sc-bots-managed",
587
+ "type": "scenario",
588
+ "label": "Headless browser stopped",
589
+ "x": 520,
590
+ "y": 1430,
591
+ "given": "the edge's bot detection in blocking mode",
592
+ "when": "a headless browser script calls the first of {{COSTLY_OPS}} from 50 addresses",
593
+ "then": "its requests are challenged or blocked at the edge and none reach the element",
594
+ "hubWhen": {
595
+ "BOTS": [
596
+ "managed"
597
+ ]
598
+ }
599
+ },
600
+ {
601
+ "id": "sc-bots-none",
602
+ "type": "scenario",
603
+ "label": "Anonymous costly call refused",
604
+ "x": 520,
605
+ "y": 1560,
606
+ "given": "every route the router marks costly",
607
+ "when": "each is called without a credential",
608
+ "then": "each is refused with 401",
609
+ "hubWhen": {
610
+ "BOTS": [
611
+ "none"
612
+ ]
613
+ }
614
+ },
615
+ {
616
+ "id": "sc-internet",
617
+ "type": "scenario",
618
+ "label": "Origin hidden",
619
+ "x": 520,
620
+ "y": 1690,
621
+ "given": "the element behind its edge",
622
+ "when": "each of its origin addresses is called directly from the internet",
623
+ "then": "every connection is refused",
624
+ "hubWhen": {
625
+ "EXPOSURE": [
626
+ "internet"
627
+ ]
628
+ }
629
+ },
630
+ {
631
+ "id": "sc-partners",
632
+ "type": "scenario",
633
+ "label": "Near the limit",
634
+ "x": 520,
635
+ "y": 1820,
636
+ "given": "a partner with an agreed limit",
637
+ "when": "it runs at 85 % of it for 15 minutes",
638
+ "then": "its owner on our side is alerted",
639
+ "hubWhen": {
640
+ "EXPOSURE": [
641
+ "partners"
642
+ ]
643
+ }
644
+ },
645
+ {
646
+ "id": "adr-gateway",
647
+ "type": "adr",
648
+ "label": "Limits at the API gateway",
649
+ "x": 780,
650
+ "y": 0,
651
+ "concern": "rate-limiting",
652
+ "status": "accepted",
653
+ "date": "",
654
+ "context": "This element takes requests from people or other systems outside it. The forces: one caller, by mistake (a retry loop, a bad deploy) or on purpose, can use up capacity meant for all; bots guess passwords, create accounts, scrape data and run up the bill of costly operations (messages sent, searches, third-party calls); a request or a page can be large enough to exhaust memory before it is refused; limits that are too tight, or keyed on an address shared by an office or a mobile carrier, lock out real users; and a limit counted on one instance of many is no limit at all. Snippets assume the router's table in src/app (routes with method, path, an example and the flags paginated and costly), black-box tests against $BASE_URL of a staging deployment with credentials in TOKEN_* variables, the gateway's decK file under gateway/, and Terraform plans read with terraform show -json.",
655
+ "decision": "Requests pass an API gateway that limits each caller, counted by {{KEY}}, to {{LIMIT_PER_MIN}} requests a minute using {{ALGORITHM}}, refuses bodies over {{MAX_BODY_KB}} KB, and answers the excess with 429 and Retry-After; counters are shared by all gateway nodes. The element is reachable by {{EXPOSURE}}; bots on costly operations: {{BOTS}}. Choosing the gateway: the one already in the path. Match the algorithm: AWS API Gateway (usage plans) and Envoy's local rate limit are token buckets, NGINX limit_req a leaky bucket with a burst, Kong's open-source rate-limiting plugin fixed windows (sliding windows in Kong Enterprise and Azure API Management's rate-limit-by-key). Judge by whether it can key on the validated token's subject or the API key, share counters across nodes (Redis, a global rate limit service) and set limits per caller.",
656
+ "consequences": "• One place for every route's limits, applied before the element spends anything.\n• The gateway must see the caller's identity: it validates tokens or keys itself.\n• Limits that depend on business data (plan, tenant) need the gateway to read it, or a second limit in the element.\n• Limits need tuning from real traffic; start in log-only mode for a week.",
657
+ "alternatives": "1. At the edge WAF: earlier and cheaper, but approximate and keyed mostly on addresses.\n2. In the application: knows the business, but a request has already reached the element.\n3. Rely on autoscaling: pays for abuse instead of stopping it.",
658
+ "hubWhen": {
659
+ "WHERE": [
660
+ "gateway"
661
+ ]
662
+ }
663
+ },
664
+ {
665
+ "id": "adr-waf",
666
+ "type": "adr",
667
+ "label": "Limits at the edge",
668
+ "x": 780,
669
+ "y": 130,
670
+ "concern": "rate-limiting",
671
+ "status": "accepted",
672
+ "date": "",
673
+ "context": "This element takes requests from people or other systems outside it. The forces: one caller, by mistake (a retry loop, a bad deploy) or on purpose, can use up capacity meant for all; bots guess passwords, create accounts, scrape data and run up the bill of costly operations (messages sent, searches, third-party calls); a request or a page can be large enough to exhaust memory before it is refused; limits that are too tight, or keyed on an address shared by an office or a mobile carrier, lock out real users; and a limit counted on one instance of many is no limit at all. Snippets assume the router's table in src/app (routes with method, path, an example and the flags paginated and costly), black-box tests against $BASE_URL of a staging deployment with credentials in TOKEN_* variables, the gateway's decK file under gateway/, and Terraform plans read with terraform show -json.",
674
+ "decision": "Rate rules at the edge WAF or CDN limit each caller, counted by {{KEY}}, to {{LIMIT_PER_MIN}} requests a minute using {{ALGORITHM}} as closely as the product allows, refuse bodies over {{MAX_BODY_KB}} KB, and answer the excess with 429 and Retry-After; the origin accepts traffic only from the edge. The element is reachable by {{EXPOSURE}}; bots on costly operations: {{BOTS}}. Choosing the product: Cloudflare WAF rate limiting rules, AWS WAF rate-based rules (with CloudFront or an ALB), Azure Front Door WAF rate limit rules or Akamai; judge by the keys it can count on (address, header, cookie, JWT claim), the shortest window it supports, how fast it starts blocking, and its price per million requests.",
675
+ "consequences": "• Floods are refused before they reach our network or our bill.\n• Counts are approximate and lag by seconds: the limit is a ceiling, not an exact figure.\n• Keys are mostly addresses and headers; per-account limits need the edge to read a token claim or a second limit further in.\n• The edge provider is on every request's path.",
676
+ "alternatives": "1. At the API gateway: exact, keyed on the validated caller, but after traffic entered our network.\n2. In the application: knows the business, latest of all.",
677
+ "hubWhen": {
678
+ "WHERE": [
679
+ "waf"
680
+ ]
681
+ }
682
+ },
683
+ {
684
+ "id": "adr-app",
685
+ "type": "adr",
686
+ "label": "Limits in the application",
687
+ "x": 780,
688
+ "y": 260,
689
+ "concern": "rate-limiting",
690
+ "status": "accepted",
691
+ "date": "",
692
+ "context": "This element takes requests from people or other systems outside it. The forces: one caller, by mistake (a retry loop, a bad deploy) or on purpose, can use up capacity meant for all; bots guess passwords, create accounts, scrape data and run up the bill of costly operations (messages sent, searches, third-party calls); a request or a page can be large enough to exhaust memory before it is refused; limits that are too tight, or keyed on an address shared by an office or a mobile carrier, lock out real users; and a limit counted on one instance of many is no limit at all. Snippets assume the router's table in src/app (routes with method, path, an example and the flags paginated and costly), black-box tests against $BASE_URL of a staging deployment with credentials in TOKEN_* variables, the gateway's decK file under gateway/, and Terraform plans read with terraform show -json.",
693
+ "decision": "The element limits each caller, counted by {{KEY}}, to {{LIMIT_PER_MIN}} requests a minute using {{ALGORITHM}}, in middleware that runs before any handler, with counters in a shared Redis; bodies over {{MAX_BODY_KB}} KB are refused by the server's own limit. The excess gets 429 and Retry-After. The element is reachable by {{EXPOSURE}}; bots on costly operations: {{BOTS}}. Choosing the library: the framework's own (ASP.NET Core rate limiting) or a maintained one with a Redis store (Bucket4j with its Spring Boot starter for Java, express-rate-limit with rate-limit-redis for Node, django-ratelimit for Python); judge by its algorithms, atomic shared counters and per-route configuration.",
694
+ "consequences": "• Limits can follow business data: plan, tenant, operation cost.\n• A request has already reached the element when it is refused: floods still need protection in front.\n• Redis is on the request path; when it is unreachable, the per-instance fallback limits less exactly.",
695
+ "alternatives": "1. At the API gateway: before the element, but blind to business data.\n2. At the edge WAF: earliest and cheapest, approximate.",
696
+ "hubWhen": {
697
+ "WHERE": [
698
+ "app"
699
+ ]
700
+ }
701
+ },
702
+ {
703
+ "id": "ff-noisy",
704
+ "type": "fitness-fn",
705
+ "label": "Noisy caller contained",
706
+ "x": 1040,
707
+ "y": 0,
708
+ "characteristic": "performance-efficiency",
709
+ "scope": "holistic",
710
+ "cadence": "triggered",
711
+ "trigger": "nightly",
712
+ "invocation": "automated",
713
+ "description": "A load test in the staging environment runs normal traffic from several callers and a flood from one, and compares the others' response times with a baseline run without the flood; 90 % of the flood is excess, so 99 % of the excess is 89 % of the flood.\n\nThreshold: With one caller at 10 times {{LIMIT_PER_MIN}} requests a minute, other callers' 95th percentile stays within 10 % of the baseline and at least 99 % of the flood's excess gets 429 with Retry-After\n\nTool: Grafana k6\n\n```js\nimport http from 'k6/http'\nimport { check } from 'k6'\n\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst BASELINE_P95 = Number(__ENV.BASELINE_P95_MS)\n\nexport const options = {\n scenarios: {\n normal: { executor: 'constant-arrival-rate', rate: 20, timeUnit: '1s', duration: '3m', preAllocatedVUs: 50, env: { KEY: 'normal' } },\n flood: { executor: 'constant-arrival-rate', rate: LIMIT * 10, timeUnit: '1m', duration: '3m', preAllocatedVUs: 200, env: { KEY: 'flood' } },\n },\n thresholds: {\n 'http_req_duration{scenario:normal}': [`p(95)<${BASELINE_P95 * 1.1}`],\n 'checks{scenario:flood}': ['rate>0.89'],\n },\n}\n\nexport default function () {\n const res = http.get(`${__ENV.BASE_URL}/orders`, { headers: { Authorization: `Bearer ${__ENV['TOKEN_' + __ENV.KEY]}` } })\n if (__ENV.KEY === 'flood') check(res, { 'limited with Retry-After': (r) => r.status === 429 && !!r.headers['Retry-After'] })\n}\n```"
714
+ },
715
+ {
716
+ "id": "ff-body",
717
+ "type": "fitness-fn",
718
+ "label": "Oversized bodies refused",
719
+ "x": 1040,
720
+ "y": 130,
721
+ "characteristic": "security",
722
+ "scope": "atomic",
723
+ "cadence": "triggered",
724
+ "trigger": "pull-request",
725
+ "invocation": "automated",
726
+ "description": "A test lists the write operations from the router (not from a list kept by hand), sends an oversized body to each and expects 413, which fails when a new route or a proxy change drops the size limit.\n\nThreshold: A body of 100 times {{MAX_BODY_KB}} KB is answered with 413 on 100 % of the router's write operations\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes: the router's table\n\nconst oversized = Buffer.alloc({{MAX_BODY_KB}} * 100 * 1024, 'a')\n\ndescribe.each(routes.filter((r) => ['POST', 'PUT', 'PATCH'].includes(r.method)))('%s %s', (route) => {\n it('refuses an oversized body with 413', async () => {\n const res = await request(app)[route.method.toLowerCase()](route.example)\n .set('Content-Type', 'application/octet-stream').send(oversized)\n expect(res.status).toBe(413)\n })\n})\n```"
727
+ },
728
+ {
729
+ "id": "ff-pages",
730
+ "type": "fitness-fn",
731
+ "label": "Pages capped",
732
+ "x": 1040,
733
+ "y": 260,
734
+ "characteristic": "security",
735
+ "scope": "atomic",
736
+ "cadence": "triggered",
737
+ "trigger": "pull-request",
738
+ "invocation": "automated",
739
+ "description": "A test lists the paginated operations from the router (routes flagged paginated), asks each for an oversized page and for a default one, and checks the refusal and the count.\n\nThreshold: Every paginated operation refuses a page size of 10 000 with 400 and returns at most {{MAX_PAGE_ITEMS}} items without a size; 0 exceptions\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes flagged paginated name their page-size parameter\n\ndescribe.each(routes.filter((r) => r.paginated))('GET %s', (route) => {\n it('caps the page', async () => {\n await request(app).get(route.example).query({ [route.pageSizeParam]: 10_000 }).set(auth(user)).expect(400)\n const res = await request(app).get(route.example).set(auth(user)).expect(200)\n expect(res.body.items.length).toBeLessThanOrEqual({{MAX_PAGE_ITEMS}})\n })\n})\n```"
740
+ },
741
+ {
742
+ "id": "ff-bucket",
743
+ "type": "fitness-fn",
744
+ "label": "Bucket admits a burst, keeps the rate",
745
+ "x": 1040,
746
+ "y": 390,
747
+ "characteristic": "security",
748
+ "scope": "holistic",
749
+ "cadence": "triggered",
750
+ "trigger": "deploy",
751
+ "invocation": "automated",
752
+ "description": "A black-box test against the staging deployment lets the bucket fill, sends the burst in parallel, then sends at twice the rate for a minute and counts what was accepted.\n\nThreshold: After a minute idle, {{BURST}} requests at once are all accepted; of twice {{LIMIT_PER_MIN}} requests spread over the next minute, at most {{LIMIT_PER_MIN}} plus 10 % are accepted and the rest get 429\n\nTool: Vitest with fetch against $BASE_URL (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst BURST = {{BURST}}\nconst call = () => fetch(`${process.env.BASE_URL}/orders`, { headers: { Authorization: `Bearer ${process.env.TOKEN_BUCKET}` } })\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\n\nit('admits a burst, then holds the rate', async () => {\n await sleep(60_000) // a minute idle: the bucket is full\n const burst = await Promise.all(Array.from({ length: BURST }, call))\n expect(burst.map((r) => r.status)).toEqual(Array(BURST).fill(200))\n let accepted = 0\n for (let i = 0; i < LIMIT * 2; i++) { // twice the rate for one minute\n const res = await call()\n if (res.status === 200) accepted++\n else expect(res.status).toBe(429)\n await sleep(30_000 / LIMIT)\n }\n expect(accepted).toBeLessThanOrEqual(LIMIT * 1.1)\n}, 200_000)\n```",
753
+ "hubWhen": {
754
+ "ALGORITHM": [
755
+ "token-bucket"
756
+ ]
757
+ }
758
+ },
759
+ {
760
+ "id": "ff-sliding",
761
+ "type": "fitness-fn",
762
+ "label": "Window edges hold",
763
+ "x": 1040,
764
+ "y": 520,
765
+ "characteristic": "security",
766
+ "scope": "holistic",
767
+ "cadence": "triggered",
768
+ "trigger": "deploy",
769
+ "invocation": "automated",
770
+ "description": "A black-box test against the staging deployment waits for second 59, sends the limit at once, waits two seconds past the minute boundary and sends the limit again.\n\nThreshold: {{LIMIT_PER_MIN}} requests in the last second of a minute are accepted and {{LIMIT_PER_MIN}} in the first second of the next all get 429\n\nTool: Vitest with fetch against $BASE_URL (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst call = () => fetch(`${process.env.BASE_URL}/orders`, { headers: { Authorization: `Bearer ${process.env.TOKEN_WINDOW}` } })\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\nconst untilSecond = async (s: number) => { while (new Date().getSeconds() !== s) await sleep(100) }\n\nit('refuses a burst that straddles the minute boundary', async () => {\n await untilSecond(59)\n const first = await Promise.all(Array.from({ length: LIMIT }, call))\n await sleep(2_000)\n const second = await Promise.all(Array.from({ length: LIMIT }, call))\n expect(first.filter((r) => r.status === 200)).toHaveLength(LIMIT)\n expect(second.filter((r) => r.status === 429)).toHaveLength(LIMIT)\n}, 120_000)\n```",
771
+ "hubWhen": {
772
+ "ALGORITHM": [
773
+ "sliding-window"
774
+ ]
775
+ }
776
+ },
777
+ {
778
+ "id": "ff-fixed",
779
+ "type": "fitness-fn",
780
+ "label": "Quota headers present",
781
+ "x": 1040,
782
+ "y": 650,
783
+ "characteristic": "security",
784
+ "scope": "holistic",
785
+ "cadence": "triggered",
786
+ "trigger": "deploy",
787
+ "invocation": "automated",
788
+ "description": "A black-box test against the staging deployment makes eleven requests at the start of a minute and reads the RateLimit header fields of the last answer.\n\nThreshold: After 10 requests in a minute, the 11th answer carries the limit {{LIMIT_PER_MIN}}, {{LIMIT_PER_MIN}} minus 11 remaining and a reset of at most 60 seconds\n\nTool: Vitest with fetch against $BASE_URL (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst call = () => fetch(`${process.env.BASE_URL}/orders`, { headers: { Authorization: `Bearer ${process.env.TOKEN_QUOTA}` } })\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\n\nit('shows the quota with every answer', async () => {\n while (new Date().getSeconds() !== 0) await sleep(100) // the start of a calendar minute\n for (let i = 0; i < 10; i++) await call()\n const res = await call()\n // IETF draft-ietf-httpapi-ratelimit-headers up to -07; newer drafts fold the three into one RateLimit field\n expect(Number(res.headers.get('ratelimit-limit'))).toBe(LIMIT)\n expect(Number(res.headers.get('ratelimit-remaining'))).toBe(LIMIT - 11)\n expect(Number(res.headers.get('ratelimit-reset'))).toBeLessThanOrEqual(60)\n}, 120_000)\n```",
789
+ "hubWhen": {
790
+ "ALGORITHM": [
791
+ "fixed-window"
792
+ ]
793
+ }
794
+ },
795
+ {
796
+ "id": "ff-key-account",
797
+ "type": "fitness-fn",
798
+ "label": "Anonymous limit apart",
799
+ "x": 1040,
800
+ "y": 780,
801
+ "characteristic": "security",
802
+ "scope": "holistic",
803
+ "cadence": "triggered",
804
+ "trigger": "deploy",
805
+ "invocation": "automated",
806
+ "description": "A black-box test against the staging deployment floods a public route from one address without a credential, then calls with a user's token from the same address.\n\nThreshold: From one address without a credential, {{ANON_LIMIT_PER_MIN}} requests are accepted and the next 10 get 429; a signed-in user's request from the same address is accepted\n\nTool: Vitest with fetch against $BASE_URL (or the test runner of your stack)\n\n```ts\nconst ANON = {{ANON_LIMIT_PER_MIN}}\nconst anon = () => fetch(`${process.env.BASE_URL}/products`)\nconst user = () => fetch(`${process.env.BASE_URL}/products`, { headers: { Authorization: `Bearer ${process.env.TOKEN_USER}` } })\n\nit('limits anonymous addresses lower and apart from signed-in callers', async () => {\n const statuses: number[] = []\n for (let i = 0; i < ANON + 10; i++) statuses.push((await anon()).status)\n expect(statuses.slice(0, ANON)).toEqual(Array(ANON).fill(200))\n expect(statuses.slice(ANON)).toEqual(Array(10).fill(429))\n expect((await user()).status).toBe(200)\n}, 120_000)\n```",
807
+ "hubWhen": {
808
+ "KEY": [
809
+ "account"
810
+ ]
811
+ }
812
+ },
813
+ {
814
+ "id": "ff-key-apikey",
815
+ "type": "fitness-fn",
816
+ "label": "Invalid keys do not count",
817
+ "x": 1040,
818
+ "y": 910,
819
+ "characteristic": "security",
820
+ "scope": "holistic",
821
+ "cadence": "triggered",
822
+ "trigger": "deploy",
823
+ "invocation": "automated",
824
+ "description": "A black-box test against the staging deployment uses up a partner's limit but one, floods with a forged key from another address, and checks that the partner's last request still passes.\n\nThreshold: With one request of a partner's limit left, {{ANON_LIMIT_PER_MIN}} requests naming its key with a wrong secret get 401 and the next 10 get 429; the partner's request is then accepted\n\nTool: Vitest with fetch against $BASE_URL (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst ANON = {{ANON_LIMIT_PER_MIN}}\nconst url = `${process.env.BASE_URL}/orders`\nconst partner = () => fetch(url, { headers: { 'X-Api-Key': process.env.PARTNER_KEY! } })\nconst forged = () => fetch(url, { headers: { 'X-Api-Key': `${process.env.PARTNER_KEY_ID}.wrong-secret` } })\n\nit('refuses invalid keys before counting, and limits them per address', async () => {\n for (let i = 0; i < LIMIT - 1; i++) expect((await partner()).status).toBe(200) // one request left\n const statuses: number[] = []\n for (let i = 0; i < ANON + 10; i++) statuses.push((await forged()).status)\n expect(statuses.slice(0, ANON)).toEqual(Array(ANON).fill(401))\n expect(statuses.slice(ANON)).toEqual(Array(10).fill(429))\n expect((await partner()).status).toBe(200) // the forged calls did not count\n}, 300_000)\n```",
825
+ "hubWhen": {
826
+ "KEY": [
827
+ "apikey"
828
+ ]
829
+ }
830
+ },
831
+ {
832
+ "id": "ff-key-ip",
833
+ "type": "fitness-fn",
834
+ "label": "Addresses counted fairly",
835
+ "x": 1040,
836
+ "y": 1040,
837
+ "characteristic": "security",
838
+ "scope": "holistic",
839
+ "cadence": "triggered",
840
+ "trigger": "deploy",
841
+ "invocation": "automated",
842
+ "description": "A black-box test against the staging deployment floods from the runner's address and then forges the header; a second test, from a runner on the trusted-proxy list, presents addresses as the proxy would and checks the /64 grouping.\n\nThreshold: A forged X-Forwarded-For from outside does not reset a caller's count; two addresses in one IPv6 /64 share one count; an address in another /64 has its own\n\nTool: Vitest with fetch against $BASE_URL and, for the proxy path, from a runner on the trusted-proxy list (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst direct = (headers = {}) => fetch(`${process.env.BASE_URL}/products`, { headers })\nconst viaProxy = (ip: string) => fetch(`${process.env.INTERNAL_URL}/products`, { headers: { 'X-Forwarded-For': ip } }) // this runner is a trusted proxy in staging\n\nit('ignores a forged X-Forwarded-For from outside', async () => {\n for (let i = 0; i < LIMIT; i++) await direct()\n expect((await direct({ 'X-Forwarded-For': '203.0.113.9' })).status).toBe(429)\n}, 120_000)\n\nit('counts an IPv6 /64 as one caller', async () => {\n for (let i = 0; i < LIMIT; i++) await viaProxy('2001:db8:1:2::1')\n expect((await viaProxy('2001:db8:1:2::ffff')).status).toBe(429)\n expect((await viaProxy('2001:db8:1:3::1')).status).toBe(200)\n}, 120_000)\n```",
843
+ "hubWhen": {
844
+ "KEY": [
845
+ "ip"
846
+ ]
847
+ }
848
+ },
849
+ {
850
+ "id": "ff-gateway",
851
+ "type": "fitness-fn",
852
+ "label": "Every route limited",
853
+ "x": 1040,
854
+ "y": 1170,
855
+ "characteristic": "security",
856
+ "scope": "atomic",
857
+ "cadence": "triggered",
858
+ "trigger": "pull-request",
859
+ "invocation": "automated",
860
+ "description": "A Conftest policy over the gateway's declarative configuration (Kong decK file) fails the pull request when a service has no rate limit at any level, or one higher than agreed that carries no limit-exception tag; both rate-limiting (config.minute) and rate-limiting-advanced (the limit for the 60-second window) are read.\n\nThreshold: 0 gateway services without a rate-limiting plugin on the service, one of its routes, or globally; 0 per-minute limits above {{LIMIT_PER_MIN}} without an exception tag naming its ticket\n\nTool: Conftest (Open Policy Agent) over the Kong decK configuration\n\n```rego\npackage main\n\nimport rego.v1\n\nlimit_plugins := {\"rate-limiting\", \"rate-limiting-advanced\"}\n\nplugins_of(s) := array.concat(object.get(s, \"plugins\", []), [p | some r in object.get(s, \"routes\", []); some p in object.get(r, \"plugins\", [])])\n\nlimited(s) if { some p in plugins_of(s); p.name in limit_plugins }\nglobal if { some p in object.get(input, \"plugins\", []); p.name in limit_plugins }\n\n# an agreed exception carries a tag with its ticket: limit-exception:ARCH-123\nexcepted(p) if { some t in object.get(p, \"tags\", []); startswith(t, \"limit-exception:\") }\n\nper_minute(p) := p.config.minute if p.name == \"rate-limiting\"\nper_minute(p) := p.config.limit[i] if { p.name == \"rate-limiting-advanced\"; some i; p.config.window_size[i] == 60 }\n\ndeny contains msg if {\n not global\n some s in input.services\n not limited(s)\n msg := sprintf(\"service %s has no rate limit on it or its routes\", [s.name])\n}\n\ndeny contains msg if {\n some s in input.services\n some p in plugins_of(s)\n p.name in limit_plugins\n not excepted(p)\n per_minute(p) > {{LIMIT_PER_MIN}}\n msg := sprintf(\"service %s allows %v a minute without an exception tag\", [s.name, per_minute(p)])\n}\n```",
861
+ "hubWhen": {
862
+ "WHERE": [
863
+ "gateway"
864
+ ]
865
+ }
866
+ },
867
+ {
868
+ "id": "ff-waf",
869
+ "type": "fitness-fn",
870
+ "label": "Edge rate rule present",
871
+ "x": 1040,
872
+ "y": 1300,
873
+ "characteristic": "security",
874
+ "scope": "atomic",
875
+ "cadence": "triggered",
876
+ "trigger": "pull-request",
877
+ "invocation": "automated",
878
+ "description": "A Conftest policy over the Terraform plan fails when a WAF web ACL has no rate-based rule that blocks, so the edge limit cannot disappear in a refactoring.\n\nThreshold: Every web ACL in front of the element holds a rate-based rule in blocking mode; 0 plan changes that remove it\n\nTool: Conftest (Open Policy Agent) over terraform show -json (AWS WAF; for Cloudflare: the cloudflare_ruleset resource with phase http_ratelimit, checked the same way)\n\n```rego\npackage main\n\nimport rego.v1\n\nrate_rule(acl) if {\n some r in acl.rule\n some s in r.statement\n count(s.rate_based_statement) > 0\n some a in r.action\n count(a.block) > 0\n}\n\ndeny contains msg if {\n some rc in input.resource_changes\n rc.type == \"aws_wafv2_web_acl\"\n not rate_rule(rc.change.after)\n msg := sprintf(\"%s has no blocking rate-based rule\", [rc.address])\n}\n```",
879
+ "hubWhen": {
880
+ "WHERE": [
881
+ "waf"
882
+ ]
883
+ }
884
+ },
885
+ {
886
+ "id": "ff-app",
887
+ "type": "fitness-fn",
888
+ "label": "Limit holds across instances",
889
+ "x": 1040,
890
+ "y": 1430,
891
+ "characteristic": "security",
892
+ "scope": "atomic",
893
+ "cadence": "triggered",
894
+ "trigger": "pull-request",
895
+ "invocation": "automated",
896
+ "description": "An integration test starts two instances of the element with a Redis container, measures what one instance alone accepts from a flood (the single-instance allowance, whatever the algorithm), then spreads the same flood over both and compares; a last run stops Redis and expects the per-instance fallback to refuse.\n\nThreshold: Two instances sharing Redis accept no more from one caller in a minute than one instance alone plus 10 %, and no more than {{LIMIT_PER_MIN}} + {{BURST}}; another caller is still accepted; with Redis stopped, one instance still refuses past its own limit\n\nTool: Vitest with supertest and Testcontainers (Redis) (or the test runner of your stack)\n\n```ts\nconst LIMIT = {{LIMIT_PER_MIN}}\nconst BURST = {{BURST}}\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms))\nconst flood = async (targets: Instance[], n: number) => {\n let accepted = 0\n for (let i = 0; i < n; i++) if ((await request(targets[i % targets.length]).get('/orders').set(auth(caller))).status === 200) accepted++\n return accepted\n}\n\nit('accepts no more across two instances than one instance does', async () => {\n const [a, b] = await startInstances(2, { redisUrl: redis.getConnectionUrl() })\n const alone = await flood([a], LIMIT * 2) // the single-instance allowance\n await sleep(60_000)\n const pair = await flood([a, b], LIMIT * 2)\n expect(pair).toBeLessThanOrEqual(alone * 1.1)\n expect(pair).toBeLessThanOrEqual(LIMIT + BURST)\n await request(b).get('/orders').set(auth(otherCaller)).expect(200)\n}, 300_000)\n\nit('still limits per instance when Redis is unreachable', async () => {\n const [a] = await startInstances(1, { redisUrl: redis.getConnectionUrl() })\n await redis.stop()\n expect(await flood([a], LIMIT * 2)).toBeLessThan(LIMIT * 2)\n}, 300_000)\n```",
897
+ "hubWhen": {
898
+ "WHERE": [
899
+ "app"
900
+ ]
901
+ }
902
+ },
903
+ {
904
+ "id": "ff-bots-challenge",
905
+ "type": "fitness-fn",
906
+ "label": "Repeated costly calls challenged",
907
+ "x": 1040,
908
+ "y": 1560,
909
+ "characteristic": "security",
910
+ "scope": "holistic",
911
+ "cadence": "triggered",
912
+ "trigger": "pull-request",
913
+ "invocation": "automated",
914
+ "description": "An end-to-end test uses the password reset (one of the costly operations, with no lockout of its own) from one browser context: the first attempt must show no challenge widget, the eleventh must; the locator covers Turnstile, hCaptcha and reCAPTCHA.\n\nThreshold: The 1st attempt at a costly operation from a fresh source shows no challenge; the 11th within 10 minutes shows one\n\nTool: Playwright\n\n```ts\nconst CHALLENGE = 'iframe[src*=\"challenges.cloudflare.com\"], iframe[src*=\"hcaptcha.com\"], iframe[src*=\"google.com/recaptcha\"]'\n\nconst resetOnce = async (page: Page) => {\n await page.goto('/password-reset')\n await page.getByLabel('Email').fill('someone@example.com')\n await page.getByRole('button', { name: 'Send reset link' }).click()\n}\n\ntest('a repeated costly operation is challenged, a first attempt never', async ({ page }) => {\n await resetOnce(page)\n await expect(page.locator(CHALLENGE)).toHaveCount(0)\n for (let i = 0; i < 10; i++) await resetOnce(page)\n await expect(page.locator(CHALLENGE)).toBeVisible()\n})\n```",
915
+ "hubWhen": {
916
+ "BOTS": [
917
+ "challenge"
918
+ ]
919
+ }
920
+ },
921
+ {
922
+ "id": "ff-bots-managed",
923
+ "type": "fitness-fn",
924
+ "label": "Bot control enabled",
925
+ "x": 1040,
926
+ "y": 1690,
927
+ "characteristic": "security",
928
+ "scope": "atomic",
929
+ "cadence": "triggered",
930
+ "trigger": "pull-request",
931
+ "invocation": "automated",
932
+ "description": "A Conftest policy over the Terraform plan fails when the edge's managed bot rule group is missing or overridden to count, which would let bots through silently.\n\nThreshold: The web ACL in front of the element holds the managed bot rule group, not in count-only mode\n\nTool: Conftest (Open Policy Agent) over terraform show -json, for AWS WAF Bot Control (for Cloudflare: the cloudflare_bot_management resource; for Akamai: the akamai_botman_* resources; each checked the same way for presence and a blocking action)\n\n```rego\npackage main\n\nimport rego.v1\n\nbot_control(acl) if {\n some r in acl.rule\n some s in r.statement\n some m in s.managed_rule_group_statement\n m.name == \"AWSManagedRulesBotControlRuleSet\"\n some o in r.override_action\n count(o.none) > 0\n}\n\ndeny contains msg if {\n some rc in input.resource_changes\n rc.type == \"aws_wafv2_web_acl\"\n not bot_control(rc.change.after)\n msg := sprintf(\"%s does not enforce AWS WAF Bot Control\", [rc.address])\n}\n```",
933
+ "hubWhen": {
934
+ "BOTS": [
935
+ "managed"
936
+ ]
937
+ }
938
+ },
939
+ {
940
+ "id": "ff-bots-none",
941
+ "type": "fitness-fn",
942
+ "label": "Costly operations behind identity",
943
+ "x": 1040,
944
+ "y": 1820,
945
+ "characteristic": "security",
946
+ "scope": "atomic",
947
+ "cadence": "triggered",
948
+ "trigger": "pull-request",
949
+ "invocation": "automated",
950
+ "description": "A test lists the routes flagged costly from the router (not from a list kept by hand) and calls each without a credential, expecting 401; a new costly route fails the test until it is protected or flagged.\n\nThreshold: Every route the router marks costly answers 401 without a credential; 0 exceptions\n\nTool: Vitest with supertest (or the test runner and HTTP client of your stack)\n\n```ts\nimport request from 'supertest'\nimport { app, routes } from '../src/app' // routes flagged costly: the operations listed in the decision\n\ndescribe.each(routes.filter((r) => r.costly))('%s %s', (route) => {\n it('refuses a call without a credential', async () => {\n await request(app)[route.method.toLowerCase()](route.example).expect(401)\n })\n})\n```",
951
+ "hubWhen": {
952
+ "BOTS": [
953
+ "none"
954
+ ]
955
+ }
956
+ },
957
+ {
958
+ "id": "ff-origin",
959
+ "type": "fitness-fn",
960
+ "label": "Origin closed to the internet",
961
+ "x": 1040,
962
+ "y": 1950,
963
+ "characteristic": "security",
964
+ "scope": "atomic",
965
+ "cadence": "triggered",
966
+ "trigger": "nightly",
967
+ "invocation": "automated",
968
+ "description": "A scheduled job on a runner outside the provider's network tries each origin address directly over HTTPS and fails when any answers, which would mean the edge and its limits can be bypassed.\n\nThreshold: 0 of the origin addresses answer a connection from the internet; every one is refused or times out\n\nTool: curl in a scheduled job on a runner outside the edge\n\n```bash\n#!/usr/bin/env bash\n# ORIGIN_ADDRESSES: the origin's addresses or host names as the edge sees them, space separated\nset -uo pipefail\nfail=0\nfor origin in $ORIGIN_ADDRESSES; do\n if curl -sk --max-time 10 -o /dev/null \"https://$origin/\"; then echo \"$origin answers directly, bypassing the edge\"; fail=1; fi\ndone\nexit $fail\n```",
969
+ "hubWhen": {
970
+ "EXPOSURE": [
971
+ "internet"
972
+ ]
973
+ }
974
+ },
975
+ {
976
+ "id": "ff-partner-alert",
977
+ "type": "fitness-fn",
978
+ "label": "Partner near its limit",
979
+ "x": 1040,
980
+ "y": 2080,
981
+ "characteristic": "security",
982
+ "scope": "atomic",
983
+ "cadence": "continual",
984
+ "invocation": "automated",
985
+ "description": "A Prometheus rule over the gateway's per-consumer request counter alerts the partner's owner; a partner whose limit was raised by agreement gets a rule of its own with its figure.\n\nThreshold: An alert names every partner whose request rate has been above 80 % of its limit for 15 minutes\n\nTool: Prometheus alerting rules over Kong's prometheus plugin (per_consumer and status_code_metrics on; for the application: its own http_requests_total by caller)\n\n```yaml\ngroups:\n- name: partner-limits\n rules:\n - alert: PartnerNearLimit\n expr: sum by (consumer) (rate(kong_http_requests_total[15m])) * 60 > 0.8 * {{LIMIT_PER_MIN}}\n for: 15m\n labels: { severity: ticket }\n annotations: { summary: \"{{ $labels.consumer }} has run above 80 % of its limit for 15 minutes\" }\n # a partner with a raised limit, agreed and recorded: its own rule with its figure\n - alert: PartnerNearLimitAcme\n expr: sum(rate(kong_http_requests_total{consumer=\"acme\"}[15m])) * 60 > 0.8 * 3000\n for: 15m\n labels: { severity: ticket }\n```",
986
+ "hubWhen": {
987
+ "EXPOSURE": [
988
+ "partners"
989
+ ]
990
+ }
991
+ }
992
+ ],
993
+ "relations": [
994
+ {
995
+ "id": "req-limit--derives--need",
996
+ "sourceId": "req-limit",
997
+ "targetId": "need",
998
+ "relationType": "derives"
999
+ },
1000
+ {
1001
+ "id": "req-size--derives--need",
1002
+ "sourceId": "req-size",
1003
+ "targetId": "need",
1004
+ "relationType": "derives"
1005
+ },
1006
+ {
1007
+ "id": "req-pages--derives--need",
1008
+ "sourceId": "req-pages",
1009
+ "targetId": "need",
1010
+ "relationType": "derives"
1011
+ },
1012
+ {
1013
+ "id": "req-token-bucket--derives--need",
1014
+ "sourceId": "req-token-bucket",
1015
+ "targetId": "need",
1016
+ "relationType": "derives"
1017
+ },
1018
+ {
1019
+ "id": "req-sliding-window--derives--need",
1020
+ "sourceId": "req-sliding-window",
1021
+ "targetId": "need",
1022
+ "relationType": "derives"
1023
+ },
1024
+ {
1025
+ "id": "req-fixed-window--derives--need",
1026
+ "sourceId": "req-fixed-window",
1027
+ "targetId": "need",
1028
+ "relationType": "derives"
1029
+ },
1030
+ {
1031
+ "id": "req-key-account--derives--need",
1032
+ "sourceId": "req-key-account",
1033
+ "targetId": "need",
1034
+ "relationType": "derives"
1035
+ },
1036
+ {
1037
+ "id": "req-key-apikey--derives--need",
1038
+ "sourceId": "req-key-apikey",
1039
+ "targetId": "need",
1040
+ "relationType": "derives"
1041
+ },
1042
+ {
1043
+ "id": "req-key-ip--derives--need",
1044
+ "sourceId": "req-key-ip",
1045
+ "targetId": "need",
1046
+ "relationType": "derives"
1047
+ },
1048
+ {
1049
+ "id": "req-shared-counters--derives--need",
1050
+ "sourceId": "req-shared-counters",
1051
+ "targetId": "need",
1052
+ "relationType": "derives"
1053
+ },
1054
+ {
1055
+ "id": "req-bots-challenge--derives--need",
1056
+ "sourceId": "req-bots-challenge",
1057
+ "targetId": "need",
1058
+ "relationType": "derives"
1059
+ },
1060
+ {
1061
+ "id": "req-bots-managed--derives--need",
1062
+ "sourceId": "req-bots-managed",
1063
+ "targetId": "need",
1064
+ "relationType": "derives"
1065
+ },
1066
+ {
1067
+ "id": "req-bots-none--derives--need",
1068
+ "sourceId": "req-bots-none",
1069
+ "targetId": "need",
1070
+ "relationType": "derives"
1071
+ },
1072
+ {
1073
+ "id": "req-internet--derives--need",
1074
+ "sourceId": "req-internet",
1075
+ "targetId": "need",
1076
+ "relationType": "derives"
1077
+ },
1078
+ {
1079
+ "id": "req-partners--derives--need",
1080
+ "sourceId": "req-partners",
1081
+ "targetId": "need",
1082
+ "relationType": "derives"
1083
+ },
1084
+ {
1085
+ "id": "sc-limit--verifies--req-limit",
1086
+ "sourceId": "sc-limit",
1087
+ "targetId": "req-limit",
1088
+ "relationType": "verifies"
1089
+ },
1090
+ {
1091
+ "id": "sc-size--verifies--req-size",
1092
+ "sourceId": "sc-size",
1093
+ "targetId": "req-size",
1094
+ "relationType": "verifies"
1095
+ },
1096
+ {
1097
+ "id": "sc-pages--verifies--req-pages",
1098
+ "sourceId": "sc-pages",
1099
+ "targetId": "req-pages",
1100
+ "relationType": "verifies"
1101
+ },
1102
+ {
1103
+ "id": "sc-token-bucket--verifies--req-token-bucket",
1104
+ "sourceId": "sc-token-bucket",
1105
+ "targetId": "req-token-bucket",
1106
+ "relationType": "verifies"
1107
+ },
1108
+ {
1109
+ "id": "sc-sliding-window--verifies--req-sliding-window",
1110
+ "sourceId": "sc-sliding-window",
1111
+ "targetId": "req-sliding-window",
1112
+ "relationType": "verifies"
1113
+ },
1114
+ {
1115
+ "id": "sc-fixed-window--verifies--req-fixed-window",
1116
+ "sourceId": "sc-fixed-window",
1117
+ "targetId": "req-fixed-window",
1118
+ "relationType": "verifies"
1119
+ },
1120
+ {
1121
+ "id": "sc-key-account--verifies--req-key-account",
1122
+ "sourceId": "sc-key-account",
1123
+ "targetId": "req-key-account",
1124
+ "relationType": "verifies"
1125
+ },
1126
+ {
1127
+ "id": "sc-key-apikey--verifies--req-key-apikey",
1128
+ "sourceId": "sc-key-apikey",
1129
+ "targetId": "req-key-apikey",
1130
+ "relationType": "verifies"
1131
+ },
1132
+ {
1133
+ "id": "sc-key-ip--verifies--req-key-ip",
1134
+ "sourceId": "sc-key-ip",
1135
+ "targetId": "req-key-ip",
1136
+ "relationType": "verifies"
1137
+ },
1138
+ {
1139
+ "id": "sc-shared-counters--verifies--req-shared-counters",
1140
+ "sourceId": "sc-shared-counters",
1141
+ "targetId": "req-shared-counters",
1142
+ "relationType": "verifies"
1143
+ },
1144
+ {
1145
+ "id": "sc-bots-challenge--verifies--req-bots-challenge",
1146
+ "sourceId": "sc-bots-challenge",
1147
+ "targetId": "req-bots-challenge",
1148
+ "relationType": "verifies"
1149
+ },
1150
+ {
1151
+ "id": "sc-bots-managed--verifies--req-bots-managed",
1152
+ "sourceId": "sc-bots-managed",
1153
+ "targetId": "req-bots-managed",
1154
+ "relationType": "verifies"
1155
+ },
1156
+ {
1157
+ "id": "sc-bots-none--verifies--req-bots-none",
1158
+ "sourceId": "sc-bots-none",
1159
+ "targetId": "req-bots-none",
1160
+ "relationType": "verifies"
1161
+ },
1162
+ {
1163
+ "id": "sc-internet--verifies--req-internet",
1164
+ "sourceId": "sc-internet",
1165
+ "targetId": "req-internet",
1166
+ "relationType": "verifies"
1167
+ },
1168
+ {
1169
+ "id": "sc-partners--verifies--req-partners",
1170
+ "sourceId": "sc-partners",
1171
+ "targetId": "req-partners",
1172
+ "relationType": "verifies"
1173
+ },
1174
+ {
1175
+ "id": "ff-noisy--implements--adr-gateway",
1176
+ "sourceId": "ff-noisy",
1177
+ "targetId": "adr-gateway",
1178
+ "relationType": "implements"
1179
+ },
1180
+ {
1181
+ "id": "ff-noisy--implements--adr-waf",
1182
+ "sourceId": "ff-noisy",
1183
+ "targetId": "adr-waf",
1184
+ "relationType": "implements"
1185
+ },
1186
+ {
1187
+ "id": "ff-noisy--implements--adr-app",
1188
+ "sourceId": "ff-noisy",
1189
+ "targetId": "adr-app",
1190
+ "relationType": "implements"
1191
+ },
1192
+ {
1193
+ "id": "ff-body--implements--adr-gateway",
1194
+ "sourceId": "ff-body",
1195
+ "targetId": "adr-gateway",
1196
+ "relationType": "implements"
1197
+ },
1198
+ {
1199
+ "id": "ff-body--implements--adr-waf",
1200
+ "sourceId": "ff-body",
1201
+ "targetId": "adr-waf",
1202
+ "relationType": "implements"
1203
+ },
1204
+ {
1205
+ "id": "ff-body--implements--adr-app",
1206
+ "sourceId": "ff-body",
1207
+ "targetId": "adr-app",
1208
+ "relationType": "implements"
1209
+ },
1210
+ {
1211
+ "id": "ff-pages--implements--adr-gateway",
1212
+ "sourceId": "ff-pages",
1213
+ "targetId": "adr-gateway",
1214
+ "relationType": "implements"
1215
+ },
1216
+ {
1217
+ "id": "ff-pages--implements--adr-waf",
1218
+ "sourceId": "ff-pages",
1219
+ "targetId": "adr-waf",
1220
+ "relationType": "implements"
1221
+ },
1222
+ {
1223
+ "id": "ff-pages--implements--adr-app",
1224
+ "sourceId": "ff-pages",
1225
+ "targetId": "adr-app",
1226
+ "relationType": "implements"
1227
+ },
1228
+ {
1229
+ "id": "ff-bucket--implements--adr-gateway",
1230
+ "sourceId": "ff-bucket",
1231
+ "targetId": "adr-gateway",
1232
+ "relationType": "implements"
1233
+ },
1234
+ {
1235
+ "id": "ff-bucket--implements--adr-waf",
1236
+ "sourceId": "ff-bucket",
1237
+ "targetId": "adr-waf",
1238
+ "relationType": "implements"
1239
+ },
1240
+ {
1241
+ "id": "ff-bucket--implements--adr-app",
1242
+ "sourceId": "ff-bucket",
1243
+ "targetId": "adr-app",
1244
+ "relationType": "implements"
1245
+ },
1246
+ {
1247
+ "id": "ff-sliding--implements--adr-gateway",
1248
+ "sourceId": "ff-sliding",
1249
+ "targetId": "adr-gateway",
1250
+ "relationType": "implements"
1251
+ },
1252
+ {
1253
+ "id": "ff-sliding--implements--adr-waf",
1254
+ "sourceId": "ff-sliding",
1255
+ "targetId": "adr-waf",
1256
+ "relationType": "implements"
1257
+ },
1258
+ {
1259
+ "id": "ff-sliding--implements--adr-app",
1260
+ "sourceId": "ff-sliding",
1261
+ "targetId": "adr-app",
1262
+ "relationType": "implements"
1263
+ },
1264
+ {
1265
+ "id": "ff-fixed--implements--adr-gateway",
1266
+ "sourceId": "ff-fixed",
1267
+ "targetId": "adr-gateway",
1268
+ "relationType": "implements"
1269
+ },
1270
+ {
1271
+ "id": "ff-fixed--implements--adr-waf",
1272
+ "sourceId": "ff-fixed",
1273
+ "targetId": "adr-waf",
1274
+ "relationType": "implements"
1275
+ },
1276
+ {
1277
+ "id": "ff-fixed--implements--adr-app",
1278
+ "sourceId": "ff-fixed",
1279
+ "targetId": "adr-app",
1280
+ "relationType": "implements"
1281
+ },
1282
+ {
1283
+ "id": "ff-key-account--implements--adr-gateway",
1284
+ "sourceId": "ff-key-account",
1285
+ "targetId": "adr-gateway",
1286
+ "relationType": "implements"
1287
+ },
1288
+ {
1289
+ "id": "ff-key-account--implements--adr-waf",
1290
+ "sourceId": "ff-key-account",
1291
+ "targetId": "adr-waf",
1292
+ "relationType": "implements"
1293
+ },
1294
+ {
1295
+ "id": "ff-key-account--implements--adr-app",
1296
+ "sourceId": "ff-key-account",
1297
+ "targetId": "adr-app",
1298
+ "relationType": "implements"
1299
+ },
1300
+ {
1301
+ "id": "ff-key-apikey--implements--adr-gateway",
1302
+ "sourceId": "ff-key-apikey",
1303
+ "targetId": "adr-gateway",
1304
+ "relationType": "implements"
1305
+ },
1306
+ {
1307
+ "id": "ff-key-apikey--implements--adr-waf",
1308
+ "sourceId": "ff-key-apikey",
1309
+ "targetId": "adr-waf",
1310
+ "relationType": "implements"
1311
+ },
1312
+ {
1313
+ "id": "ff-key-apikey--implements--adr-app",
1314
+ "sourceId": "ff-key-apikey",
1315
+ "targetId": "adr-app",
1316
+ "relationType": "implements"
1317
+ },
1318
+ {
1319
+ "id": "ff-key-ip--implements--adr-gateway",
1320
+ "sourceId": "ff-key-ip",
1321
+ "targetId": "adr-gateway",
1322
+ "relationType": "implements"
1323
+ },
1324
+ {
1325
+ "id": "ff-key-ip--implements--adr-waf",
1326
+ "sourceId": "ff-key-ip",
1327
+ "targetId": "adr-waf",
1328
+ "relationType": "implements"
1329
+ },
1330
+ {
1331
+ "id": "ff-key-ip--implements--adr-app",
1332
+ "sourceId": "ff-key-ip",
1333
+ "targetId": "adr-app",
1334
+ "relationType": "implements"
1335
+ },
1336
+ {
1337
+ "id": "ff-gateway--implements--adr-gateway",
1338
+ "sourceId": "ff-gateway",
1339
+ "targetId": "adr-gateway",
1340
+ "relationType": "implements"
1341
+ },
1342
+ {
1343
+ "id": "ff-waf--implements--adr-waf",
1344
+ "sourceId": "ff-waf",
1345
+ "targetId": "adr-waf",
1346
+ "relationType": "implements"
1347
+ },
1348
+ {
1349
+ "id": "ff-app--implements--adr-app",
1350
+ "sourceId": "ff-app",
1351
+ "targetId": "adr-app",
1352
+ "relationType": "implements"
1353
+ },
1354
+ {
1355
+ "id": "ff-bots-challenge--implements--adr-gateway",
1356
+ "sourceId": "ff-bots-challenge",
1357
+ "targetId": "adr-gateway",
1358
+ "relationType": "implements"
1359
+ },
1360
+ {
1361
+ "id": "ff-bots-challenge--implements--adr-waf",
1362
+ "sourceId": "ff-bots-challenge",
1363
+ "targetId": "adr-waf",
1364
+ "relationType": "implements"
1365
+ },
1366
+ {
1367
+ "id": "ff-bots-challenge--implements--adr-app",
1368
+ "sourceId": "ff-bots-challenge",
1369
+ "targetId": "adr-app",
1370
+ "relationType": "implements"
1371
+ },
1372
+ {
1373
+ "id": "ff-bots-managed--implements--adr-gateway",
1374
+ "sourceId": "ff-bots-managed",
1375
+ "targetId": "adr-gateway",
1376
+ "relationType": "implements"
1377
+ },
1378
+ {
1379
+ "id": "ff-bots-managed--implements--adr-waf",
1380
+ "sourceId": "ff-bots-managed",
1381
+ "targetId": "adr-waf",
1382
+ "relationType": "implements"
1383
+ },
1384
+ {
1385
+ "id": "ff-bots-managed--implements--adr-app",
1386
+ "sourceId": "ff-bots-managed",
1387
+ "targetId": "adr-app",
1388
+ "relationType": "implements"
1389
+ },
1390
+ {
1391
+ "id": "ff-bots-none--implements--adr-gateway",
1392
+ "sourceId": "ff-bots-none",
1393
+ "targetId": "adr-gateway",
1394
+ "relationType": "implements"
1395
+ },
1396
+ {
1397
+ "id": "ff-bots-none--implements--adr-waf",
1398
+ "sourceId": "ff-bots-none",
1399
+ "targetId": "adr-waf",
1400
+ "relationType": "implements"
1401
+ },
1402
+ {
1403
+ "id": "ff-bots-none--implements--adr-app",
1404
+ "sourceId": "ff-bots-none",
1405
+ "targetId": "adr-app",
1406
+ "relationType": "implements"
1407
+ },
1408
+ {
1409
+ "id": "ff-origin--implements--adr-gateway",
1410
+ "sourceId": "ff-origin",
1411
+ "targetId": "adr-gateway",
1412
+ "relationType": "implements"
1413
+ },
1414
+ {
1415
+ "id": "ff-origin--implements--adr-waf",
1416
+ "sourceId": "ff-origin",
1417
+ "targetId": "adr-waf",
1418
+ "relationType": "implements"
1419
+ },
1420
+ {
1421
+ "id": "ff-origin--implements--adr-app",
1422
+ "sourceId": "ff-origin",
1423
+ "targetId": "adr-app",
1424
+ "relationType": "implements"
1425
+ },
1426
+ {
1427
+ "id": "ff-partner-alert--implements--adr-gateway",
1428
+ "sourceId": "ff-partner-alert",
1429
+ "targetId": "adr-gateway",
1430
+ "relationType": "implements"
1431
+ },
1432
+ {
1433
+ "id": "ff-partner-alert--implements--adr-waf",
1434
+ "sourceId": "ff-partner-alert",
1435
+ "targetId": "adr-waf",
1436
+ "relationType": "implements"
1437
+ },
1438
+ {
1439
+ "id": "ff-partner-alert--implements--adr-app",
1440
+ "sourceId": "ff-partner-alert",
1441
+ "targetId": "adr-app",
1442
+ "relationType": "implements"
1443
+ }
1444
+ ]
1445
+ }