Skip to content

Commit c6af1a0

Browse files
committed
Replace API token variable
1 parent 636ba2c commit c6af1a0

File tree

17 files changed

+98
-96
lines changed

17 files changed

+98
-96
lines changed

src/content/docs/cloudflare-one/connections/connect-devices/agentless/pac-files.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ https://<SUBDOMAIN>.proxy.cloudflare-gateway.com
6464

6565
```bash
6666
curl https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/gateway/proxy_endpoints \
67-
--header "Authorization: Bearer <API_TOKEN>" \
67+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
6868
--header "Content-Type: application/json" \
6969
--data '{"name": "any_name", "ips": ["<PUBLIC_IP>", "<PUBLIC_IP2>", "<PUBLIC_IP3>"]}'
7070
```
@@ -212,7 +212,7 @@ To get the domain of a proxy endpoint:
212212

213213
```bash
214214
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/proxy_endpoints \
215-
--header "Authorization: Bearer <API_TOKEN>"
215+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
216216
```
217217

218218
```json {8} output

src/content/docs/cloudflare-one/connections/connect-devices/user-side-certificates/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Send a `POST` request to the [Create Zero Trust certificate](/api/resources/zero
5151
```sh
5252
curl --request POST \
5353
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/certificates \
54-
--header "Authorization: Bearer <API_TOKEN>"
54+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
5555
```
5656

5757
The API will respond with the ID and contents of the new certificate.
@@ -88,7 +88,7 @@ Send a `POST` request to the [Activate a Zero Trust certificate](/api/resources/
8888
```sh
8989
curl --request POST \
9090
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/certificates/{certificate_id}/activate \
91-
--header "Authorization: Bearer <API_TOKEN>"
91+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
9292
```
9393

9494
</TabItem> </Tabs>
@@ -114,7 +114,7 @@ Send a `PUT` request to the [Update Zero Trust account configuration](/api/resou
114114
curl --request PUT \
115115
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/configuration' \
116116
--header "Content-Type: application/json" \
117-
--header "Authorization: Bearer <API_TOKEN>" \
117+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
118118
--data '{
119119
"settings": {
120120
"certificate": {

src/content/docs/cloudflare-one/connections/connect-networks/configure-tunnels/remote-management.mdx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,15 @@ To rotate a tunnel token:
187187

188188
1. Refresh the token on Cloudflare:
189189

190-
<Tabs syncKey="dashPlusAPI">
190+
<Tabs syncKey="dashPlusAPI">
191191
<TabItem label="Dashboard">
192+
192193
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Networks** > **Tunnels**.
193-
2. Select a `cloudflared` tunnel and select **Edit**.
194-
3. Select **Refresh token**.
195-
4. Copy the `cloudflared` installation command for your operating system. This command contains the new token.
194+
1. Select a `cloudflared` tunnel and select **Edit**.
195+
1. Select **Refresh token**.
196+
1. Copy the `cloudflared` installation command for your operating system. This command contains the new token.
196197

197-
</TabItem>
198+
</TabItem>
198199
<TabItem label="API">
199200

200201
1. Generate a random base64 string (minimum size 32 bytes) to use as a tunnel secret:
@@ -213,7 +214,7 @@ To rotate a tunnel token:
213214
curl --request PATCH \
214215
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/{tunnel_id} \
215216
--header 'Content-Type: application/json' \
216-
--header "Authorization: Bearer <API_TOKEN>" \
217+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
217218
--data '{
218219
"name": "Example tunnel",
219220
"tunnel_secret": "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="
@@ -245,34 +246,34 @@ To rotate a tunnel token:
245246

246247
3. Copy the `token` value shown in the output.
247248

248-
</TabItem>
249+
</TabItem>
249250
</Tabs>
250251

251252
After refreshing the token, `cloudflared` can no longer establish new connections to Cloudflare using the old token. However, existing connectors will remain active and the tunnel will continue serving traffic.
252253

253-
2. On half of your `cloudflared` replicas, update `cloudflared` to use the new token. For example, on a Linux host:
254+
1. On half of your `cloudflared` replicas, update `cloudflared` to use the new token. For example, on a Linux host:
254255

255256
```sh
256257
sudo cloudflared service install <TOKEN>
257258
```
258259

259-
3. Restart `cloudflared`:
260+
1. Restart `cloudflared`:
260261

261262
```sh
262263
sudo systemctl restart cloudflared.service
263264
```
264265

265-
4. Confirm that the service started correctly:
266+
1. Confirm that the service started correctly:
266267

267268
```sh
268269
sudo systemctl status cloudflared
269270
```
270271

271272
While these replicas are connecting to Cloudflare with the new token, traffic will automatically route through the other replicas.
272273

273-
5. Wait 10 minutes for traffic to route through the new connectors.
274+
1. Wait 10 minutes for traffic to route through the new connectors.
274275

275-
6. Repeat steps 2, 3, and 4 for the second half of the replicas.
276+
1. Repeat steps 2, 3, and 4 for the second half of the replicas.
276277

277278
The tunnel token is now fully rotated. The old token is no longer in use.
278279

@@ -286,7 +287,7 @@ If your tunnel token is compromised, we recommend taking the following steps:
286287
```sh
287288
curl --request DELETE \
288289
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/{tunnel_id}/connections \
289-
--header "Authorization: Bearer <API_TOKEN>"
290+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
290291
```
291292

292293
This will clean up any unauthorized connections and prevent users from connecting to your network.

src/content/docs/cloudflare-one/identity/idp-integration/entra-id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ You can require users to re-enter their credentials into Entra ID whenever they
213213
```sh {17}
214214
curl --request PUT \
215215
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers/{identity_provider_id} \
216-
--header "Authorization: Bearer <API_TOKEN>" \
216+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
217217
--header "Content-Type: application/json" \
218218
--data '{
219219
"id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",

