Skip to content

Commit 2f6edb4

Browse files
committed
Change success to output
1 parent 364a45a commit 2f6edb4

File tree

3 files changed

+37
-19
lines changed

3 files changed

+37
-19
lines changed

src/content/partials/cloudflare-one/gateway/get-started/create-dns-policy.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ To create a new DNS policy:
2929
| ------- | ---------- | ---------- |
3030
| Account | Zero Trust | Edit |
3131

32-
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/), email address, and API token.
32+
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/) and API token.
3333
3. Send a `POST` request to the [Create a Zero Trust Gateway rule](/api/operations/zero-trust-gateway-rules-create-zero-trust-gateway-rule) endpoint. For example, we recommend adding a policy to block all [security categories](/cloudflare-one/policies/gateway/domain-categories/#security-categories):
3434

35-
```bash title="curl API example"
35+
```sh title="curl API DNS policy example"
3636
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules \
37-
--header "X-Auth-Email: <EMAIL>" \
38-
--header "X-Auth-Key: <API_KEY>" \
37+
--header "Content-Type: application/json" \
38+
--header "Authorization: Bearer <API_TOKEN>" \
3939
--data '{
4040
"name": "Block security risks",
4141
"description": "Block all default Cloudflare DNS security categories",
@@ -51,7 +51,13 @@ To create a new DNS policy:
5151
}'
5252
```
5353

54-
If Gateway successfully created the policy, the API will respond with a `success` value of `true`.
54+
```sh output
55+
{
56+
"success": true,
57+
"errors": [],
58+
"messages": []
59+
}
60+
```
5561

5662
</TabItem> </Tabs>
5763

src/content/partials/cloudflare-one/gateway/get-started/create-http-policy.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,50 @@ To create a new HTTP policy:
3838
| ------- | ---------- | ---------- |
3939
| Account | Zero Trust | Edit |
4040

41-
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/), email address, and API token.
41+
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/) and API token.
4242
3. Send a `POST` request to the [Create a Zero Trust Gateway rule](/api/operations/zero-trust-gateway-rules-create-zero-trust-gateway-rule) endpoint. For example, if you have enabled TLS decryption, some applications that use [embedded certificates](/cloudflare-one/policies/gateway/http-policies/tls-decryption/#inspection-limitations) may not support HTTP inspection, such as some Google products. You can create a policy to bypass inspection for these applications:
4343

44-
```bash title="curl API example"
44+
```sh title="curl API HTTP policy example"
4545
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules \
46-
--header "X-Auth-Email: <EMAIL>" \
47-
--header "X-Auth-Key: <API_KEY>" \
46+
--header "Content-Type: application/json" \
47+
--header "Authorization: Bearer <API_TOKEN>" \
4848
--data '{
4949
"name": "Do not inspect applications",
5050
"description": "Bypass TLS decryption for unsupported applications",
5151
"precedence": 0,
5252
"enabled": true,
5353
"action": "off",
5454
"filters": [
55-
"http"
55+
"http"
5656
],
5757
"traffic": "any(app.type.ids[*] in {16})",
5858
"identity": "",
5959
"device_posture": ""
6060
}'
6161
```
6262

63-
If Gateway successfully created the policy, the API will respond with a `success` value of `true`.
63+
```sh output
64+
{
65+
"success": true,
66+
"errors": [],
67+
"messages": []
68+
}
69+
```
6470

6571
Cloudflare also recommends adding a policy to block [known threats](/cloudflare-one/policies/gateway/domain-categories/#security-categories) such as Command & Control, Botnet and Malware based on Cloudflare's threat intelligence:
6672

6773
```bash title="curl API example"
6874
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules \
69-
--header "X-Auth-Email: <EMAIL>" \
70-
--header "X-Auth-Key: <API_KEY>" \
75+
--header "Content-Type: application/json" \
76+
--header "Authorization: Bearer <API_Token>" \
7177
--data '{
7278
"name": "Block security categories",
7379
"description": "Block all default Cloudflare HTTP security categories",
7480
"precedence": 0,
7581
"enabled": true,
7682
"action": "block",
7783
"filters": [
78-
"http"
84+
"http"
7985
],
8086
"traffic": "any(http.request.uri.security_category[*] in {68 178 80 83 176 175 117 131 134 151 153})",
8187
"identity": "",

src/content/partials/cloudflare-one/gateway/get-started/create-network-policy.mdx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ To create a new network policy:
2929
| ------- | ---------- | ---------- |
3030
| Account | Zero Trust | Edit |
3131

32-
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/), email address, and API token.
32+
2. (Optional) Configure your API environment variables to include your [account ID](/fundamentals/setup/find-account-and-zone-ids/) and API token.
3333
3. Send a `POST` request to the [Create a Zero Trust Gateway rule](/api/operations/zero-trust-gateway-rules-create-zero-trust-gateway-rule) endpoint. For example, you can use a list of [device serial numbers](/cloudflare-one/identity/devices/warp-client-checks/corp-device/) to ensure users can only access an application if they connect with the WARP client from a company device:
3434

35-
```bash title="curl API example"
35+
```sh title="curl API network policy example"
3636
curl https://api.cloudflare.com/client/v4/accounts/{account_id}/gateway/rules \
37-
--header "X-Auth-Email: <EMAIL>" \
38-
--header "X-Auth-Key: <API_KEY>" \
37+
--header "Content-Type: application/json" \
38+
--header "Authorization: Bearer <API_TOKEN>" \
3939
--data '{
4040
"name": "Enforce device posture",
4141
"description": "Ensure only devices in Zero Trust organization can connect to application",
@@ -51,7 +51,13 @@ To create a new network policy:
5151
}'
5252
```
5353

54-
If Gateway successfully created the policy, the API will respond with a `success` value of `true`.
54+
```sh output
55+
{
56+
"success": true,
57+
"errors": [],
58+
"messages": []
59+
}
60+
```
5561

5662
</TabItem> </Tabs>
5763

0 commit comments

Comments
 (0)