Skip to content

Commit 3990d9a

Browse files
committed
Replace account ID variable
1 parent e360f46 commit 3990d9a

File tree

22 files changed

+367
-352
lines changed

22 files changed

+367
-352
lines changed

src/content/docs/cloudflare-one/applications/configure-apps/dash-sso-apps.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ If there is an issue with your SSO IdP provider, you can add an alternate IdP us
7373
1. [Add](/api/resources/zero_trust/subresources/identity_providers/methods/create/) one-time PIN login:
7474

7575
```bash title="cURL command"
76-
curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/identity_providers' \
76+
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/identity_providers' \
7777
--header "X-Auth-Email: <EMAIL>" \
7878
--header "X-Auth-Key: <API_KEY>" \
7979
--header "Content-Type: application/json" \
@@ -86,7 +86,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/identity
8686
2. [Get](/api/resources/zero_trust/subresources/access/subresources/applications/methods/list/) the `id` of the `dash_sso` Access application. You can use [`jq`](https://jqlang.github.io/jq/download/) to quickly find the correct application:
8787

8888
```bash title="cURL command"
89-
curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps' \
89+
curl 'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps' \
9090
--header "X-Auth-Email: <EMAIL>" \
9191
--header "X-Auth-Key: <API_KEY>" \
9292
| jq '.result[] | select(.type == "dash_sso")'
@@ -106,7 +106,7 @@ curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps' \
106106

107107
```bash title="cURL command"
108108
curl --request PUT \
109-
'https://api.cloudflare.com/client/v4/accounts/{account_id}/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
109+
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/apps/3537a672-e4d8-4d89-aab9-26cb622918a1' \
110110
--header "X-Auth-Email: <EMAIL>" \
111111
--header "X-Auth-Key: <API_KEY>" \
112112
--header "Content-Type: application/json" \
@@ -127,7 +127,7 @@ The following API calls will disable SSO enforcement for an account. This action
127127
1. Get your SSO `connector_id`:
128128

129129
```bash title="cURL command"
130-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connectors \
130+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors \
131131
--header "X-Auth-Email: <EMAIL>" \
132132
--header "X-Auth-Key: <API_KEY>"
133133
```
@@ -153,7 +153,7 @@ curl https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connector
153153

154154
```bash title="cURL command"
155155
curl --request PATCH \
156-
'https://api.cloudflare.com/client/v4/accounts/{account_id}/sso/v2/connectors/2828' \
156+
'https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/sso/v2/connectors/2828' \
157157
--header "X-Auth-Email: <EMAIL>" \
158158
--header "X-Auth-Key: <API_KEY>" \
159159
--header "Content-Type: application/json" \

src/content/docs/cloudflare-one/connections/connect-devices/agentless/dns/dns-over-https.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Currently, authentication tokens can only be generated through the API. You can
114114
### 1. Create a service token for the account
115115

