Skip to content

Commit 7497091

Browse files
committed
Use partials for repeated API steps (part 2)
1 parent 8d39664 commit 7497091

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

src/content/docs/waf/managed-rules/reference/exposed-credentials-check.mdx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ To enable the Cloudflare Exposed Credentials Check Managed Ruleset for a given z
5252

5353
This example deploys the Cloudflare Exposed Credentials Check Managed Ruleset to the `http_request_firewall_managed` phase of a given zone (`{zone_id}`) by creating a rule that executes the managed ruleset. The rules in the managed ruleset are executed for all incoming requests.
5454

55-
1. Invoke the [Get a zone entry point ruleset](/api/operations/getZoneEntrypointRuleset) operation to obtain the definition of the entry point ruleset for the `http_request_firewall_managed` phase. You will need the [zone ID](/fundamentals/setup/find-account-and-zone-ids/) for this task.
55+
1. <Render
56+
file="rulesets/api-zone/step1-get-entrypoint"
57+
params={{ phaseName: "http_request_firewall_managed" }}
58+
/>
5659

5760
```bash
5861
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_request_firewall_managed/entrypoint" \
@@ -80,7 +83,13 @@ This example deploys the Cloudflare Exposed Credentials Check Managed Ruleset to
8083
}
8184
```
8285

83-
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/operations/createZoneRulesetRule) operation to add an `execute` rule to the existing ruleset deploying the Cloudflare Exposed Credentials Check Managed Ruleset (with ID <RuleID id="c2e184081120413c86c3ab7e14069605" />). By default, the rule will be added at the end of the list of rules already in the ruleset.
86+
2. <Render
87+
file="rulesets/api-zone/step2-create-rule"
88+
params={{
89+
deploymentItem:
90+
"Cloudflare Exposed Credentials Check Managed Ruleset (with ID `c2e184081120413c86c3ab7e14069605`)",
91+
}}
92+
/>
8493

8594
```bash
8695
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules" \
@@ -130,7 +139,14 @@ This example deploys the Cloudflare Exposed Credentials Check Managed Ruleset to
130139
}
131140
```
132141

133-
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/operations/createZoneRuleset) operation. Include a single rule in the `rules` array that executes the Cloudflare Exposed Credentials Check Managed Ruleset (with ID <RuleID id="c2e184081120413c86c3ab7e14069605" />) for all incoming requests in the zone.
142+
3. <Render
143+
file="rulesets/api-zone/step3-create-ruleset"
144+
params={{
145+
deploymentItem:
146+
"Cloudflare Exposed Credentials Check Managed Ruleset (with ID `c2e184081120413c86c3ab7e14069605`)",
147+
scope: "all incoming requests in the zone",
148+
}}
149+
/>
134150

135151
```bash
136152
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets" \

src/content/docs/waf/managed-rules/reference/sensitive-data-detection.mdx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ To enable Cloudflare Sensitive Data Detection for a given zone using the API, cr
4848

4949
This example deploys the Cloudflare Sensitive Data Detection managed ruleset to the `http_response_firewall_managed` phase of a given zone (`{zone_id}`) by creating a rule that executes the managed ruleset. The rules in the managed ruleset are executed for all incoming requests.
5050

51-
1. Invoke the [Get a zone entry point ruleset](/api/operations/getZoneEntrypointRuleset) operation to obtain the definition of the entry point ruleset for the `http_response_firewall_managed` phase. You will need the [zone ID](/fundamentals/setup/find-account-and-zone-ids/) for this task.
51+
1. <Render
52+
file="rulesets/api-zone/step1-get-entrypoint"
53+
params={{ phaseName: "http_response_firewall_managed" }}
54+
/>
5255

5356
```bash
5457
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/phases/http_response_firewall_managed/entrypoint" \
@@ -76,7 +79,13 @@ This example deploys the Cloudflare Sensitive Data Detection managed ruleset to
7679
}
7780
```
7881

79-
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/operations/createZoneRulesetRule) operation to add an `execute` rule to the existing ruleset deploying the Cloudflare Sensitive Data Detection managed ruleset (with ID <RuleID id="e22d83c647c64a3eae91b71b499d988e" />). By default, the rule will be added at the end of the list of rules already in the ruleset.
82+
2. <Render
83+
file="rulesets/api-zone/step2-create-rule"
84+
params={{
85+
deploymentItem:
86+
"Cloudflare Sensitive Data Detection managed ruleset (with ID `e22d83c647c64a3eae91b71b499d988e`)",
87+
}}
88+
/>
8089

8190
```bash
8291
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets/{ruleset_id}/rules" \
@@ -126,7 +135,14 @@ This example deploys the Cloudflare Sensitive Data Detection managed ruleset to
126135
}
127136
```
128137

129-
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/operations/createZoneRuleset) operation. Include a single rule in the `rules` array that executes the Cloudflare Sensitive Data Detection managed ruleset (with ID <RuleID id="e22d83c647c64a3eae91b71b499d988e" />) for all incoming requests in the zone.
138+
3. <Render
139+
file="rulesets/api-zone/step3-create-ruleset"
140+
params={{
141+
deploymentItem:
142+
"Cloudflare Sensitive Data Detection managed ruleset (with ID `e22d83c647c64a3eae91b71b499d988e`)",
143+
scope: "all incoming requests in the zone",
144+
}}
145+
/>
130146

131147
```bash
132148
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets" \

0 commit comments

Comments
 (0)