Skip to content

Commit 3574ca6

Browse files
committed
Update lists
1 parent 2131ae2 commit 3574ca6

File tree

2 files changed

+147
-149
lines changed

2 files changed

+147
-149
lines changed

src/content/docs/cloudflare-one/policies/browser-isolation/isolation-policies.mdx

Lines changed: 75 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 2
66
---
77

8-
import { Render, Badge, Tabs, TabItem } from "~/components";
8+
import { Render, Badge, Tabs, TabItem, APIRequest } from "~/components";
99

1010
With Browser Isolation, you can define policies to dynamically isolate websites based on identity, security threats, or content.
1111

@@ -148,23 +148,21 @@ Isolate security threats such as malware and phishing.
148148

149149
<TabItem label="API">
150150

151-
```bash
152-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
153-
--header "Content-Type: application/json" \
154-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
155-
--data '{
156-
"name": "Isolate all security threats",
157-
"description": "Isolate security threats such as malware and phishing",
158-
"enabled": true,
159-
"action": "isolate",
160-
"filters": [
161-
"http"
162-
],
163-
"traffic": "any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})",
164-
"identity": "",
165-
"device_posture": ""
166-
}'
167-
```
151+
<APIRequest
152+
path="/accounts/{account_id}/gateway/rules"
153+
method="POST"
154+
json={{
155+
name: "Isolate all security threats",
156+
description: "Isolate security threats such as malware and phishing",
157+
enabled: true,
158+
action: "isolate",
159+
filters: ["http"],
160+
traffic:
161+
"any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})",
162+
identity: "",
163+
device_posture: "",
164+
}}
165+
/>
168166

169167
</TabItem> </Tabs>
170168

@@ -182,23 +180,21 @@ Isolate high risk content categories such as newly registered domains.
182180

183181
<TabItem label="API">
184182

185-
```bash
186-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
187-
--header "Content-Type: application/json" \
188-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
189-
--data '{
190-
"name": "Isolate high risk content",
191-
"description": "Isolate high risk content categories such as newly registered domains",
192-
"enabled": true,
193-
"action": "isolate",
194-
"filters": [
195-
"http"
196-
],
197-
"traffic": "any(http.request.uri.content_category[*] in {32 169 177 128})",
198-
"identity": "",
199-
"device_posture": ""
200-
}'
201-
```
183+
<APIRequest
184+
path="/accounts/{account_id}/gateway/rules"
185+
method="POST"
186+
json={{
187+
name: "Isolate high risk content",
188+
description:
189+
"Isolate high risk content categories such as newly registered domains",
190+
enabled: true,
191+
action: "isolate",
192+
filters: ["http"],
193+
traffic: "any(http.request.uri.content_category[*] in {32 169 177 128})",
194+
identity: "",
195+
device_posture: "",
196+
}}
197+
/>
202198

203199
</TabItem> </Tabs>
204200

@@ -216,23 +212,21 @@ Isolate news and media sites, which are targets for malvertising attacks.
216212

217213
<TabItem label="API">
218214

219-
```bash
220-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
221-
--header "Content-Type: application/json" \
222-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
223-
--data '{
224-
"name": "Isolate news and media",
225-
"description": "Isolate news and media sites, which are targets for malvertising attacks",
226-
"enabled": true,
227-
"action": "isolate",
228-
"filters": [
229-
"http"
230-
],
231-
"traffic": "any(http.request.uri.content_category[*] in {122})",
232-
"identity": "",
233-
"device_posture": ""
234-
}'
235-
```
215+
<APIRequest
216+
path="/accounts/{account_id}/gateway/rules"
217+
method="POST"
218+
json={{
219+
name: "Isolate news and media",
220+
description:
221+
"Isolate news and media sites, which are targets for malvertising attacks",
222+
enabled: true,
223+
action: "isolate",
224+
filters: ["http"],
225+
traffic: "any(http.request.uri.content_category[*] in {122})",
226+
identity: "",
227+
device_posture: "",
228+
}}
229+
/>
236230

237231
</TabItem> </Tabs>
238232

@@ -250,23 +244,21 @@ Isolate content that has not been categorized by [Cloudflare Radar](/radar/).
250244

