Enable IDS

Last updated Apr 17, 2026 Cloudflare's IDS takes advantage of the threat intelligence powered by our global network and extends the capabilities of the Cloudflare Firewall to monitor and protect your network from malicious actors.

You can enable IDS through the dashboard or via the API.

Note

This feature is available for Cloudflare Advanced Network Firewall users. For access, contact your account team.

  1. In the Cloudflare dashboard, go to the Firewall Policies ↗︎ page.
  2. Select IDS and turn on IDS.

To start using IDS via the API, first create a new ruleset in the magic-transit-ids-managed phase with a rule which is enabled.

  1. Follow instructions in the Rulesets Engine Page to view all rulesets for your account. You must see a ruleset with phase magic-transit-ids-managed and kind managed. If not, please contact your account team. The managed ruleset ID will be used in the next step.
  2. Create a new root ruleset with a single rule in the magic_transit_ids_managed phase by running:
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/rulesets \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
  "name": "IDS Execute ruleset",
  "description": "Ruleset to enable IDS",
  "kind": "root",
  "phase": "magic_transit_ids_managed",
  "rules": [
    {
      "enabled": true,
      "expression": "true",
      "action": "execute",
      "description": "enable ids",
      "action_parameters": {
        "id": "${managed_ruleset_id}"
      }
    }
  ]
}'

With this ruleset added, IDS will start inspecting packets and report any anomalous traffic. Next, you can configure Logpush to start receiving details about the anomalous traffic.

  1. Use the rule created in the previous step to enable or disable IDS. The Rulesets API documentation describes how to patch a rule.

    For example, the following patch request to set the enabled field to false will disable IDS. The ruleset and rule ID from the ruleset created in the previous step are used below.

curl --request PATCH \
https://api.cloudflare.com/client/v4/accounts/{account_id}/rulesets/{root_ruleset_id}/rules/{rule_id} \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
  "enabled": false,
  "expression": "true",
  "action": "execute",
  "action_parameters": {
    "id": "${managed_ruleset_id}"
  }
}'

Similarly, sending a patch request with the enabled field set to true will enable IDS.

IDS rules

IDS rules are run on a subset of packets. IDS also supports the current flows:

  • Cloudflare WAN to Cloudflare WAN.
  • Magic Transit ingress traffic (when egress traffic is handled through direct server return).
  • Magic Transit ingress and egress traffic when Magic Transit has the Egress option enabled.

Next steps

You must configure Logpush to log detected risks. Refer to Configure a Logpush destination for more information. Additionally, all traffic that is analyzed can be accessed via network analytics. Refer to GraphQL Analytics to query the analytics data.

Was this helpful?

YesNo

On this page

Enable IDS - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-network-firewall/how-to/enable-ids/#page","headline":"Enable IDS","description":"Enable the Intrusion Detection System for your account.","url":"https://developers.cloudflare.com/cloudflare-network-firewall/how-to/enable-ids/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-network-firewall/how-to/enable-ids/og.png?v=86f87571f1761cd0","dateModified":"2026-04-17","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/"}}


description: Enable managed rulesets for the Network Firewall. title: Enable Managed Rulesets image: https://developers.cloudflare.com/cloudflare-network-firewall/how-to/enable-managed-rulesets/og.png?v=349111908a473bb2


Skip to content

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