Capability

Rate Limiting

One IP, one user, one API key or one endpoint — you decide where to draw the limit.

TR7 Rate Limiting controls request volume, connection rate, authentication failures and bandwidth consumption at the WAAP layer through centralized policies. The goal is not just to return a 429 on excess traffic — it is to match the right scope to the right action based on the attack class, application behavior and backend capacity. TR7 uses a sliding-window counter model and the behavioral patterns built on top of it to detect sudden spikes, sustained high load and abuse attempts. Limits can be applied across different dimensions: IP, IP and user agent, username, custom header, cookie, API key or a composite key combining several of these. On the action side there is more than a flat deny. TR7 can stop a request with HTTP 429, apply a temporary block for a configurable duration, redirect to a self-hosted CAPTCHA flow, or apply conditional bandwidth shaping through the Bandwidth Limit Rule. The result: TR7 lifts rate limiting out of single-dimension security brake and turns it into an operational WAAP control that governs abuse, bot behavior, session misuse and resource consumption in the context of the application.

5+
Limit dimensions: IP, user, API key, composite and bandwidth
4
Action options: 429, temporary block, CAPTCHA, bandwidth cap
300 / 100 / 150
Built-in profile thresholds — production-ready starting points (requests/minute)

Limiting one IP is no longer enough to stop modern abuse.

Traditional rate limiting is usually applied as a request count per IP address. That model is simple, but NAT, carrier networks, shared egress points and anonymous gateways can put legitimate users and abuse sources in the same bucket. High traffic from a single IP is not always an attack; equally, distributed low-volume traffic is not always innocent.

Application behavior is not uniform. A short burst of asset requests during a page load is normal, but the same rate on a payment, login or API endpoint can signal abuse. A flat "N requests per minute" model can both harm user experience and miss genuine attacks.

Credential stuffing, account enumeration and bot patterns cannot be read from raw request counts alone. A large number of failed login attempts on an authentication endpoint may look low in total traffic. Counters that are not correlated with username, session, API key, custom header or response behavior lose their security context.

Resource protection is a separate concern. Even when distributed clients send requests at a low per-client rate, the aggregate load may exhaust a backend's connection pool, search infrastructure or file download capacity. Rate limiting is needed not only to stop an attacker, but to distribute backend capacity fairly and under control.

TR7's approach lifts rate limiting from a blunt IP-based threshold to a controlled security policy that can be applied across user, endpoint, session, API key, composite key and bandwidth dimensions.

Our approach

TR7 implements rate limiting as a multi-dimensional WAAP control designed around scope, counter model and action selection working together.

Sliding-window model tracks real traffic behavior

TR7 tracks request, connection, error and bandwidth rates within a configurable time window. Different window lengths let short-duration spikes and sustained high load be evaluated independently.

The limit key is chosen to match the attack class

Different scopes can be created using IP, IP and user agent, username, API key, cookie, header or composite keys. This allows abuse to be caught more precisely without penalizing legitimate users behind the same IP.

The action model is applied progressively based on severity

A policy can deny the request, apply a temporary block, redirect to CAPTCHA verification or impose a bandwidth cap. Not every violation is treated with the same level of response.

In-process counter architecture keeps latency low

Counters are maintained inside the data path — no external database call is needed at decision time. Multi-instance deployments are supported through counter synchronization, enabling consistent policy enforcement across distributed setups.

Capabilities

TR7 Rate Limiting covers different abuse scenarios — from ready-made bot policies to custom composite keys — through a single management model.

Built-in rate limiting profiles provide a production-ready starting point

TR7 ships with ready-made policies for common bot and abuse scenarios. The `bot_rateLimit` profile can return HTTP 429 at 300 requests per minute per IP. `bot_rateLimitStrict` can apply a 5-minute temporary block after 100 requests per minute. `bot_rateLimitCaptcha` can redirect to a self-hosted CAPTCHA flow after 150 requests per minute.

Trigger types separate plain requests, failed logins and risk score

The `requests` type tracks raw request rate. `failedAuthAttempts` handles failed authentication attempts with a dedicated counter. `riskScore` can make decisions based on a bot or behavioral score. `static` is used for unconditional controls such as mandatory CAPTCHA on a specific flow.

IP, user and composite key scopes can be used together

The `global` scope monitors aggregate load across an entire service. `ip`, `ip+ua`, `username` and `composite` scopes create more targeted limits. The composite structure can combine a custom header, cookie, API key or a field from the request body to produce a custom counter key. This flexibility lets B2B API and multi-tenant applications reflect real usage limits more accurately.

The same request can be evaluated against multiple rate policies simultaneously

A service pool can have multiple rate limiting policies active at the same time. For example, the same request can be subject to both an IP-scoped DDoS cap and a user-scoped fair-use limit. Each policy tracks its own independent counter. This structure enables a layered protection model instead of a single threshold.

The temporary block action keeps the key blocked even after the rate drops

When the `block` action fires, the affected key is held in the block table for the configured duration. This prevents an attacker from generating a short burst and then immediately returning after slowing down. The `blockDuration` is set per policy. This model provides stronger control against intense bot waves and repeat abuse sources.

Self-hosted CAPTCHA routes suspicious traffic to verification instead of a hard block

The `captcha` action can redirect traffic that has exceeded the threshold or is flagged as risky to a verification flow rather than cutting it off entirely. The default provider is `tr7Standard`. On successful verification the user's request proceeds. This approach offers a more balanced alternative to blocking in scenarios where separating real users from automation is the priority.