251245
<TabItem label="API">
252246

253-
```bash
254-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
255-
--header "Content-Type: application/json" \
256-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
257-
--data '{
258-
"name": "Isolate uncategorized content",
259-
"description": "Isolate content not categorized by Cloudflare Radar",
260-
"enabled": true,
261-
"action": "isolate",
262-
"filters": [
263-
"http"
264-
],
265-
"traffic": "not(any(http.request.uri.content_category[*] in {2 67 125 133 3 75 183 89 182 6 90 91 144 150 7 70 74 76 79 92 96 100 106 107 116 120 121 122 127 139 156 164 99 9 101 137 10 103 146 11 12 77 98 108 110 111 118 126 129 172 168 113 33 179 166 15 115 119 124 141 161 17 85 87 102 157 135 138 180 162 140 142 32 169 177 128 22 73 82 88 148 23 24 181 71 72 173 78 84 86 94 97 104 105 114 174 93 130 132 136 147 149 154 158 152 26 69 184 81 95 109 123 145 155 159 160 163 165 167}))",
266-
"identity": "",
267-
"device_posture": ""
268-
}'
269-
```
247+
<APIRequest
248+
path="/accounts/{account_id}/gateway/rules"
249+
method="POST"
250+
json={{
251+
name: "Isolate uncategorized content",
252+
description: "Isolate content not categorized by Cloudflare Radar",
253+
enabled: true,
254+
action: "isolate",
255+
filters: ["http"],
256+
traffic:
257+
"not(any(http.request.uri.content_category[*] in {2 67 125 133 3 75 183 89 182 6 90 91 144 150 7 70 74 76 79 92 96 100 106 107 116 120 121 122 127 139 156 164 99 9 101 137 10 103 146 11 12 77 98 108 110 111 118 126 129 172 168 113 33 179 166 15 115 119 124 141 161 17 85 87 102 157 135 138 180 162 140 142 32 169 177 128 22 73 82 88 148 23 24 181 71 72 173 78 84 86 94 97 104 105 114 174 93 130 132 136 147 149 154 158 152 26 69 184 81 95 109 123 145 155 159 160 163 165 167}))",
258+
identity: "",
259+
device_posture: "",
260+
}}
261+
/>
270262

271263
</TabItem> </Tabs>
272264

@@ -286,22 +278,19 @@ In **Configure policy settings**, you can customize restrictions for ChatGPT. Fo
286278

287279
<TabItem label="API">
288280

289-
```bash
290-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
291-
--header "Content-Type: application/json" \
292-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
293-
--data '{
294-
"name": "Isolate ChatGPT",
295-
"description": "Isolate the use of ChatGPT",
296-
"enabled": true,
297-
"action": "isolate",
298-
"filters": [
299-
"http"
300-
],
301-
"traffic": "any(app.ids[*] in {1199})",
302-
"identity": "",
303-
"device_posture": ""
304-
}'
305-
```
281+
<APIRequest
282+
path="/accounts/{account_id}/gateway/rules"
283+
method="POST"
284+
json={{
285+
name: "Isolate ChatGPT",
286+
description: "Isolate the use of ChatGPT",
287+
enabled: true,
288+
action: "isolate",
289+
filters: ["http"],
290+
traffic: "any(app.ids[*] in {1199})",
291+
identity: "",
292+
device_posture: "",
293+
}}
294+
/>
306295

307296
</TabItem> </Tabs>

src/content/partials/cloudflare-one/gateway/lists.mdx

Lines changed: 72 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{}
33
---
44

5-
import { TabItem, Tabs } from "~/components";
5+
import { TabItem, Tabs, APIRequest } from "~/components";
66

77
## Create a list from a CSV file
88

@@ -37,26 +37,27 @@ To upload the list to Zero Trust:
3737
<TabItem label="Terraform (v5)">
3838

3939
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
40-
- `Zero Trust Write`
40+
- `Zero Trust Write`
4141

4242
2. Decode the contents of the CSV file and store it as a local value:
4343

44-
```tf
45-
locals {
46-
ip_list = csvdecode(file("${path.module}/list-test.csv"))
47-
}
48-
```
44+
```tf
45+
locals {
46+
ip_list = csvdecode(file("${path.module}/list-test.csv"))
47+
}
48+
```
49+
4950
3. Create a list using the [`cloudflare_zero_trust_list`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_list) resource:
5051

