Skip to content

Commit a45e666

Browse files
authored
[Gateway] HTTP non-standard ports (#23177)
1 parent a469d7d commit a45e666

File tree

5 files changed

+90
-1
lines changed

5 files changed

+90
-1
lines changed

src/content/docs/cloudflare-one/policies/gateway/http-policies/tls-decryption.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Render,
1212
TabItem,
1313
Tabs,
14+
Badge,
1415
} from "~/components";
1516

1617
Cloudflare Gateway can perform [SSL/TLS decryption](https://www.cloudflare.com/learning/security/what-is-https-inspection/) in order to inspect HTTPS traffic for malware and other security risks.
@@ -41,6 +42,17 @@ Gateway does not support TLS decryption for applications which use:
4142
- [ESNI and ECH handshake encryption](#esni-and-ech)
4243
- [Automatic HTTPS upgrades](#google-chrome-automatic-https-upgrades)
4344

45+
### Inspect on all ports <Badge text="Beta" variant="caution" size="small" />
46+
47+
<Render
48+
file="gateway/inspect-on-all-ports"
49+
product="cloudflare-one"
50+
params={{
51+
turnOnProcedure:
52+
"you can turn on [protocol detection](/cloudflare-one/policies/gateway/network-policies/protocol-detection/) and configure Gateway to [inspect traffic on all ports](/cloudflare-one/policies/gateway/network-policies/protocol-detection/#inspect-on-all-ports)",
53+
}}
54+
/>
55+
4456
### Incompatible certificates
4557

4658
Applications that use certificate pinning and mTLS authentication do not trust Cloudflare certificates. For example, most mobile applications use <GlossaryTooltip term="certificate pinning" link="/ssl/reference/certificate-pinning/">certificate pinning</GlossaryTooltip>. Cloudflare does not trust applications that use self-signed certificates instead of certificates signed by a public CA.
@@ -87,6 +99,10 @@ Chrome Enterprise users can turn off automatic HTTPS upgrades for all URLs with
8799

88100
</TabItem> </Tabs>
89101

102+
### Mutual TLS (mTLS)
103+
104+
When decrypting TLS to inspect traffic, connections that use mutual TLS (mTLS) will fail because Gateway cannot return the necessary client certificate. To prevent connection failures, create a [Do Not Inspect policy](/cloudflare-one/policies/gateway/http-policies/#do-not-inspect) for this traffic.
105+
90106
### ESNI and ECH
91107

92108
Websites that adhere to [ESNI or Encrypted Client Hello (ECH) standards](https://blog.cloudflare.com/encrypted-client-hello/) encrypt the Server Name Indicator (SNI) during the TLS handshake and are therefore incompatible with HTTP inspection. This is because Gateway relies on the SNI to match an HTTP request to a policy. If the ECH fails, browsers will retry the TLS handshake using the unencrypted SNI from the initial request. To avoid this behavior, you can disable ECH in your users' browsers.

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/docs/cloudflare-one/policies/gateway/network-policies/protocol-detection.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,32 @@ sidebar:
55
order: 2
66
---
77

8+
import { Badge, Render } from "~/components";
9+
810
Gateway supports the detection, logging, and filtering of network protocols using packet attributes.
911

1012
Protocol detection only applies to devices connected to Zero Trust via the WARP client in [Gateway with WARP](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-modes/#gateway-with-warp-default) mode.
1113

1214
## Turn on protocol detection
1315

16+
To turn on protocol detection:
17+
1418
1. In [Zero Trust](https://one.dash.cloudflare.com/), go to **Settings** > **Network** > **Firewall**.
1519
2. Turn on **Protocol Detection**.
1620

1721
You can now use _Detected Protocol_ as a selector in a [Network policy](/cloudflare-one/policies/gateway/network-policies/#detected-protocol).
1822

23+
### Inspect on all ports <Badge text="Beta" variant="caution" size="small" />
24+
25+
<Render
26+
file="gateway/inspect-on-all-ports"
27+
product="cloudflare-one"
28+
params={{
29+
turnOnProcedure:
30+
"under **HTTP inspection ports**, choose _Inspect on all ports_",
31+
}}
32+
/>
33+
1934
## Supported protocols
2035

2136
Gateway supports detection and filtering of the following protocols:

src/content/docs/learning-paths/secure-internet-traffic/build-http-policies/tls-inspection.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 1
66
---
77

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

1010
TLS inspection (also known as TLS decryption or HTTPS inspection) allows Cloudflare Gateway to perform deeper traffic analysis and take actions like scanning request bodies for sensitive data, upgrading to a remote browser isolation session, and redirecting based on the complete URL and path of requests.
1111

@@ -36,6 +36,17 @@ To turn on TLS inspection for your Zero Trust organization:
3636

3737
<Render file="gateway/enable-tls-decryption" product="cloudflare-one" />
3838

39+
#### Inspect on all ports <Badge text="Beta" variant="caution" size="small" />
40+
41+
<Render
42+
file="gateway/inspect-on-all-ports"
43+
product="cloudflare-one"
44+
params={{
45+
turnOnProcedure:
46+
"you can turn on [protocol detection](/cloudflare-one/policies/gateway/network-policies/protocol-detection/) and configure Gateway to [inspect traffic on all ports](/cloudflare-one/policies/gateway/network-policies/protocol-detection/#inspect-on-all-ports)",
47+
}}
48+
/>
49+
3950
### 3. Determine the certificate used for inspection
4051

4152
TLS inspection requires a trusted private root certificate to be able to inspect and filter encrypted traffic. A [Cloudflare root certificate](/cloudflare-one/connections/connect-devices/user-side-certificates/automated-deployment/) is a simple and common solution that is usually appropriate for testing or proof-of-concept conditions when deployed to your devices. You can [generate a Cloudflare certificate](/cloudflare-one/connections/connect-devices/user-side-certificates/#generate-a-cloudflare-root-certificate) in Zero Trust.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
params:
3+
- turnOnProcedure
4+
---
5+
6+
import { Markdown } from "~/components";
7+
8+
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`.
9+
10+
To detect and inspect HTTP and HTTPS traffic on ports in addition to `80` and `443`, <Markdown text={props.turnOnProcedure} />.
11+
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. 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/#filter-http-traffic-when-inspecting-on-all-ports).

0 commit comments

Comments
 (0)