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
### Add a custom rule challenging requests with leaked credentials
65
+
66
+
:::note
67
+
For more information on enabling leaked credentials detection using Terraform, refer to the [leaked credentials detection](/waf/detections/leaked-credentials/get-started/#1-turn-on-leaked-credentials-detection) documentation.
68
+
:::
69
+
70
+
This example adds a custom rule that challenges requests with leaked credentials by using one of the [leaked credentials fields](/waf/detections/leaked-credentials/#leaked-credentials-fields) in the rule expression.
description = "Challenge requests with a leaked username and password"
84
+
enabled = true
85
+
}
86
+
}
87
+
```
88
+
89
+
For more information on configuring custom detection locations, refer to the [Terraform example](/waf/detections/leaked-credentials/get-started/#4-optional-configure-a-custom-detection-location) in the WAF documentation.
63
90
64
91
## Account-level configurations
65
92
@@ -69,7 +96,7 @@ The following example creates a [custom ruleset](/ruleset-engine/custom-rulesets
69
96
70
97
:::caution
71
98
72
-
You can only create and deploy custom rulesets at the account level.
99
+
You can only create and deploy custom rulesets at the account level.
73
100
:::
74
101
75
102
The following configuration creates the custom ruleset with a single rule:
<Renderfile="add-new-rule"params={{ one: "custom rule in the custom ruleset" }} /> <br/>
121
+
<Render
122
+
file="add-new-rule"
123
+
params={{ one: "custom rule in the custom ruleset" }}
124
+
/> <br />
95
125
96
126
The following configuration deploys the custom ruleset at the account level. It defines a dependency on the `account_firewall_custom_ruleset` resource and uses the ID of the created custom ruleset in `action_parameters`:
97
127
@@ -121,12 +151,13 @@ For more information on configuring and deploying custom rulesets, refer to [Wor
121
151
122
152
### Add a custom rule checking for exposed credentials
123
153
124
-
The following configuration creates a custom ruleset with a single rule that [checks for exposed credentials](/waf/managed-rules/check-for-exposed-credentials/configure-api/#create-a-custom-rule-checking-for-exposed-credentials).
The following configuration deploys the custom ruleset. It defines a dependency on the `account_firewall_custom_ruleset_exposed_creds` resource and obtains the ID of the created custom ruleset:
Copy file name to clipboardExpand all lines: src/content/docs/waf/detections/leaked-credentials/get-started.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,12 @@ This pair of lookup expressions (for username and password) will scan incoming H
126
126
127
127
Refer to the [`lookup_json_string()`](/ruleset-engine/rules-language/functions/#lookup_json_string) documentation for more information on this function.
128
128
129
+
</TabItem> <TabItemlabel="Terraform">
130
+
131
+
Use the `cloudflare_leaked_credential_check_rules` resource to add custom detection locations. For example:
To create another custom detection location, add a new `rule` object to the same `cloudflare_leaked_credential_check_rules` resource.
17
+
18
+
For more information, refer to the [Terraform Cloudflare provider](https://registry.terraform.io/providers/cloudflare/cloudflare/4.48.0/docs/resources/leaked_credential_check_rules) documentation.
For more information, refer to the [Terraform Cloudflare provider](https://registry.terraform.io/providers/cloudflare/cloudflare/4.48.0/docs/resources/leaked_credential_check) documentation.
On Free plans, the leaked credentials detection is enabled by default, and no action is required. On paid plans, you can turn on the detection in the Cloudflare dashboard or via API.
0 commit comments