You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/managed-rulesets/deploy-managed-ruleset.mdx
+3-216Lines changed: 3 additions & 216 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ sidebar:
5
5
order: 2
6
6
---
7
7
8
-
import { RuleID } from"~/components";
8
+
import { RuleID, Render } from"~/components";
9
9
10
10
You can deploy a managed ruleset at the zone level or at the account level.
11
11
@@ -22,111 +22,7 @@ Use the following workflow to deploy a managed ruleset to a phase at the zone le
22
22
23
23
### Example
24
24
25
-
The following example deploys a WAF managed ruleset to the `http_request_firewall_managed` phase of a given zone (`{zone_id}`).
26
-
27
-
1. Search for an existing [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) for the `http_request_firewall_managed` phase using the [List zone rulesets](/api/operations/listZoneRulesets) operation and take note of the ruleset ID. This ruleset, if it exists, has the following properties: `"kind": "zone"` and `"phase": "http_request_firewall_managed"`.
2. If the entry point ruleset does not exist (the previous command returned a `404 Not Found` status code), create it using the [Create a zone ruleset](/api/operations/createZoneRuleset) operation. Include a single rule in the `rules` array that executes the [Cloudflare Managed Ruleset](/waf/managed-rules/reference/cloudflare-managed-ruleset/) (with ID <RuleIDid="efb7b8c949ac4650a09736fc376e9aee" />) for all incoming requests in the zone.
"description": "Entry point ruleset for WAF managed rulesets",
65
-
"kind": "zone",
66
-
"phase": "http_request_firewall_managed",
67
-
"rules": [
68
-
{
69
-
"action": "execute",
70
-
"action_parameters": {
71
-
"id": "efb7b8c949ac4650a09736fc376e9aee"
72
-
},
73
-
"expression": "true",
74
-
"description": "Execute the Cloudflare Managed Ruleset"
75
-
}
76
-
]
77
-
}'
78
-
```
79
-
80
-
If the entry point ruleset already exists, add a rule to this ruleset (with ID `{ruleset_id}`) using the [Create a zone ruleset rule](/api/operations/createZoneRulesetRule) operation. This rule executes the Cloudflare Managed Ruleset (with ID <RuleIDid="efb7b8c949ac4650a09736fc376e9aee" />) for all incoming requests in the zone.
In this example, the managed ruleset executes the behavior configured by Cloudflare. To customize the behavior of managed rulesets, refer to [Override a managed ruleset](/ruleset-engine/managed-rulesets/override-managed-ruleset/).
132
28
@@ -141,115 +37,6 @@ Use the following workflow to deploy a managed ruleset to a phase at the account
141
37
142
38
### Example
143
39
144
-
The following example deploys a WAF managed ruleset to the `http_request_firewall_managed` phase of a given account (`{account_id}`) by creating a rule that executes the managed ruleset. The rules in the managed ruleset are executed when the zone name matches one of `example.com` or `anotherexample.com`.
145
-
146
-
1. Search for an existing [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) for the `http_request_firewall_managed` phase using the [List account rulesets](/api/operations/listAccountRulesets) operation and take note of the ruleset ID. This ruleset, if it exists, has the following properties: `"kind": "root"` and `"phase": "http_request_firewall_managed"`.
2. If the entry point ruleset does not exist (the previous command returned a `404 Not Found` status code), create it using the [Create an account ruleset](/api/operations/createAccountRuleset) operation. Include a single rule in the `rules` array that executes the [Cloudflare Managed Ruleset](/waf/managed-rules/reference/cloudflare-managed-ruleset/) (with ID <RuleIDid="efb7b8c949ac4650a09736fc376e9aee" />) for all incoming requests where the zone name matches one of `example.com` or `anotherexample.com`.
If the entry point ruleset already exists, add a rule to this ruleset (with ID `{ruleset_id}`) using the [Create an account ruleset rule](/api/operations/createAccountRulesetRule) operation. This rule executes the Cloudflare Managed Ruleset (with ID <RuleIDid="efb7b8c949ac4650a09736fc376e9aee" />) for all incoming requests where the zone name matches one of `example.com` or `anotherexample.com`.
Managed rulesets deployed at the account level will only apply to incoming traffic of zones on an Enterprise plan. The expression of your `execute` rule must end with `and cf.zone.plan eq "ENT"` or else the API operation will fail.
In this example, the managed ruleset executes the behavior configured by Cloudflare. To customize the behavior of managed rulesets, refer to [Override a managed ruleset](/ruleset-engine/managed-rulesets/override-managed-ruleset/).
Copy file name to clipboardExpand all lines: src/content/docs/waf/account/managed-rulesets/deploy-api.mdx
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ head:
9
9
content: Deploy a WAF managed ruleset via API for an account
10
10
---
11
11
12
+
import { Render } from"~/components";
13
+
12
14
:::note
13
15
This feature requires an Enterprise plan with a paid add-on.
14
16
:::
@@ -17,7 +19,9 @@ Use the [Rulesets API](/ruleset-engine/rulesets-api/) to deploy a WAF managed ru
17
19
18
20
The [WAF Managed Rules](/waf/managed-rules/#managed-rulesets) page includes the IDs of the different WAF managed rulesets. You will need this information when deploying rulesets via API.
19
21
20
-
Refer to [Deploy a managed ruleset](/ruleset-engine/managed-rulesets/deploy-managed-ruleset/#deploy-a-managed-ruleset-to-a-phase-at-the-account-level) for instructions on deploying a managed ruleset via API.
@@ -26,3 +30,7 @@ To customize the behavior of the rules included in a managed ruleset, [create an
26
30
To skip the execution of WAF managed rulesets or some of their rules, [create an exception](/waf/managed-rules/waf-exceptions/define-api/) (also called a skip rule).
27
31
28
32
Exceptions have priority over overrides.
33
+
34
+
## More resources
35
+
36
+
For more information on working with managed rulesets via API, refer to [Work with managed rulesets](/ruleset-engine/managed-rulesets/) in the Ruleset Engine documentation.
Copy file name to clipboardExpand all lines: src/content/docs/waf/managed-rules/deploy-api.mdx
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,13 +9,19 @@ head:
9
9
content: Deploy a WAF managed ruleset via API for a zone
10
10
---
11
11
12
+
import { Render } from"~/components";
13
+
12
14
Use the [Rulesets API](/ruleset-engine/rulesets-api/) to deploy a managed ruleset at the account level or at the zone level.
13
15
14
16
Deploy WAF managed rulesets to the `http_request_firewall_managed` phase. Other managed rulesets, like DDoS Attack Protection managed rulesets, must be deployed to a different phase. Refer to the specific managed ruleset documentation for details.
15
17
16
18
The [WAF Managed Rules](/waf/managed-rules/#managed-rulesets) page includes the IDs of the different WAF managed rulesets. You will need this information when deploying the rulesets via API.
17
19
18
-
Refer to [Deploy a managed ruleset](/ruleset-engine/managed-rulesets/deploy-managed-ruleset/) for instructions on deploying a managed ruleset via API.
20
+
## Example
21
+
22
+
<Renderfile="api-managed-rules-zone-example" />
23
+
24
+
Refer to [Deploy a managed ruleset](/ruleset-engine/managed-rulesets/deploy-managed-ruleset/) for additional information on deploying a managed ruleset via API.
19
25
20
26
## Next steps
21
27
@@ -24,3 +30,7 @@ To customize the behavior of the rules included in a managed ruleset, [create an
24
30
To skip the execution of WAF managed rulesets or some of their rules, [create an exception](/waf/managed-rules/waf-exceptions/define-api/) (also called a skip rule).
25
31
26
32
Exceptions have priority over overrides.
33
+
34
+
## More resources
35
+
36
+
For more information on working with managed rulesets via API, refer to [Work with managed rulesets](/ruleset-engine/managed-rulesets/) in the Ruleset Engine documentation.
0 commit comments