Thirty days to Halcyon · Case 1: Four seconds at 03:12 · Episode 5 of 18

Dax Mercer, Software Engineer on the operations tools team, has an app that stopped at 08:40. It talks to docs.example.com, and now it rejects every connection through the station proxy.

So Dax tries a shortcut. He sends the app straight to the website from his desktop. It fails in less than a second.

Vera Vance, your mentor, reads his screen over her cold coffee. "The proxy broke your app, and the firewall broke your shortcut. Which one do we fix?"

Interactive lesson · content-filtering proxy · 3D

Who can read your request?

Follow a web request through a proxy. See what stays sealed in a tunnel, and what changes when the proxy opens two encrypted connections.

Press Play to follow the story. Pause any time to read the packet.

  • Plain HTTPOpen amber packet · proxy reads the full URL
  • CONNECT tunnelOne sealed green pipe · host and server name only
  • Two TLS sessionsLime + cyan split · decrypted inside the proxy
GatherOffice → firewall + proxy → internetDrag to orbit 3D view
Try a different outcome Experiments & playback options

Proxy policy

Firewall rules

    Firewall state table

    No active state row yet.

    What gets recorded

    Illustrative network with documentation addresses: one proxy, one firewall, and a few example sites. Not shown: Encrypted Client Hello, which hides the server name from the proxy; HTTP/2 and HTTP/3 through a proxy; Kerberos or NTLM proxy sign-in; DNS filtering; and real category lists. Packet timing is slowed down so you can follow each decision.

    Same steps without the 3D view

    The 3D view needs JavaScript and WebGL. This text gives the same steps.

    Gather. A laptop, a desktop, and a tablet send web requests to the proxy at 10.6.0.8 port 8080. One stream leaves the proxy and crosses the firewall. The laptop gets the proxy address from a PAC file. WPAD can find a PAC file automatically; if that lookup leaks, an attacker can answer it.

    Forward. For plain HTTP, the laptop sends the full URL. The proxy reads it, opens a new connection, and the firewall changes the source address to 203.0.113.2. The website sees that address, not the laptop's. The file comes back. The firewall lets it in because it matches the proxy's open connection, and the proxy relays it to the laptop.

    Tunnel. For HTTPS, the laptop sends CONNECT docs.example.com:443. The proxy asks for sign-in with 407, and the laptop sends CONNECT again with Basic sign-in. Basic sign-in sends the password in clear text, so the hop to the proxy needs protection. The policy board checks sign-in, port, and category. The proxy opens a TCP connection to the website, then sends 200 to the laptop. Any 2xx status opens the tunnel. After the 200 status, the proxy copies bytes. It can read the server name in the ClientHello, but not the path. The website sends its real certificate, and the laptop checks it. After the handshake, the proxy sees only the size and timing of each record. The bench allows CONNECT only to port 443, so a CONNECT to port 25 gets 403.

    Inspect. With decrypt on, the proxy makes two TLS sessions. It holds the laptop's ClientHello, opens Session 2 to the website, and checks the website's real certificate there. The laptop cannot see that certificate; it gets one from the Station Inspection CA instead. The laptop trusts the Station Inspection CA, so the proxy can read the request. The proxy then encrypts the request again for the website. The unmanaged tablet shows a certificate error. An app on the desktop that pins the website's own key fails until its host goes on the decrypt-bypass list.

    Decide. The proxy allows a technology site, blocks a malware site with a block page, and opens a plain tunnel for a health site. Without decryption, the proxy can only refuse the tunnel or close the connection; it cannot show a block page. For the exempt health site, the proxy still logs the host and port.

    Enforce. The desktop tries to go direct. Firewall rule 3 rejects it with a TCP reset. In interception mode, the firewall sends the same SYN to the proxy.

    A proxy logs only the traffic that reaches it. In the course story, the 03:12 command that moved the antenna was not web traffic. It went straight to the antenna controller. It did not go through the proxy, so the proxy log cannot show it. The firewall log shows it.

    Read the lesson, check your judgment, and explore sources

    Helpful first: How one request crosses the network · How a stateful firewall decides

    By the end you can

    • Send office web traffic through one proxy, and keep a firewall rule that blocks direct connections
    • Read a full Hypertext Transfer Protocol (HTTP) Uniform Resource Locator (URL), and a CONNECT line that names only the host and the port
    • Explain how a CONNECT tunnel differs from two TLS sessions that use a certificate from an internal certificate authority (CA)

    Many devices, one way out

    A forward proxy collects web traffic from many devices. Each device sends its web requests to the proxy. The proxy then makes a new connection to the website. On this bench the proxy is at 10.6.0.8, port 8080. All web traffic leaves the station from one point.

    The firewall has three interfaces. One goes to the office network, one goes to the proxy zone, and one goes to the internet router. Rule 2 lets only the proxy send web traffic to the internet. Rule 3 rejects direct connections from office devices to port 80 and port 443. Office devices cannot go around the proxy.

    How a device finds the proxy

    A device must know the address of the proxy. An administrator can type the address into the device settings. A proxy auto-configuration (PAC) file can also give the address. The PAC file is a short script. For each Uniform Resource Locator (URL), it tells the browser to use the proxy or to go direct.

    Some devices try to find the PAC file when they have no PAC address. This method is Web Proxy Auto-Discovery (WPAD). WPAD asks the Dynamic Host Configuration Protocol (DHCP) or the Domain Name System (DNS) for the location of the file. WPAD is an Internet-Draft from 1999 that expired. If a WPAD query leaks to a public DNS server, an attacker who registers that name can answer it. The attacker can then send web traffic through a proxy that the attacker controls.

    A proxy can also work when the device has no proxy address. The firewall or the router sends web packets to the proxy. The device does not know about the proxy. We call this an interception proxy, or a transparent proxy.

    For plain HTTP, the proxy reads the whole URL

    For a plain Hypertext Transfer Protocol (HTTP) URL, the laptop sends the full URL to the proxy. The request line starts with GET http://downloads.example.com/tool.zip.

    The proxy can read the host, the path, and the headers. It checks its policy. Then it opens a second connection and sends the request with only the path, /tool.zip. It adds a Via header that names the proxy.

    For HTTPS, CONNECT opens a tunnel

    For an HTTPS URL, the laptop sends a CONNECT request. The request names only a host and a port, for example docs.example.com:443. The proxy can read that host and that port. It cannot read the path, because the path is not in the CONNECT request.

    The proxy can ask the laptop to sign in first. It sends status 407 with a Proxy-Authenticate header. The laptop sends the request again with a Proxy-Authorization header. Basic sign-in sends the password in clear text, so the hop to the proxy needs protection.

    The proxy checks the host and the port. The HTTP standard tells proxies to limit CONNECT to known ports (RFC 9110, June 2022). This bench allows CONNECT only to port 443. Without that limit, an attacker can use the proxy to send spam email or to reach ports that are not for the web.

    Quick check

    Dax's desktop sends CONNECT docs.example.com:443 to the proxy. What can the proxy read from that request?

    Inside the tunnel, the proxy copies bytes

    If the proxy allows the tunnel, it opens a Transmission Control Protocol (TCP) connection to the website. Then it sends a 2xx status, for example 200. After that, the proxy copies bytes in both directions. The laptop does TLS with the website through the tunnel. The bytes of the ClientHello, the first TLS message, go through the proxy, so the proxy can often read the server name. It cannot read the encrypted records.

    The PROXY protocol is a different thing: a Layer 4 header that passes the original client address to a backend server.

    To read the page, the proxy needs two TLS sessions

    A content filter needs to read the path and the page. To do this, the proxy must end the TLS session from the laptop. It shows the laptop a certificate for the website. The station's internal certificate authority (CA) signed that certificate. On this bench, that CA is the Station Inspection CA.

    The laptop accepts that certificate only because the station installed its internal CA on the laptop. A device that does not trust the internal CA shows a certificate error. The proxy also makes a second TLS session to the real website. Now there are two TLS sessions, and the proxy can read the request in the middle. For the steps of a TLS handshake, go back to the lesson on how one request crosses the network.

    The proxy now does the certificate check for the laptop. The laptop cannot see the real certificate of the website. If the proxy accepts a bad certificate, the laptop does not know. The Cybersecurity and Infrastructure Security Agency (CISA) gave advice on this in March 2017. It tells organizations to check that the proxy rejects bad certificates and passes each error to the laptop.

    Some apps pin the key of their server. A pinned app accepts only the keys that it expects. Unless the app makes an exception for the internal CA, it rejects the certificate from the proxy. Such an app fails behind TLS interception. One fix is to put its host on the decrypt-bypass list. The list can also hold bank and health sites, because a proxy that ends TLS can read all of their traffic, including passwords.

    CONNECT tunnel

    • The proxy sees the host and the port
    • The ClientHello often shows the server name
    • The path stays inside TLS

    TLS interception

    • The proxy ends the session from the laptop
    • The station CA signs the certificate the laptop sees
    • The proxy opens Session 2 to the website
    A tunnel or two sessions. A CONNECT tunnel hides the path. Two TLS sessions let the proxy read the request.

    PUT IT IN ORDER

    The proxy decrypts an HTTPS page. Put the steps in order.

    1. The laptop sends its ClientHello, and the proxy answers it
    2. The proxy reads the request and sends it to the website
    3. The proxy sends 200 to the laptop
    4. The laptop sends CONNECT with the host and the port

    Show the answer
    1. The laptop sends CONNECT with the host and the port
    2. The proxy sends 200 to the laptop
    3. The laptop sends its ClientHello, and the proxy answers it
    4. The proxy reads the request and sends it to the website

    CONNECT names the host and the port. The proxy answers the ClientHello itself, so it can read the request before it sends the request to the website.

    Some sites stay sealed, and some never open

    An organization can choose, for example, not to decrypt health sites or bank sites. A decrypt-bypass list names these sites or categories. For a site on the list, the proxy opens a plain tunnel. It logs the host and the port, but it does not read the request. Exempt does not mean hidden.

    The proxy looks up the host in a category list or a reputation list. On this bench, if the verdict is malware, the proxy does not open a connection to the site. If the proxy decrypts the session, it can send a block page. If the proxy does not decrypt it, it can only refuse the tunnel or close the connection. A list can block only what it names.

    WORKED EXAMPLE

    Nyx reads three CONNECT lines

    1. The first line. CONNECT downloads.example.com:443. The port is 443, and the host is not on the decrypt-bypass list. The proxy answers 200, then ends TLS itself with a Station Inspection CA certificate, so it can read the request.
    2. The second line. CONNECT mail.example.com:25. This bench allows CONNECT only to port 443, so the proxy refuses the tunnel. It never opens a connection to port 25.
    3. The third line. CONNECT health.example.com:443. The host is on the decrypt-bypass list. The proxy opens a plain tunnel and logs the host and the port. It does not read the request.

    Result: Two tunnels open and one is refused. The proxy reads the request in one of the two tunnels, and the exempt host stays sealed.

    The website sees the station

    When the proxy makes a connection, the website sees the address of the station. It does not see the laptop. A login inside TLS still tells the website who the user is.

    The firewall changes the source address of the proxy to the public address 203.0.113.2. This change is network address translation (NAT).

    SPOT THE PROBLEM

    These notes are from 03:12. Flag every line that claims something that its log cannot show.

    Show the answers
    • proxy log shows the command to the antenna controller A proxy logs only the traffic that reaches it. That command did not go through the proxy.
    • website log shows the private address of an office desktop The source address that the website sees is the public address of the station, not the private address of the office desktop.
    • proxy log reads the path on a health site that stays sealed This host is exempt from TLS interception. The proxy logs the host and the port but does not read the request inside the tunnel.

    Proxies face two ways

    A forward proxy works for the devices on the inside. A reverse proxy faces the other way. It stands in front of the origin, the server that holds the page. The reverse proxy ends the connection from the client and opens a new connection from its own address. The origin log records the client it accepted. That client is the proxy.

    A Forwarded or X-Forwarded-For header can carry the address of the device. Each proxy adds its entry at the end, so trust only the entries that your own proxies added. A client can fake any Forwarded or X-Forwarded-For entry that your own proxy did not add.

    CHECK YOUR JUDGMENT

    Dax's app rejects the station certificate, and his shortcut around the proxy fails at once. Which fix do you keep?

    CASE FILE · CASE 1 · ENTRY 5 OF 18

    Answer the closing question correctly to add this entry to your case file.

    Web traffic must use the proxy

    Station web traffic leaves through the proxy, which reads an HTTPS page only when it ends TLS with a certificate that the device trusts.

    Next episode: The proxy logged every web host it saw at 03:12. The command to the antenna is not on that list.

    Open the case file ↗

    Review sheet: exam notes and quick reference

    Find your next idea.

    Tip: press / to open search. Escape closes this window.