The Bandwidth Limit Rule enables conditional traffic shaping

TR7 can track inbound and outbound bandwidth rates in addition to request counts. With the `bwLimit` action, traffic matching a specific condition can be placed under its own bandwidth cap. This is useful for file download endpoints, endpoints that produce large responses, or high-volume data consumption from a single source — keeping the backend available without cutting it off entirely.

AAM session variables enable per-user rate limiting

Information such as the username from an AAM session can be used as a rate limiting key. This allows a separate fair-use limit to be assigned to each user after login. Free and paid plans, internal and external user groups, or different role levels can each be governed by different limits. This provides more accurate control in API and portal scenarios where IP-based limits fall short.

Operational depth

For rate limiting policies to be effective, counter lifetime, table size, cluster synchronization, observability and rollback behavior must all be managed with operational clarity.

01

Adaptive counter table sizing

Different scopes operate with different table sizes. The global scope uses a single key while IP and composite scopes can hold a much larger number of entries. Long keys such as IP combined with user agent can consume more memory, so scope selection should be made against the expected traffic profile.

02

Multi-instance synchronization

Counter synchronization across instances is supported in cluster deployments. Instances sharing the same policy key can discover each other and exchange counter state. This makes it harder for an attacker to bypass a limit by switching between instances in a load-distributed environment.

03

Counter continuity across reloads

Stable table naming tied to policy identity helps preserve counter state across reload cycles. When the same policy continues under the same name, counters are not reset unnecessarily. This reduces the risk of a security gap opening during maintenance or configuration updates.

04

Policy validation layer

Rate limiting policies go through schema validation before being deployed. Invalid scope, trigger type or action definitions cannot enter the production configuration. This check reduces the risk of a misconfigured security rule disrupting live traffic.

05

Action chain compatibility

Bot policy, account lockout rules and WAAP decisions can all run on the same request simultaneously. Priority order and match behavior are governed by configuration. Rate limiting therefore operates not in isolation but as part of the broader WAAP decision pipeline.

06

Audit and observability

On each trigger, rule ID, action, key and rate information can be logged. These records can be forwarded to a SIEM for incident analysis and reporting. Operations teams can monitor the most frequently triggered keys, the busiest endpoints and blocking trends over time.

When to use it

Layered per-user and per-IP limits on an API gateway

Organizations that offer B2B APIs can enforce a per-user plan limit and a per-IP abuse cap simultaneously. TR7 runs a user-scoped fair-use policy and an IP-scoped hard cap in parallel.

Failed attempt control on a login endpoint

A high number of failed credential entries on an authentication screen can be a brute-force indicator. TR7 can track failures using a combined username and IP key and apply escalating actions — CAPTCHA first, then a temporary lock.

Per-endpoint protection in an e-commerce flow

A short burst of requests on product pages may be normal, but the same pattern on a payment endpoint is a risk. TR7 can use endpoint conditions and different time windows to limit checkout abuse without degrading the page-load experience.

Bandwidth control on file download traffic

A single source can consume a backend's I/O capacity through high-volume downloads. TR7 uses the Bandwidth Limit Rule to cap that traffic conditionally, keeping the service available for other users.

Frequently asked questions

Does a per-IP rate limit affect real users behind NAT or shared egress?
An IP-based limit can count all users behind NAT or CGNAT under the same counter. To reduce this risk, TR7 offers composite key scopes — username, API key, cookie or IP combined with user agent. This lets abuse be caught more precisely without penalizing legitimate users behind the same IP.
What is the difference between the block action and the deny action?
The `deny` action returns HTTP 429 and the attacker can retry once the window expires. The `block` action holds the triggered key in the block table for the configured `blockDuration` — the attacker cannot return before that duration ends, even if they reduce their rate. For repeat abuse sources, `block` provides a harder and more persistent control.
How does the self-hosted CAPTCHA integration work?
The `captcha` action redirects traffic that has exceeded the threshold or is flagged as risky to a verification flow rather than cutting it off. The default provider is `tr7Standard`. On successful verification the user's request continues. This approach is a more balanced alternative to blocking in scenarios where distinguishing automation from real users is the goal.
Can more than one rate policy apply to the same endpoint?
Yes. Multiple rate limiting policies can be active in a service pool at the same time. For example, the same request can be subject to both an IP-scoped DDoS cap and a user-scoped fair-use limit simultaneously. Each policy tracks its own independent counter table and policies do not interfere with each other.
Does the Bandwidth Limit Rule work differently from request counting?
Yes. The `bwLimit` action tracks inbound and outbound bandwidth rates (`bytes_in_rate`, `bytes_out_rate`) rather than request counts. Traffic that matches the condition is placed under its own bandwidth cap, keeping the backend available without a hard cutoff. This is especially well suited to file download endpoints and endpoints that produce large responses.
Can different instances in a cluster share the same counter?
Yes. Counter synchronization is supported in multi-instance deployments. Instances sharing the same policy key discover each other automatically and share counter state. This mechanism makes it harder for an attacker to bypass a limit by switching instances, and ensures consistent policy enforcement across distributed setups.

Shape rate limiting to the context of your application

Multi-layer rate policy across IP, user, API key and bandwidth dimensions. Let us walk you through a live setup on your own services.