116116
```bash
117-
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/service_tokens" \
117+
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/service_tokens" \
118118
--header "X-Auth-Email: <EMAIL>" \
119119
--header "X-Auth-Key: <API_KEY>" \
120120
--header "Content-Type: application/json" \
@@ -148,12 +148,12 @@ Save the service token's `client_id`, `client_secret`, and `id`.
148148

149149
```bash
150150
curl --request PUT \
151-
"https://api.cloudflare.com/client/v4/accounts/{account_id}/access/organizations/doh/{service_token_id}" \
151+
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/organizations/doh/$SERVICE_TOKEN_ID" \
152152
--header "X-Auth-Email: <EMAIL>" \
153153
--header "X-Auth-Key: <API_KEY>"
154154
```
155155

156-
If you get an `access.api.error.service_token_not_found` error, check that `{service_token_id}` is the value of `id` and not `client_id`.
156+
If you get an `access.api.error.service_token_not_found` error, check that `$SERVICE_TOKEN_ID` is the value of `id` and not `client_id`.
157157

158158
<Details header="Example response">
159159

@@ -181,7 +181,7 @@ If you get an `access.api.error.service_token_not_found` error, check that `{ser
181181
Create a new user and optionally add them to a group.
182182

183183
```bash
184-
curl "https://api.cloudflare.com/client/v4/accounts/{account_id}/access/users" \
184+
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/access/users" \
185185
--header "X-Auth-Email: <EMAIL>" \
186186
--header "X-Auth-Key: <API_KEY>" \
187187
--header "Content-Type: application/json" \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ To get the domain of a proxy endpoint:
211211
1. Use the [List proxy endpoints](/api/resources/zero_trust/subresources/gateway/subresources/proxy_endpoints/methods/list/) operation to get a list of your proxy endpoints and their details. For example:
212212

213213
```bash
214-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/proxy_endpoints \
214+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/proxy_endpoints \
215215
--header "Authorization: Bearer <API_TOKEN>"
216216
```
217217

src/content/docs/cloudflare-one/connections/connect-devices/warp/configure-warp/device-profiles.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Your profile will appear in the **Profile settings** list. You can rearrange the
3535
Send a `POST` request to the [Devices endpoint](/api/resources/zero_trust/subresources/devices/subresources/policies/subresources/custom/methods/create/):
3636

3737
```bash
38-
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/devices/policy \
38+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/devices/policy \
3939
--header "X-Auth-Email: <EMAIL>" \
4040
--header "X-Auth-Key: <API_KEY>" \
4141
--header "Content-Type: application/json" \

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

Lines changed: 97 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ On Linux, Cloudflare Tunnel installs itself as a system service using `systemctl
4949

5050
4. To verify the new configuration, check the service status:
5151

52-
```sh
53-
sudo systemctl status cloudflared
54-
```
55-
```sh output
56-
● cloudflared.service - cloudflared
52+
```sh
53+
sudo systemctl status cloudflared
54+
```
55+
56+
```sh output
57+
● cloudflared.service - cloudflared
5758
Loaded: loaded (/etc/systemd/system/cloudflared.service; enabled; preset: enabled)
5859
Active: active (running) since Wed 2024-10-09 20:02:59 UTC; 2s ago
5960
Main PID: 2157 (cloudflared)
@@ -62,7 +63,7 @@ On Linux, Cloudflare Tunnel installs itself as a system service using `systemctl
6263
CPU: 136ms
6364
CGroup: /system.slice/cloudflared.service
6465
└─2157 /usr/bin/cloudflared tunnel --loglevel debug --logfile /var/log/cloudflared/cloudflared.log run --token eyJhIjoi...
65-
```
66+
```
6667

6768
</TabItem> <TabItem label="macOS">
6869

@@ -186,85 +187,88 @@ To rotate a tunnel token:
186187

187188
1. Refresh the token on Cloudflare:
188189

189-
<Tabs syncKey="dashPlusAPI">
190-
<TabItem label="Dashboard">
191-
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Networks** > **Tunnels**.
192-
2. Select a `cloudflared` tunnel and select **Edit**.
193-
3. Select **Refresh token**.
194-
4. Copy the `cloudflared` installation command for your operating system. This command contains the new token.
195-
196-
</TabItem>
197-
<TabItem label="API">
198-
199-
1. Generate a random base64 string (minimum size 32 bytes) to use as a tunnel secret:
200-
201-
```sh
202-
openssl rand -base64 32
203-
```
204-
205-
```sh output
206-
AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=
207-
```
208-
209-
2. Make a `PATCH` request to the [Cloudflare Tunnel](/api/resources/zero_trust/subresources/tunnels/methods/edit/) endpoint:
210-
```sh
211-
curl --request PATCH \
212-
https://api.cloudflare.com/client/v4/accounts/{account_id}/cfd_tunnel/{tunnel_id} \
213-
--header 'Content-Type: application/json' \
214-
--header "Authorization: Bearer <API_TOKEN>" \
215-
--data '{
216-
"name": "Example tunnel",
217-
"tunnel_secret": "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="
218-
}'
219-
```
220-
221-
```sh output {18}
222-
{
223-
"success": true,
224-
"errors": [],
225-
"messages": [],
226-
"result": {
227-
"id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
228-
"account_tag": "699d98642c564d2e855e9661899b7252",
229-
"created_at": "2024-12-04T22:03:26.291225Z",
230-
"deleted_at": null,
231-
"name": "Example tunnel",
232-
"connections": [],
233-
"conns_active_at": null,
234-
"conns_inactive_at": "2024-12-04T22:03:26.291225Z",
235-
"tun_type": "cfd_tunnel",
236-
"metadata": {},
237-
"status": "inactive",
238-
"remote_config": true,
239-
"token": "eyJhIjoiNWFiNGU5Z..."
240-
}
241-
}
242-
```
243-
3. Copy the `token` value shown in the output.
244-
245-
</TabItem>
246-
</Tabs>
247-
248-
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.
190+
<Tabs syncKey="dashPlusAPI">
191+
<TabItem label="Dashboard">
192+
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.
196+
197+
</TabItem>
198+
<TabItem label="API">
199+
200+
1. Generate a random base64 string (minimum size 32 bytes) to use as a tunnel secret:
201+
202+
```sh
203+
openssl rand -base64 32
204+
```
205+
206+
```sh output
207+
AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=
208+
```
209+
210+
2. Make a `PATCH` request to the [Cloudflare Tunnel](/api/resources/zero_trust/subresources/tunnels/methods/edit/) endpoint:
211+
212+
```sh
213+
curl --request PATCH \
214+
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/{tunnel_id} \
215+
--header 'Content-Type: application/json' \
216+
--header "Authorization: Bearer <API_TOKEN>" \
217+
--data '{
218+
"name": "Example tunnel",
219+
"tunnel_secret": "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="
220+
}'
221+
```
222+
223+
```sh output {18}
224+
{
225+
"success": true,
226+
"errors": [],
227+
"messages": [],
228+
"result": {
229+
"id": "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
230+
"account_tag": "699d98642c564d2e855e9661899b7252",
231+
"created_at": "2024-12-04T22:03:26.291225Z",
232+
"deleted_at": null,
233+
"name": "Example tunnel",
234+
"connections": [],
235+
"conns_active_at": null,
236+
"conns_inactive_at": "2024-12-04T22:03:26.291225Z",
237+
"tun_type": "cfd_tunnel",
238+
"metadata": {},
239+
"status": "inactive",
240+
"remote_config": true,
241+
"token": "eyJhIjoiNWFiNGU5Z..."
242+
}
243+
}
244+
```
245+
246+
3. Copy the `token` value shown in the output.
247+
248+
</TabItem>
249+
</Tabs>
250+
251+
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.
249252

250253
2. On half of your `cloudflared` replicas, update `cloudflared` to use the new token. For example, on a Linux host:
251254

252-
```sh
253-
sudo cloudflared service install <TOKEN>
254-
```
255+
```sh
256+
sudo cloudflared service install <TOKEN>
257+
```
255258

256259
3. Restart `cloudflared`:
257260

258-
```sh
259-
sudo systemctl restart cloudflared.service
260-
```
261+
```sh
262+
sudo systemctl restart cloudflared.service
263+
```
261264

262265
4. Confirm that the service started correctly:
263-
```sh
264-
sudo systemctl status cloudflared
265-
```
266266

267-
While these replicas are connecting to Cloudflare with the new token, traffic will automatically route through the other replicas.
267+
```sh
268+
sudo systemctl status cloudflared
269+
```
270+
271+
While these replicas are connecting to Cloudflare with the new token, traffic will automatically route through the other replicas.
268272

269273
5. Wait 10 minutes for traffic to route through the new connectors.
270274

@@ -278,29 +282,31 @@ If your tunnel token is compromised, we recommend taking the following steps:
278282

279283
1. Refresh the token using the dashboard or API. Refer to Step 1 of [Rotate a token without service disruption](#rotate-a-token-without-service-disruption).
280284
2. [Delete all connections](/api/resources/zero_trust/subresources/tunnels/subresources/connections/methods/delete/) between `cloudflared` and Cloudflare:
281-
```sh
282-
curl --request DELETE \
283-
https://api.cloudflare.com/client/v4/accounts/{account_id}/cfd_tunnel/{tunnel_id}/connections \
284-
--header "Authorization: Bearer <API_TOKEN>"
285-
```
286285

287-
This will clean up any unauthorized connections and prevent users from connecting to your network.
286+
```sh
287+
curl --request DELETE \
288+
https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/cfd_tunnel/{tunnel_id}/connections \
289+
--header "Authorization: Bearer <API_TOKEN>"
290+
```
291+
292+
This will clean up any unauthorized connections and prevent users from connecting to your network.
288293

289294
3. On each `cloudflared` replica, update `cloudflared` to use the new token. For example, on a Linux host:
290295

291-
```sh
292-
sudo cloudflared service install <TOKEN>
293-
```
296+
```sh
297+
sudo cloudflared service install <TOKEN>
298+
```
299+
294300
4. Restart `cloudflared`:
295301

296-
```sh
297-
sudo systemctl restart cloudflared.service
298-
```
302+
```sh
303+
sudo systemctl restart cloudflared.service
304+
```
299305

300306
5. Confirm that the service started correctly:
301-
```sh
302-
sudo systemctl status cloudflared
303-
```
307+
```sh
308+
sudo systemctl status cloudflared
309+
```
304310

305311
The tunnel token is now fully rotated. The old token is no longer in use.
306312

src/content/docs/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-infrastructure-access.mdx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ import { Tabs, TabItem, Badge, Render } from "~/components";
1313

1414
[Access for Infrastructure](/cloudflare-one/applications/non-http/infrastructure-apps/) provides granular control over how users can connect to your SSH servers. This feature uses the same deployment model as [WARP-to-Tunnel](/cloudflare-one/connections/connect-networks/use-cases/ssh/ssh-warp-to-tunnel/) but unlocks more policy options and command logging functionality.
1515

16-
<Render file="access/short-lived-certs-intro" params={{ intro: "Furthermore, Access for Infrastructure replaces" }} />
16+
<Render
17+
file="access/short-lived-certs-intro"
18+
params={{ intro: "Furthermore, Access for Infrastructure replaces" }}
19+
/>
1720

1821
## 1. Connect the server to Cloudflare
1922

@@ -31,8 +34,7 @@ To connect your devices to Cloudflare:
3134

3235
## 3. Route server IPs through WARP
3336

34-
<Render file="tunnel/warp-to-tunnel-route-ips" params={{ one: "SSH server"}} />
35-
37+
<Render file="tunnel/warp-to-tunnel-route-ips" params={{ one: "SSH server" }} />
3638

3739
## 4. Add a target
3840

@@ -55,9 +57,11 @@ To generate a Cloudflare SSH CA and get its public key:
5557
<Render file="ssh/ssh-proxy-ca" />
5658

5759
### Save the public key
60+
5861
<Render file="ssh/public-key" />
5962

6063
### Modify your SSHD config
64+
6165
<Render file="ssh/modify-sshd" />
6266

6367
:::note
@@ -66,9 +70,11 @@ For certain distributions, such as Amazon Linux 1 (based on RHEL), the certifica
6670
```sh
6771
chmod 600 /etc/ssh/ca.pub
6872
```
73+
6974
:::
7075

7176
### Restart your SSH server
77+
7278
<Render file="ssh/restart-server" />
7379

7480
## 7. Connect as a user
@@ -112,13 +118,14 @@ Cloudflare will stop logging SSH commands to your targets, as well as any comman
112118
To delete the SSH encryption public key using the [API](/api/resources/zero_trust/subresources/gateway/subresources/audit_ssh_settings/methods/update/):
113119

114120
```sh
115-
curl --request PUT https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/audit_ssh_settings \
121+
curl --request PUT https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/audit_ssh_settings \
116122
--header "X-Auth-Email: <EMAIL>" \
117123
--header "X-Auth-Key: <API_KEY>" \
118124
--data '{
119125
"public_key": ""
120126
}'
121127
```
128+
122129
</TabItem>
123130
</Tabs>
124131

0 commit comments

Comments
 (0)