OPNsenseXXXII · TLS Inspection and Content FilteringTLS inspection concepts
TLS inspection concepts and risks — what MITM at the firewall means
What you'll learn
- Explain what TLS interception does to a connection and why it breaks end-to-end trust
- Identify the legal, privacy, and compliance risks of TLS interception in a production estate
- Recognise the failure modes that surface when interception is silently broken
- Decide which traffic classes warrant interception and which must be exempted
Prerequisites
Verified against OPNsense 25.x · FreeBSD 14.x · PF (FreeBSD packet filter) FreeBSD 14.x · Unbound 1.20+ · Kea DHCP OPNsense 25.x plugin · WireGuard in-kernel + OPNsense plugin · strongSwan (IPsec plugin) OPNsense 25.x plugin · OpenVPN 2.6.x · Suricata 7.x · 2026-08-14
TLS is the protocol that gives the open Internet its privacy. The same protocol is also the reason most malware now hides inside it. When the firewall operator wants to inspect encrypted traffic for malware, data loss, or policy violations, the firewall must break the encryption to look inside — and then put the encryption back together for the client. This is a man-in-the-middle at the perimeter, on purpose, with full knowledge of both ends. It is the most consequential single feature the firewall can be turned into, and it is the one most often enabled without the operator understanding what it actually does.
This lesson covers what TLS interception does to a connection, the trust relationship it breaks, the legal and privacy consequences, and the operational risks that surface when interception is silently broken.
What TLS interception does
A normal TLS connection is end-to-end: the client trusts a public CA, the server presents a certificate signed by that CA, the client validates the chain, and the encrypted bytes flow between them. No party in the middle can read the payload.
Client Server
| --- ClientHello -----> |
| <-- ServerHello, cert ---- | (server cert signed by public CA)
| --- key exchange, Finished |
| <-- Finished, [encrypted] |
| [encrypted application data]|
With TLS interception, the firewall terminates the client side of the TLS connection, opens a second TLS connection to the real server, and forwards the decrypted application data between the two. To the client, the firewall is the server. To the real server, the firewall is the client.
Client Firewall Real server
| -- ClientHello ->| |
| | -- ClientHello ---> |
| | <-- server cert ----|
| <-- FW cert ---- | |
| (FW cert signed by INTERNAL CA) |
| [client thinks it talks to the server; |
| FW decrypts, inspects, re-encrypts] |
| | -- [encrypted] ---->|
The client must trust the firewall’s certificate. The firewall’s certificate must be issued by an internal CA whose root the client also trusts. The chain that was “server → public CA → trust store” is now “server → public CA → firewall’s intercept cert → internal CA → trust store”. Every link must be valid; if any link breaks, the client sees a certificate warning.
Why the trust model breaks
The end-to-end trust model says the client trusts the server because the server’s certificate chains to a root in the client’s trust store. The interception model inserts the firewall between them and says “trust me instead”. For this to work:
- The client must have the firewall’s intercept CA root in its trust store.
- The firewall’s intercept CA must be a separate CA from any production CA — so a compromise of the intercept CA does not affect production certificates.
- The firewall’s intercept certificate must be valid (not expired, not revoked, not on an HPKP pin or certificate transparency blocklist).
- The firewall must be allowed to see the application data — which means the encryption that protected banking sessions, health data, and personal correspondence now protects nothing.
The first three are operational. The fourth is policy.
What interception actually buys
TLS interception lets the firewall see the same plaintext that the application sees. The interception layer can:
- Match URLs, domains, and path components inside HTTPS requests.
- Inspect downloads for malware signatures, file hashes, and content types.
- Apply data-loss-prevention patterns to uploads (credit card numbers, source code, PII).
- Block specific applications by SNI or by HTTP content.
- Log the URL the user visited — which is usually the most useful evidence in a security investigation.
What interception does not buy:
- It does not give the firewall access to keys or certificates of the remote server — the firewall terminates the client side and re-handshakes with the server. The server’s key is never exposed.
- It does not protect against compromises on the server side. If the server is breached, the firewall sees the data the server already sent — the interception adds no defence the server does not already provide.
- It does not protect against users who bring their own devices and have not installed the internal CA. Those devices see certificate warnings and click through them, or refuse the connection.
Operational risks
The biggest risk of TLS interception is silent failure. If a destination is exempt (because it pins, or because the operator added it to the bypass list to debug a complaint), the firewall stops inspecting that traffic. The operator does not know the bypass is happening. The destination sees clean TLS, the client sees clean TLS, and malware rides through on a destination the operator thought was being inspected.
The second-biggest risk is cert expiry. The intercept CA root has a finite lifetime. The client devices trust the root until it expires, then every intercepted connection produces a warning. The clock starts at CA creation, not at client install. A five-year CA created in 2021 is a fire in 2026.
The third risk is legal and privacy. Intercepting employee traffic records what they read, what they search, what they upload. In most jurisdictions this requires notice, consent, or a documented business purpose. In some jurisdictions it is restricted to specific roles (lawful interception under warrant). The operator who enables interception without the policy framework is collecting evidence that is inadmissible in a disciplinary hearing and possibly unlawful to retain.
Deciding what to intercept
The default decision matrix:
| Traffic class | Intercept? | Reason |
|---|---|---|
| General employee web browsing | Yes | Productivity, malware, DLP |
| Guest network | No | Legal and ethical exposure |
| Server-to-server APIs | No | Pinning, performance, no benefit |
| Banking and finance | No | Compliance, user trust |
| Healthcare portals | No | Compliance (HIPAA, GDPR) |
| Email (IMAPS, SMTPS) | Usually | Malware scanning |
| Software updates | Sometimes | Source verification matters |
| Cloud provider APIs | No | Pinning, performance |
| VPN tunnels | No | Already encrypted |
| Voice and video (Zoom, Teams, WebRTC) | No | Performance, E2E design |
The list is a starting point. The actual exemptions depend on the regulatory environment, the corporate policy, the applications the estate uses, and the risk tolerance. The discipline: write the policy first, deploy to match.
Knowledge check · 3 questions
Q1. A user reports that Google Docs refuses to load but every other HTTPS site works. The user has the internal CA in their trust store. What is the most likely cause?
Q2. TLS interception protects against server-side compromise because the firewall terminates the client connection.
Q3. Which of the following are valid reasons to exempt a destination from TLS interception? Select all that apply.
Passing score: 75%. Answers are checked in this browser.