Skip to content

Commit 0afa967

Browse files
authored
[Gateway] Connection establishment (#23243)
* Add draft * Add flowchart draft * Update establishment section * Add retry * Add TCP independence * Rearrange sentences
1 parent 4f0f0da commit 0afa967

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/content/partials/cloudflare-one/gateway/order-of-enforcement.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,29 @@ flowchart TB
135135
egress1-- "Egress with dedicated IP" -->internet
136136
```
137137

138+
## Connection establishment
139+
140+
When a user connects to a server with Gateway, Gateway first establishes a TCP connection with the destination server on the port the user requested. Because TCP traffic is proxied by Cloudflare, the connection Gateway establishes with the origin is independent from the connection users establish with Gateway. This means Gateway assigns a new source IP and port to the user's connection and no details from the user's TCP handshake are included in the TCP handshake with the origin server.
141+
142+
If the TCP connection to the destination server is successful, Gateway will apply policies. If Gateway policies allow the connection, Gateway will connect the user to the destination server. If Gateway policies block the connection, Gateway will end the connection and will not send any data between the user and the destination server. If the TCP connection to the destination server is unsuccessful, Gateway will not run any policies and retry TCP connections from the user to the server.
143+
144+
```mermaid
145+
flowchart TB
146+
A(["User"]) -- Initiates connection --> B["Gateway TCP connection to destination server"]
147+
B -- Connection success --> C["Gateway applies policies"]
148+
B -- Connection failure --> E["Gateway rejects user TCP connections"]
149+
C -- Allow policies --> D["Gateway connects user to destination server"]
150+
C -- Block policies --> F["Gateway ends connection and sends no data"]
151+
152+
B@{ shape: hex}
153+
C@{ shape: hex}
154+
style E stroke:#D50000
155+
style D stroke:#00C853
156+
style F stroke:#D50000
157+
```
158+
159+
Connections to Zero Trust will always appear in your [Zero Trust network session logs](/logs/reference/log-fields/account/zero_trust_network_sessions/) regardless of connection success. Because Gateway does not inspect failed connections, they will not appear in your [Gateway activity logs](/cloudflare-one/insights/logs/gateway-logs/).
160+
138161
## Priority between policy builders
139162

140163
Gateway applies your policies in the following order:

0 commit comments

Comments
 (0)