51-
```tf
52-
resource "cloudflare_zero_trust_list" "ips_from_csv" {
53-
account_id = var.cloudflare_account_id
54-
name = "IPs imported from CSV"
55-
description = "Managed by Terraform"
56-
type = "IP"
57-
items = local.ip_list
58-
}
59-
```
52+
```tf
53+
resource "cloudflare_zero_trust_list" "ips_from_csv" {
54+
account_id = var.cloudflare_account_id
55+
name = "IPs imported from CSV"
56+
description = "Managed by Terraform"
57+
type = "IP"
58+
items = local.ip_list
59+
}
60+
```
6061

6162
</TabItem>
6263
</Tabs>
@@ -77,61 +78,69 @@ You can now use this list in the policy builder by choosing the _in list_ operat
7778

7879
<TabItem label="API">
7980

80-
```bash
81-
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/lists \
82-
--header "Content-Type: application/json" \
83-
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
84-
--data '{
85-
"description": "Private application IPs",
86-
"items": [{"value": "10.226.0.177/32"},{"value": "10.226.1.177/32"}],
87-
"name": "Corporate IP list",
88-
"type": "IP"
89-
}'
90-
```
81+
<APIRequest
82+
path="/accounts/{account_id}/gateway/lists"
83+
method="POST"
84+
json={{
85+
description: "Private application IPs",
86+
items: [
87+
{
88+
value: "10.226.0.177/32",
89+
},
90+
{
91+
value: "10.226.1.177/32",
92+
},
93+
],
94+
name: "Corporate IP list",
95+
type: "IP",
96+
}}
97+
/>
9198

9299
</TabItem>
93100
<TabItem label="Terraform (v5)">
94101

95102
1. Add the following permission to your [`cloudflare_api_token`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/api_token):
96-
- `Zero Trust Write`
103+
- `Zero Trust Write`
97104

98105
2. Create a list using the [`cloudflare_zero_trust_list`](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zero_trust_list) resource.
99106

100-
Example list of IPs:
101-
```tf
102-
resource "cloudflare_zero_trust_list" "wiki_IPs" {
103-
account_id = var.cloudflare_account_id
104-
name = "Company Wiki IP addresses"
105-
description = "Managed by Terraform"
106-
type = "IP"
107-
items = [
108-
{
109-
description = "Example IP address range"
110-
value = "192.0.2.0/24",
111-
},
112-
{
113-
value = "198.51.100.0/24"
114-
}
115-
]
116-
}
117-
```
118-
119-
Example list of domains:
120-
```tf
121-
resource "cloudflare_zero_trust_list" "wiki_domains" {
122-
account_id = var.cloudflare_account_id
123-
name = "Company Wiki Domains"
124-
description = "Managed by Terraform"
125-
type = "DOMAIN"
126-
items = [
127-
{
128-
value = "wiki.example.com"
129-
},
130-
{
131-
value = "wiki2.example.com"
132-
}]
133-
}
134-
```
107+
Example list of IPs:
108+
109+
```tf
110+
resource "cloudflare_zero_trust_list" "wiki_IPs" {
111+
account_id = var.cloudflare_account_id
112+
name = "Company Wiki IP addresses"
113+
description = "Managed by Terraform"
114+
type = "IP"
115+
items = [
116+
{
117+
description = "Example IP address range"
118+
value = "192.0.2.0/24",
119+
},
120+
{
121+
value = "198.51.100.0/24"
122+
}
123+
]
124+
}
125+
```
126+
127+
Example list of domains:
128+
129+
```tf
130+
resource "cloudflare_zero_trust_list" "wiki_domains" {
131+
account_id = var.cloudflare_account_id
132+
name = "Company Wiki Domains"
133+
description = "Managed by Terraform"
134+
type = "DOMAIN"
135+
items = [
136+
{
137+
value = "wiki.example.com"
138+
},
139+
{
140+
value = "wiki2.example.com"
141+
}]
142+
}
143+
```
135144

136145
</TabItem>
137146
</Tabs>

0 commit comments

Comments
 (0)