src/content/docs/cloudflare-one/policies/access/policy-management.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ You can use the API to convert a legacy policy into a reusable policy. To conver
8383
```bash
8484
curl --request PUT \
8585
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/{app_id}/policies/{policy_id}/make_reusable \
86-
--header "Authorization: Bearer <API_TOKEN>"
86+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
8787
```
8888

8989
The policy is now removed from the applications endpoint (`/access/apps/{app_id}/policies`) and managed using the [reusable policies endpoints](/api/resources/zero_trust/subresources/access/subresources/policies/)(`/access/policies/{policy_id}`).

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Isolate security threats such as malware and phishing.
136136
```bash
137137
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
138138
--header "Content-Type: application/json" \
139-
--header "Authorization: Bearer <API_TOKEN>" \
139+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
140140
--data '{
141141
"name": "Isolate all security threats",
142142
"description": "Isolate security threats such as malware and phishing",
@@ -170,7 +170,7 @@ Isolate high risk content categories such as newly registered domains.
170170
```bash
171171
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
172172
--header "Content-Type: application/json" \
173-
--header "Authorization: Bearer <API_TOKEN>" \
173+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
174174
--data '{
175175
"name": "Isolate high risk content",
176176
"description": "Isolate high risk content categories such as newly registered domains",
@@ -204,7 +204,7 @@ Isolate news and media sites, which are targets for malvertising attacks.
204204
```bash
205205
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
206206
--header "Content-Type: application/json" \
207-
--header "Authorization: Bearer <API_TOKEN>" \
207+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
208208
--data '{
209209
"name": "Isolate news and media",
210210
"description": "Isolate news and media sites, which are targets for malvertising attacks",
@@ -238,7 +238,7 @@ Isolate content that has not been categorized by [Cloudflare Radar](/radar/).
238238
```bash
239239
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
240240
--header "Content-Type: application/json" \
241-
--header "Authorization: Bearer <API_TOKEN>" \
241+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
242242
--data '{
243243
"name": "Isolate uncategorized content",
244244
"description": "Isolate content not categorized by Cloudflare Radar",
@@ -274,7 +274,7 @@ In **Configure policy settings**, you can customize restrictions for ChatGPT. Fo
274274
```bash
275275
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
276276
--header "Content-Type: application/json" \
277-
--header "Authorization: Bearer <API_TOKEN>" \
277+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
278278
--data '{
279279
"name": "Isolate ChatGPT",
280280
"description": "Isolate the use of ChatGPT",

src/content/docs/cloudflare-one/policies/gateway/dns-policies/common-policies.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This policy allows users to access official corporate domains. By deploying the
3131
```bash
3232
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
3333
--header "Content-Type: application/json" \
34-
--header "Authorization: Bearer <API_TOKEN>" \
34+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
3535
--data '{
3636
"name": "Allow corporate domains",
3737
"description": "Allow any internal corporate domains added to a list",
@@ -68,7 +68,7 @@ Block [security categories](/cloudflare-one/policies/gateway/domain-categories/#
6868
```bash
6969
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
7070
--header "Content-Type: application/json" \
71-
--header "Authorization: Bearer <API_TOKEN>" \
71+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
7272
--data '{
7373
"name": "Block security threats",
7474
"description": "Block all default Cloudflare DNS security categories",
@@ -101,7 +101,7 @@ The categories included in this policy are not always a security threat, but blo
101101
```bash
102102
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
103103
--header "Content-Type: application/json" \
104-
--header "Authorization: Bearer <API_TOKEN>" \
104+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
105105
--data '{
106106
"name": "Block content categories",
107107
"description": "Block common content categories that may pose a risk",
@@ -134,7 +134,7 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
134134
```bash
135135
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
136136
--header "Content-Type: application/json" \
137-
--header "Authorization: Bearer <API_TOKEN>" \
137+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
138138
--data '{
139139
"name": "Block unauthorized applications",
140140
"description": "Block access to unauthorized AI applications",
@@ -167,7 +167,7 @@ You can implement policies to block websites hosted in countries categorized as
167167
```bash
168168
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
169169
--header "Content-Type: application/json" \
170-
--header "Authorization: Bearer <API_TOKEN>" \
170+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
171171
--data '{
172172
"name": "Block banned countries",
173173
"description": "Block access to banned countries",
@@ -202,7 +202,7 @@ Blocking [frequently misused](https://www.spamhaus.org/statistics/tlds/) top-lev
202202
```bash
203203
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
204204
--header "Content-Type: application/json" \
205-
--header "Authorization: Bearer <API_TOKEN>" \
205+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
206206
--data '{
207207
"name": "Block top-level domains",
208208
"description": "Block top-level domains that are frequently used for malicious practices",
@@ -236,7 +236,7 @@ To protect against [sophisticated phishing attacks](https://blog.cloudflare.com/
236236
```bash
237237
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
238238
--header "Content-Type: application/json" \
239-
--header "Authorization: Bearer <API_TOKEN>" \
239+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
240240
--data '{
241241
"name": "Block phishing attacks",
242242
"description": "Block attempts to phish specific domains targeting your organization",
@@ -271,7 +271,7 @@ To safeguard user privacy, some organizations will block tracking domains such a
271271
```bash
272272
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
273273
--header "Content-Type: application/json" \
274-
--header "Authorization: Bearer <API_TOKEN>" \
274+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
275275
--data '{
276276
"name": "Block online tracking",
277277
"description": "Block domains used for tracking at an OS level",
@@ -306,7 +306,7 @@ Block specific IP addresses that are known to be malicious or pose a threat to y
306306
```bash
307307
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
308308
--header "Content-Type: application/json" \
309-
--header "Authorization: Bearer <API_TOKEN>" \
309+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
310310
--data '{
311311
"name": "Block malicious IPs",
312312
"description": "Block specific IP addresses that are known to be malicious or pose a threat to your organization",
@@ -341,7 +341,7 @@ The CIPA (Children's Internet Protection Act) Filter is a collection of subcateg
341341
```bash
342342
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
343343
--header "Content-Type: application/json" \
344-
--header "Authorization: Bearer <API_TOKEN>" \
344+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
345345
--data '{
346346
"name": "Turn on CIPA filter",
347347
"description": "Block access to unwanted or harmful online content for children",
@@ -374,7 +374,7 @@ SafeSearch is a feature of search engines that helps you filter explicit or offe
374374
```bash
375375
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
376376
--header "Content-Type: application/json" \
377-
--header "Authorization: Bearer <API_TOKEN>" \
377+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
378378
--data '{
379379
"name": "Hide explicit search results",
380380
"description": "Force SafeSearch on search engines to filter explicit or offensive content",
@@ -408,7 +408,7 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
408408
```bash
409409
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
410410
--header "Content-Type: application/json" \
411-
--header "Authorization: Bearer <API_TOKEN>" \
411+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
412412
--data '{
413413
"name": "Check user identity",
414414
"description": "Filter traffic based on a user identity group name",
@@ -446,7 +446,7 @@ The following example includes two policies. The first policy allows the specifi
446446
```bash
447447
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
448448
--header "Content-Type: application/json" \
449-
--header "Authorization: Bearer <API_TOKEN>" \
449+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
450450
--data '{
451451
"name": "Allow social media for Marketing",
452452
"description": "Allow access to social media sites for users in the Marketing group",
@@ -478,7 +478,7 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
478478
```bash
479479
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
480480
--header "Content-Type: application/json" \
481-
--header "Authorization: Bearer <API_TOKEN>" \
481+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
482482
--data '{
483483
"name": "Block social media",
484484
"description": "Block social media for all other users",
@@ -521,7 +521,7 @@ Force users to connect with IPv4 by blocking IPv6 resolution.
521521
```bash
522522
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
523523
--header "Content-Type: application/json" \
524-
--header "Authorization: Bearer <API_TOKEN>" \
524+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
525525
--data '{
526526
"name": "Force IPv4",
527527
"description": "Force users to connect with IPv4 by blocking IPv6 resolution",
@@ -555,7 +555,7 @@ Force users to connect with IPv6 by blocking IPv4 resolution.
555555
```bash
556556
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
557557
--header "Content-Type: application/json" \
558-
--header "Authorization: Bearer <API_TOKEN>" \
558+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
559559
--data '{
560560
"name": "Force IPv6",
561561
"description": "Force users to connect with IPv6 by blocking IPv4 resolution",

0 commit comments

Comments
 (0)