Skip to content

Commit 11e6e60

Browse files
committed
Add Internet blocklist policy
1 parent 9c7860a commit 11e6e60

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

src/content/docs/learning-paths/secure-internet-traffic/build-network-policies/recommended-network-policies.mdx

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,61 @@ resource "cloudflare_zero_trust_gateway_policy" "finance_users_net_https_finance
189189

190190
## All-NET-Internet-Blocklist
191191

192-
Block traffic to destination IPs, <GlossaryTooltip term="Server Name Indication (SNI)">SNIs</GlossaryTooltip>, and domain SNIs that are malicious or pose a threat to your organization.
192+
Block traffic to destination IPs, <GlossaryTooltip term="Server Name Indication (SNI)">SNIs</GlossaryTooltip>, and SNI domains that are malicious or pose a threat to your organization.
193193

194194
<Render file="zero-trust/threat-intelligence-automation" />
195195

196+
<Tabs syncKey="dashPlusAPI">
197+
198+
<TabItem label="Dashboard">
199+
196200
| Selector | Operator | Value | Logic | Action |
197201
| -------------- | -------- | ------------------ | ----- | ------ |
198202
| Destination IP | in list | _IP Blocklist_ | Or | Block |
199203
| SNI | in list | _Host Blocklist_ | Or | |
200204
| SNI Domain | in list | _Domain Blocklist_ | | |
201205

206+
</TabItem>
207+
208+
<TabItem label="API">
209+
210+
```sh
211+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rules \
212+
--header "Content-Type: application/json" \
213+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
214+
--data '{
215+
"name": "All-NET-Internet-Blocklist",
216+
"description": "Block traffic to malicious or risky destination IPs, SNIs, and SNI domains",
217+
"precedence": 0,
218+
"enabled": true,
219+
"action": "block",
220+
"filters": [
221+
"l4"
222+
],
223+
"traffic": "net.dst.ip in $<IP_BLOCKLIST_UUID> and net.sni.host in $<HOST_BLOCKLIST_UUID> and any(net.sni.domains[*] in $<DOMAIN_BLOCKLIST_UUID>)"
224+
}'
225+
```
226+
227+
</TabItem>
228+
229+
<TabItem label="Terraform">
230+
231+
```tf
232+
resource "cloudflare_zero_trust_gateway_policy" "finance_users_net_https_finance_servers" {
233+
account_id = var.account_id
234+
name = "All-NET-Internet-Blocklist"
235+
description = "Block traffic to malicious or risky destination IPs, SNIs, and SNI domains"
236+
precedence = 0
237+
enabled = true
238+
action = "block"
239+
filters = ["l4"]
240+
traffic = "net.dst.ip in ${"$"}${cloudflare_zero_trust_list.ip_blocklist.id} and net.sni.host in ${"$"}${cloudflare_zero_trust_list.host_blocklist.id} and any(net.sni.domains[*] in ${"$"}${cloudflare_zero_trust_list.domain_blocklist.id})"
241+
}
242+
```
243+
244+
</TabItem>
245+
</Tabs>
246+
202247
:::note
203248
The **Detected Protocol** selector is only available for Enterprise users. For more information, refer to [Protocol detection](/cloudflare-one/policies/gateway/network-policies/protocol-detection/).
204249
:::

0 commit comments

Comments
 (0)