Skip to content

Commit f495276

Browse files
[Spectrum] Adds a new ref page to the Spectrum docs (#17621)
* Adds a new ref page to the Spectrum docs * Apply suggestions from code review Co-authored-by: Pedro Sousa <[email protected]> * Adds glossary tool tip --------- Co-authored-by: Pedro Sousa <[email protected]>
1 parent 9e7b99e commit f495276

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
pcx_content_type: reference
3+
title: Why Spectrum-enabled hostnames might appear in Layer 7 Analytics
4+
---
5+
6+
import { GlossaryTooltip } from "~/components"
7+
8+
Even when you have Spectrum enabled to handle Layer 4 traffic (for example, TCP/UDP connections), you may still notice traffic in your Layer 7 (L7) analytics dashboard. This is due to the way Cloudflare's Layer 7 <GlossaryTooltip term="content delivery network (CDN)">CDN</GlossaryTooltip>
9+
and Spectrum handle customer identity differently.
10+
11+
## How Spectrum identifies a user (Layer 4)
12+
13+
In Spectrum, the identity of the customer hostname is based on the Cloudflare IP address that the client uses to connect to the edge. Here is the typical process:
14+
15+
1. Spectrum sets up a DNS hostname in the customer's zone that points to its Spectrum edge IP, and links this edge IP and port to the customer's configuration.
16+
2. The client performs a DNS lookup on the Spectrum hostname, retrieves the Spectrum edge IP, and connects to that IP and port.
17+
3. Spectrum uses this edge IP and port to match the connection to the customer's configuration, identifying the customer.
18+
19+
This process focuses on Layer 4 associating a hostname and customer configuration around IP addresses and ports.
20+
21+
## How the CDN identifies a user (Layer 7)
22+
23+
1. The customer sets up a DNS hostname in their zone that directs traffic to their origin server.
24+
2. The client performs a DNS lookup on the CDN hostname, and the DNS server responds with a CDN edge IP. In contrast to Spectrum, the CDN edge IP is primarily used for traffic management rather than customer identity, as multiple customers can share the same CDN edge IP.
25+
26+
For the CDN, identifying the customer relies heavily on resolving hostnames during the TLS handshake (SNI) and the HTTP request (`Host` header). Notably, the CDN is designed to accept any hostname that matches the customer's zone (for example, `*.example.com`), even if there is no specific Layer 7 DNS match. This means that even Spectrum or Load Balancer hostnames will be accepted as valid under `*.example.com`.
27+
28+
## The overlap: Layer 7 traffic being proxied through Spectrum
29+
30+
Because the CDN is designed to accept any hostname under your zone (for example, `spectrum.example.com`), HTTP traffic that should first be proxied by Spectrum, or even HTTP traffic meant for a Layer-4-only Spectrum app, may sometimes be processed directly by the Layer 7 CDN system. The process is the following:
31+
32+
1. The client connects to a Layer 7 CDN edge IP while using the hostname of a Spectrum application (for example, `spectrum.example.com`) during both the TLS handshake and the HTTP request. Essentially, this means the client is attempting to access `spectrum.example.com` on an incorrect IP.
33+
2. The CDN accepts this hostname as part of the customer zone during both the TLS and HTTP phases because it is designed to recognize any hostname under `*.example.com`. As a result, the request passes through the CDN under the zone's identity.
34+
3. However, when the CDN attempts to connect to the origin server, it performs an internal DNS lookup of the HTTP hostname, which resolves to the Spectrum IP (from `spectrum.example.com` to the Spectrum edge IP). Consequently, the CDN establishes an origin connection to Spectrum, loading its configuration and forwarding the request to the Spectrum origin.
35+
36+
This means traffic for this hostname undergoes the standard Layer 7 CDN products, including Analytics and logs.
37+
38+
## Blocking unwanted L7 traffic
39+
40+
If you want to prevent traffic for Layer-4-only Spectrum hostnames from being proxied through Layer 7 to your origin (including unwanted scans or requests), we recommend implementing a Layer 7 WAF (Web Application Firewall) rule. This rule can block traffic directed at specific hostnames or ports, ensuring that only legitimate traffic reaches your Spectrum service.
41+
42+
For example, you can create a WAF rule to block requests to `spectrum.example.com` unless they originate from a Spectrum IP or a customer's Spectrum BYOIP. The traffic will still be logged in Layer 7 Analytics, including WAF Security Events, but this prevents it from arriving at the wrong address and looping through the CDN a second time.

0 commit comments

Comments
 (0)