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/rules/configuration-rules/create-api.mdx
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,30 +7,34 @@ sidebar:
7
7
head:
8
8
- tag: title
9
9
content: Create a configuration rule via API
10
-
11
10
---
12
11
13
-
import { Details, Render } from"~/components"
12
+
import { Details, Render } from"~/components";
14
13
15
14
Use the [Rulesets API](/ruleset-engine/rulesets-api/) to create configuration rules via API.
16
15
17
16
## Basic rule settings
18
17
19
18
When creating a configuration rule via API, make sure you:
20
19
21
-
* Set the rule action to `set_config`.
22
-
* Define the parameters in the `action_parameters` field according to the [settings](/rules/configuration-rules/settings/) you wish to override for matching requests.
23
-
* Deploy the rule to the `http_config_settings` phase at the zone level.
20
+
- Set the rule action to `set_config`.
21
+
- Define the parameters in the `action_parameters` field according to the [settings](/rules/configuration-rules/settings/) you wish to override for matching requests.
22
+
- Deploy the rule to the `http_config_settings` phase at the zone level.
24
23
25
24
## Procedure
26
25
27
-
<Renderfile="rules-creation-workflow"params={{ one: "a configuration rule", two: "http_config_settings" }} />
26
+
<Render
27
+
file="rules-creation-workflow"
28
+
params={{
29
+
ruleName: "a configuration rule",
30
+
phaseName: "http_config_settings",
31
+
}}
32
+
/>
28
33
29
34
Make sure your API token has the [required permissions](#required-api-token-permissions) to perform the API operations.
30
35
31
36
## Example requests
32
37
33
-
34
38
<Detailsheader="Example: Add a rule that enables Email Obfuscation and Browser Integrity Check">
35
39
36
40
The following example sets the rules of an existing phase ruleset (`{ruleset_id}`) to a single configuration rule — enabling Email Obfuscation and Browser Integrity Check for the contacts page — using the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation:
<Detailsheader="Example: Add a rule that turns on I'm Under Attack mode for the admin area">
63
65
64
66
The following example sets the rules of an existing phase ruleset (`{ruleset_id}`) to a single configuration rule — turning on I'm Under Attack mode for the administration area — using the [Update a zone ruleset](/api/resources/rulesets/methods/update/) operation:
0 commit comments