Skip to content

Commit 64b9edd

Browse files
committed
Add common policy
1 parent 1110ec9 commit 64b9edd

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,41 @@ curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
165165

166166
</TabItem> </Tabs>
167167

168+
## Filter HTTP traffic when inspecting on all ports
169+
170+
If your organization blocks traffic by default with a network policy and you want to [inspect HTTP traffic on all ports](/cloudflare-one/policies/gateway/network-policies/protocol-detection/#inspect-on-all-ports), you need to explicitly allow HTTP and TLS traffic to filter it.
171+
172+
<Tabs syncKey="dashPlusAPI"> <TabItem label="Dashboard">
173+
174+
| Selector | Operator | Value | Logic | Action |
175+
| ----------------- | -------- | ------ | ----- | ------ |
176+
| Detected Protocol | is | _TLS_ | Or | Allow |
177+
| Detected Protocol | is | _HTTP_ | | |
178+
179+
</TabItem>
180+
181+
<TabItem label="API">
182+
183+
```bash
184+
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/gateway/rule \
185+
--header "Content-Type: application/json" \
186+
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
187+
--data '{
188+
"name": "Allow on inspect all ports",
189+
"description": "Filter TLS traffic when using inspect all ports",
190+
"enabled": true,
191+
"action": "allow",
192+
"filters": [
193+
"l4"
194+
],
195+
"traffic": "net.detected_protocol == \"tls\" or net.detected_protocol == \"http\"",
196+
"identity": "",
197+
"device_posture": ""
198+
}'
199+
```
200+
201+
</TabItem> </Tabs>
202+
168203
## Restrict access to private networks
169204

170205
Restrict access to resources which you have connected through [Cloudflare Tunnel](/cloudflare-one/connections/connect-networks/).

src/content/partials/cloudflare-one/gateway/inspect-on-all-ports.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ import { Markdown } from "~/components";
77

88
By default, Gateway will only inspect HTTP traffic through port `80`. Additionally, if you [turn on TLS decryption](/cloudflare-one/policies/gateway/http-policies/tls-decryption/#turn-on-tls-decryption), Gateway will inspect HTTPS traffic through port `443`.
99

10-
To detect and inspect HTTP and HTTPS traffic on ports other than `80` and `443`, <Markdown text={props.turnOnProcedure} />.
10+
To detect and inspect HTTP and HTTPS traffic on ports in addition to `80` and `443`, <Markdown text={props.turnOnProcedure} />.
1111

12-
Inspecting traffic on all ports works best if you deny all traffic by default using network policies. By default, Gateway allows all traffic. If you do not configure a default deny, Gateway will allow all non-HTTPS TLS traffic, and you will not be able to filter this traffic based on protocol.
12+
Inspecting traffic on all ports works best if you allow all traffic by default. If your organization uses a network policy to block all traffic by default, Gateway will allow all non-HTTPS TLS traffic, and you will not be able to filter this traffic based on protocol. To use HTTP policies to filter all TLS traffic on all ports when using a default Block network policy, [create a network policy to explicitly allow HTTP and TLS traffic](/cloudflare-one/policies/gateway/network-policies/common-policies/#allow-only-approved-traffic).

0 commit comments

Comments
 (0)