Discover and secure your API endpoints (·续

Note

Place exception rules above (before) enforcement rules in your rule list. Cloudflare evaluates custom rules in order, and the first matching rule with a terminating action stops evaluation. For more information, refer to Rule execution order.

Configure Super Bot Fight Mode (Pro, Business)

Super Bot Fight Mode provides granular controls that apply across your domain, allowing you to apply different actions to different bot types.

Note

If you are upgrading from Bot Fight Mode to Super Bot Fight Mode, go to Security > Settings, filter by Bot traffic, and turn Bot fight mode off.

To configure Super Bot Fight Mode:

  1. In the Cloudflare dashboard, go to the Security Settings page. Go to Settings ↗
  2. Filter by Bot traffic.
  3. Go to Super Bot fight mode.
  4. Turn Super Bot fight mode on.
  5. Choose how your domain should respond to various types of traffic by selecting the associated edit icon:
  6. For more details on verified bots, refer to Verified Bots.
  7. For more details on supported file types, refer to Static resource protection.
  8. For more details on invisible code injection, refer to JavaScript detections.
  9. For more details on WordPress optimization, refer to Super Bot Fight Mode for WordPress.

With Super Bot Fight Mode, you can configure different actions for different bot types:

  • Block or allow verified bots
  • Configure a separate action (allow, block, or challenge) for Definitely automated traffic (bot score of 1)
  • On Business plans and above: Configure a separate action for Likely automated traffic (bot score of 2-29)

Super Bot Fight Mode applies domain-wide and does not support path-specific rules. If you need to apply different bot thresholds to different API paths, you need a Bot Management subscription (Enterprise).

Bot score in custom rules (Enterprise)

With a Bot Management subscription, you can write custom rules using cf.bot_management.score to set path-specific thresholds. For example, block requests with a bot score below 30 on /api/auth paths while allowing all scores on other API paths. For more information, refer to Bot Management.

Detect leaked credentials on login endpoints

Application Security leaked credentials detection checks incoming requests for username and password combinations that appeared in known data breaches. Use this detection to rate limit or challenge requests containing compromised credentials on your authentication endpoints.

Note

Access to the cf.waf.credential_check.username_and_password_leaked field (User and Password Leaked) requires a Pro plan or above. If you are on a Free plan, use the cf.waf.credential_check.password_leaked field (Password Leaked) instead, which indicates whether the password detected in the request was previously leaked.

The following rate limiting rule limits requests that contain a previously leaked username and password combination to 5 per minute per IP:

Setting Value
Expression cf.waf.credential_check.username_and_password_leaked
Counting characteristics IP
Requests per period 5 requests / 1 minute
Action Block

For the full expression including account takeover (ATO) detection IDs, refer to Example mitigation rules.

Sequence Analytics and sequence mitigation custom rules (Enterprise)

API Shield tracks the order of API endpoint requests over time, grouping important user journeys (sequences) across your API. Sequences with high precedence scores indicate requests that are likely to occur together in order. Anomalous sequences may indicate automated abuse, such as a bot that calls /auth, then /account, then /transfer in rapid succession. For more information, refer to Sequence Analytics.

Enterprise users with a Fraud Detection subscription can also create sequence mitigation custom rules to mitigate invalid sequences of API calls.

Monitor your API traffic

After deploying your security rules, review the results to identify false positives and tune your thresholds. False positives (legitimate clients being blocked) and false negatives (abuse getting through) both require adjustments.

Review Security Events for API paths

Security Events shows every request that your rules matched, including the action taken and the rule that triggered it. Filter by your API path prefix to see what Cloudflare is blocking and why.

  1. In the Cloudflare dashboard, go to the Analytics page. Go to Analytics ↗
  2. Select the Events tab.
  3. Add a filter for URI Path starts with /api/.
  4. Review the events. Look for legitimate clients that are being blocked (false positives). Common indicators of false positives:
  5. Requests from known partner IP addresses
  6. Requests with valid API keys or authorization headers
  7. Requests from monitoring services with known User-Agent strings

If you find false positives, update your custom rules to exclude the affected traffic. Refer to the exception rule procedure in an earlier section.

Tune rate limiting thresholds

Rate limiting thresholds that are too tight block legitimate clients. Thresholds that are too loose allow abuse. Review rate limiting events in Security Events to find the right balance.

  1. In the Cloudflare dashboard, go to the Analytics page. Go to Analytics ↗
  2. Select the Events tab.
  3. Filter by Action equals Block and Service equals Rate limiting.
  4. Check whether blocked requests come from legitimate clients or abusive traffic.
  5. If legitimate clients are being rate limited, edit the relevant rate limiting rule to increase the request threshold or widen the time period for the affected rule.
  6. If abusive traffic is getting through, lower the rule threshold or narrow the time period.

Security Analytics rate analysis requires an Enterprise plan

Enterprise customers can use the Request rate analysis tab in Security Analytics to visualize request rate distributions and the Log action to observe rule matches without taking action. On other plans, estimate thresholds based on your expected traffic patterns. Refer to Find an appropriate rate limit for the full methodology.

Set up notifications for security event spikes

Cloudflare Notifications can alert you when security event volume exceeds a threshold, indicating a potential attack or a misconfigured rule.

  1. In the Cloudflare dashboard, go to the Notifications page. Go to Notifications ↗
  2. Select Add.
  3. Filter by WAF and select Security Events Alert.
  4. Define a name for the notification and the delivery method (email, webhook, or PagerDuty).
  5. Next, configure the domains for which you want to receive notifications. You can also filter events by a targeted action (for example, Block or Skip).
  6. Select Create.

For the full list of available notification types, refer to Available notifications.

Advanced security events notifications (Enterprise)

Enterprise customers have access to the Advanced Security Events Alert notification type, which includes an additional filter for the app security services the alert should monitor.

Application Security

Bots

  • Bot Fight Mode — Automatic challenge for requests matching known bot patterns (Free plan)
  • Super Bot Fight Mode — Granular bot controls including verified bot allowlisting (Pro, Business, Enterprise)
  • Bot Management — Bot score, detection IDs, and custom rule templates (Enterprise)
  • Bot Management variables — Fields available in rule expressions for bot detection (Enterprise)

SSL/TLS

API Shield (Enterprise)

Was this helpful?

YesNo

On this page

Discover and secure your API endpoints (·续 - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/use-cases/solutions/discover-secure-api-endpoints/#page","headline":"Discover and secure your API endpoints (Free, Pro, and Business)","description":"Block API abuse, restrict unauthorized access, and monitor endpoint traffic using layered Cloudflare security features.","url":"https://developers.cloudflare.com/use-cases/solutions/discover-secure-api-endpoints/","inLanguage":"en","image":"https://developers.cloudflare.com/use-cases/solutions/discover-secure-api-endpoints/og.png?v=c9ebba8f904a3105","dateModified":"2026-08-03","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["REST API","Security"]}


description: Configure SSL/TLS encryption from edge to origin, redirect HTTP to HTTPS, and harden your HTTPS setup with HSTS and minimum TLS versions. title: Enforce HTTPS and encrypt all traffic (Free, Pro, and Business) image: https://developers.cloudflare.com/use-cases/solutions/encrypt-all-keep-site-secure/og.png?v=46949290e9a93ea3


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/use-cases/llms.txt
Use this file to discover all available pages before exploring further.