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
<Detailsheader="Example: Add a single rule to a phase entry point ruleset at the zone level">
92
92
93
-
The following example adds a single rule to a phase entry point ruleset (with ID `{ruleset_id}`) at the zone level using the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation.
93
+
The following example adds a single rule to a phase entry point ruleset (with ID `{ruleset_id}`) at the zone level using the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/custom-rulesets/add-rules-ruleset.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ When you add rules to a custom ruleset using the [Update an account ruleset](/ap
13
13
14
14
You can use other API operations depending on the type of operation:
15
15
16
-
- Add a single rule to an existing custom ruleset: Use the [Create an account ruleset rule](/api/resources/rulesets/methods/create/Rule) operation.
16
+
- Add a single rule to an existing custom ruleset: Use the [Create an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.
17
17
- Update a single rule in a custom ruleset: Use the [Update an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/edit/) operation.
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/rulesets-api/view.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,9 +195,9 @@ Use one of the following API endpoints:
195
195
|[Get an account entry point ruleset version][gerv-account]|`GET /accounts/{account_id}/rulesets/phases/{phase_name}/entrypoint/versions/{version_number}`|
196
196
|[Get a zone entry point ruleset version][gerv-zone]|`GET /zones/{zone_id}/rulesets/phases/{phase_name}/entrypoint/versions/{version_number}`|
Copy file name to clipboardExpand all lines: src/content/docs/waf/custom-rules/skip/api-examples.mdx
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,6 @@ sidebar:
6
6
head:
7
7
- tag: title
8
8
content: API examples of custom rules with the Skip action
9
-
10
9
---
11
10
12
11
Use the [Rulesets API](/ruleset-engine/rulesets-api/) to configure custom rules via API.
@@ -17,17 +16,17 @@ The `skip` action supports different [skip options](/waf/custom-rules/skip/optio
17
16
18
17
This page contains examples of different skip rule scenarios for custom rules. Take the following into account:
19
18
20
-
* The `{zone_id}` value is the [ID of the zone](/fundamentals/setup/find-account-and-zone-ids/) where you want to add the rule.
19
+
- The `{zone_id}` value is the [ID of the zone](/fundamentals/setup/find-account-and-zone-ids/) where you want to add the rule.
21
20
22
-
* The `{ruleset_id}` value is the ID of the [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) of the `http_request_firewall_custom` phase. For details on obtaining this ruleset ID, refer to [List and view rulesets](/ruleset-engine/rulesets-api/view/). The API examples in this page add a skip rule to an existing ruleset using the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation.
21
+
- The `{ruleset_id}` value is the ID of the [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) of the `http_request_firewall_custom` phase. For details on obtaining this ruleset ID, refer to [List and view rulesets](/ruleset-engine/rulesets-api/view/). The API examples in this page add a skip rule to an existing ruleset using the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation.
23
22
24
23
However, the entry point ruleset may not exist yet. In this case, invoke the [Create a zone ruleset](/api/resources/rulesets/methods/create/) operation to create the entry point ruleset with a skip rule. Refer to [Create ruleset](/ruleset-engine/rulesets-api/create/#example---create-a-zone-level-phase-entry-point-ruleset) for an example.
25
24
26
-
* Although each example only includes one action parameter, you can use several skip options in the same rule by specifying the `ruleset`, `phases`, and `products` action parameters simultaneously.
25
+
- Although each example only includes one action parameter, you can use several skip options in the same rule by specifying the `ruleset`, `phases`, and `products` action parameters simultaneously.
27
26
28
27
## Skip the remaining rules in the current ruleset
29
28
30
-
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a skip rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip all remaining rules in the current ruleset for requests matching the rule expression:
29
+
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a skip rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip all remaining rules in the current ruleset for requests matching the rule expression:
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip the `http_ratelimit` phase for requests matching the rule expression:
47
+
This example invokes the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a rule to the existing `http_request_firewall_custom` phase entry point ruleset with ID `{ruleset_id}`. The rule will skip the `http_ratelimit` phase for requests matching the rule expression:
@@ -95,7 +94,7 @@ Refer to [Available skip options: Logging](/waf/custom-rules/skip/options/#loggi
95
94
96
95
## Skip security products
97
96
98
-
This example uses the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a rule that skips the [Zone Lockdown](/waf/tools/zone-lockdown/) and [User Agent Blocking](/waf/tools/user-agent-blocking/) products for requests matching the rule expression:
97
+
This example uses the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a rule that skips the [Zone Lockdown](/waf/tools/zone-lockdown/) and [User Agent Blocking](/waf/tools/user-agent-blocking/) products for requests matching the rule expression:
Copy file name to clipboardExpand all lines: src/content/docs/waf/managed-rules/waf-exceptions/define-api.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ The following example adds a rule that skips all remaining rules in the entry po
60
60
61
61
Save the entry point ruleset ID (`060013b1eeb14c93b0dcd896537e0d2c`) for the next step.
62
62
63
-
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) at the beginning of the rules list, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
63
+
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) at the beginning of the rules list, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
@@ -138,7 +138,7 @@ The following example adds a rule that skips the [Cloudflare Managed Ruleset](/w
138
138
- The ID of the entry point ruleset (`060013b1eeb14c93b0dcd896537e0d2c` in this example)
139
139
- The ID of the `execute` rule deployment the managed ruleset (`1bdb49371c1f46958fc8b985efcb79e7` in this example)
140
140
141
-
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
141
+
2. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it. The exact rule location is defined in the [`position` object](/ruleset-engine/rulesets-api/add-rule/#define-the-rule-position-in-the-ruleset).
@@ -270,7 +270,7 @@ The following example adds a rule that skips a particular rule of the [Cloudflar
270
270
- The ID of the Cloudflare Managed Ruleset (<RuleIDid="efb7b8c949ac4650a09736fc376e9aee" />)
271
271
- The ID of the rule to skip (<RuleIDid="d9e350f1b72d4730899c8a420e48a85d" /> in this example)
272
272
273
-
3. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it.
273
+
3. Invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation (a `POST` request) to add an exception (or skip rule) immediately before the `execute` rule deploying the Cloudflare Managed Ruleset, since a skip rule applies only to rules listed after it.
Copy file name to clipboardExpand all lines: src/content/partials/waf/api-generic-create-rule-procedure.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,6 @@ To create a {props.ruleType} for a zone, add a rule <Markdown text={props.extraO
11
11
12
12
1. Invoke the [Get a zone entry point ruleset](/api/resources/rulesets/subresources/phases/methods/get/) operation to obtain the definition of the entry point ruleset for the <code>{props.phaseName}</code> phase. You will need the [zone ID](/fundamentals/setup/find-account-and-zone-ids/) for this task.
13
13
14
-
2. If the entry point ruleset already exists (that is, if you received a `200 OK` status code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the [Create a zone ruleset rule](/api/resources/rulesets/methods/create/) operation to add a {props.ruleType} to the existing ruleset. Refer to the examples below for details.
14
+
2. If the entry point ruleset already exists (that is, if you received a `200 OK` status code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the [Create a zone ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add a {props.ruleType} to the existing ruleset. Refer to the examples below for details.
15
15
16
16
3. If the entry point ruleset does not exist (that is, if you received a `404 Not Found` status code in step 1), create it using the [Create a zone ruleset](/api/resources/rulesets/methods/create/) operation. Include your {props.ruleType} in the `rules` array. Refer to [Create ruleset](/ruleset-engine/rulesets-api/create/#example---create-a-zone-level-phase-entry-point-ruleset) for an example.
Copy file name to clipboardExpand all lines: src/content/partials/waf/rulesets/api-account/step2-create-rule.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,4 @@ params:
5
5
6
6
import { Markdown } from"~/components";
7
7
8
-
If the entry point ruleset already exists (that is, if you received a `200 OK` status code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the [Create an account ruleset rule](/api/resources/rulesets/methods/create/Rule) operation to add an `execute` rule to the existing ruleset deploying the <Markdowntext={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.
8
+
If the entry point ruleset already exists (that is, if you received a `200 OK` status code and the ruleset definition), take note of the ruleset ID in the response. Then, invoke the [Create an account ruleset rule](/api/resources/rulesets/subresources/rules/methods/create/) operation to add an `execute` rule to the existing ruleset deploying the <Markdowntext={props.deploymentItem} />. By default, the rule will be added at the end of the list of rules already in the ruleset.
0 commit comments