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/waf/managed-rules/reference/sensitive-data-detection.mdx
+115-3Lines changed: 115 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,9 +42,117 @@ For details on configuring a managed ruleset in the dashboard, refer to [Configu
42
42
43
43
## Configure via API
44
44
45
-
To enable Cloudflare Sensitive Data Detection for a given zone using the API, create a rule with `execute` action in the entry point ruleset for the `http_response_firewall_managed` phase. For more information on deploying a managed ruleset, refer to [Deploy a managed ruleset](/ruleset-engine/managed-rulesets/deploy-managed-ruleset/).
46
-
47
-
The ruleset ID is the following: <RuleIDid="e22d83c647c64a3eae91b71b499d988e" />.
45
+
To enable Cloudflare Sensitive Data Detection for a given zone using the API, create a rule with `execute` action in the entry point ruleset for the `http_response_firewall_managed` phase.
46
+
47
+
### Example
48
+
49
+
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.
50
+
51
+
1. Search for an existing [entry point ruleset](/ruleset-engine/about/rulesets/#entry-point-ruleset) for the `http_response_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_response_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 Sensitive Data Detection managed ruleset](/waf/managed-rules/reference/cloudflare-managed-ruleset/) (with ID <RuleIDid="e22d83c647c64a3eae91b71b499d988e" />) for all incoming requests in the zone.
"description": "Entry point ruleset for WAF managed rulesets (response)",
89
+
"kind": "zone",
90
+
"phase": "http_response_firewall_managed",
91
+
"rules": [
92
+
{
93
+
"action": "execute",
94
+
"action_parameters": {
95
+
"id": "e22d83c647c64a3eae91b71b499d988e"
96
+
},
97
+
"expression": "true",
98
+
"description": "Execute the Cloudflare Sensitive Data Detection managed ruleset"
99
+
}
100
+
]
101
+
}'
102
+
```
103
+
104
+
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 Sensitive Data Detection managed ruleset (with ID <RuleIDid="e22d83c647c64a3eae91b71b499d988e" />) for all incoming requests in the zone.
"description": "Execute the Cloudflare Sensitive Data Detection managed ruleset"
118
+
}'
119
+
```
120
+
121
+
```json output
122
+
{
123
+
"result": {
124
+
"id": "<RULESET_ID>",
125
+
"name": "Zone-level phase entry point",
126
+
"description": "",
127
+
"kind": "zone",
128
+
"version": "3",
129
+
"rules": [
130
+
// ... any existing rules
131
+
{
132
+
"id": "<RULE_ID>",
133
+
"version": "1",
134
+
"action": "execute",
135
+
"action_parameters": {
136
+
"id": "e22d83c647c64a3eae91b71b499d988e",
137
+
"version": "latest"
138
+
},
139
+
"expression": "true",
140
+
"description": "Execute the Cloudflare Sensitive Data Detection managed ruleset",
141
+
"last_updated": "2024-03-18T18:08:14.003361Z",
142
+
"ref": "<RULE_REF>",
143
+
"enabled": true
144
+
}
145
+
],
146
+
"last_updated": "2024-03-18T18:08:14.003361Z",
147
+
"phase": "http_response_firewall_managed"
148
+
},
149
+
"success": true,
150
+
"errors": [],
151
+
"messages": []
152
+
}
153
+
```
154
+
155
+
### Next steps
48
156
49
157
To configure Cloudflare Sensitive Data Detection using the API, create [overrides](/ruleset-engine/managed-rulesets/override-managed-ruleset/) using the Rulesets API. You can perform the following configurations:
50
158
@@ -53,6 +161,10 @@ To configure Cloudflare Sensitive Data Detection using the API, create [override
53
161
54
162
For examples of creating overrides using the API, refer to [Override a managed ruleset](/ruleset-engine/managed-rulesets/override-managed-ruleset/).
55
163
164
+
### More resources
165
+
166
+
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.
167
+
56
168
## Review detected leaks
57
169
58
170
To check for any data leaks detected by Cloudflare Sensitive Data Detection, you can do the following:
0 commit comments