コンテンツにスキップ

レート制限ルール

レート制限ルールを使用すると、式に一致するリクエストのレート制限を定義し、そのレート制限に達したときに実行するアクションを指定できます。

ルールパラメータ

Cloudflareのルールセットエンジンによって評価される他のルールと同様に、レート制限ルールには以下の基本パラメータがあります。

  • An expression that specifies the criteria you are matching traffic on using the Rules language.
  • An action that specifies what to perform when there is a match for the rule and any additional conditions are met. In the case of rate limiting rules, the action occurs when the rate reaches the specified limit.

Besides these two parameters, rate limiting rules require the following additional parameters:

  • Characteristics: The set of parameters that define how Cloudflare tracks the rate for this rule.
  • Period: The period of time to consider (in seconds) when evaluating the rate.
  • Requests per period: The number of requests over the period of time that will trigger the rate limiting rule.
  • Duration (or mitigation timeout): Once the rate is reached, the rate limiting rule blocks further requests for the period of time defined in this field.
  • Action behavior: By default, Cloudflare will apply the rule action for the configured duration (or mitigation timeout), regardless of the request rate during this period. Some Enterprise customers can configure the rule to throttle requests over the maximum rate, allowing incoming requests when the rate is lower than the configured limit.

必須およびオプションのパラメータに関する詳細については、レート制限パラメータを参照してください。

Cloudflareがリクエストのレートを決定する際に上記のパラメータをどのように使用するかについては、Cloudflareがリクエストレートを決定する方法を参照してください。

重要な注意事項

  • レート制限ルールは順番に評価され、一部のアクション(例: Block)は他のルールの評価を停止します。アクションとその動作に関する詳細については、アクションリファレンスを参照してください。

  • レート制限ルールは、正確なリクエスト数がオリジンサーバーに到達することを許可するようには設計されていません。状況によっては、リクエストを検出して内部カウンターを更新するまでに遅延(数秒程度)が発生することがあります。この遅延のために、過剰なリクエストがCloudflareが緩和アクション(ブロックやチャレンジなど)を実施する前にオリジンサーバーに到達する可能性があります。

  • 確認済みのボットにレート制限ルールを適用すると、検索エンジン最適化(SEO)に影響を与える可能性があります。詳細については、SEOの改善を参照してください。


利用可能性

FeatureFreeProBusinessEnterprise with app securityEnterprise with Advanced Rate Limiting
Available fields
in rule expression
Path, Verified BotHost, URI, Path, Full URI, Query, Verified BotHost, URI, Path, Full URI, Query, Method, Source IP, User Agent, Verified BotStandard fields, request header fields, dynamic fields (including Verified Bot), other Bot Management fields1Standard fields, request header fields, dynamic fields (including Verified Bot), other Bot Management fields1, request body fields2
Counting characteristicsIPIPIPIP, IP with NAT supportIP, IP with NAT support, Query, Host, Headers, Cookie, ASN, Country, Path, JA3/JA4 Fingerprint1, JSON field value2, Body2, Form input value2, Custom
Available fields
in counting expression
N/AN/AAll rule expression fields, Response code, Response headersAll rule expression fields, Response code, Response headersAll rule expression fields, Response code, Response headers
Counting modelNumber of requestsNumber of requestsNumber of requestsNumber of requestsNumber of requests,
complexity score
Rate limiting
action behavior
Perform action during mitigation periodPerform action during mitigation periodPerform action during mitigation periodPerform action during mitigation period,
Throttle requests above rate with block action
Perform action during mitigation period,
Throttle requests above rate with block action
Counting periods10 s10 s, 1 min10 s, 1 min, 10 min10 s, 1 min, 2 min, 5 min, 10 min10 s, 1 min, 2 min, 5 min, 10 min, 1 h
Mitigation timeout periods10 s10 s, 1 min, 1 h10 s, 1 min, 1 h, 1 day10 s, 1 min, 2 min, 5 min, 10 min, 1 h, 1 day310 s, 1 min, 2 min, 5 min, 10 min, 1 h, 1 day3
Number of rules1255 or more4100

1 Only available to Enterprise customers who have purchased Bot Management.
2 Availability depends on your WAF plan.
3 Enterprise customers can specify a custom mitigation timeout period via API.
4 Enterprise customers must have application security on their contract to get access to rate limiting rules. The number of rules depends on the exact contract terms.

次のステップ

プランや製品のサブスクリプションに応じて、ゾーンレベルおよびアカウントレベルでレート制限ルールを構成できます。

Cloudflareダッシュボードでレート制限ルールを構成するには、以下のリソースを参照してください。

また、ルールセットAPIを使用してレート制限ルールを構成することもできます。詳細については、API経由でレート制限ルールを作成するを参照してください。


関連リソース

使用量に基づいて請求され、現在は廃止されたレート制限ルールの以前のバージョンに関するガイダンスについては、Cloudflareレート制限(以前のバージョン)を参照してください。