Network policy
Enforcing Network Policy Without Decrypting Anything
The endpoint firewall needed to police encrypted connections without becoming a TLS-terminating proxy. JA3 and SNI turned out to be enough.
· 3 min read
- TLS
- JA3
- SNI
Most of the traffic a host-based firewall needs to police today is encrypted, which means the obvious options — deep packet inspection, TLS termination and re-encryption — either don't work or introduce exactly the kind of trust boundary you're trying to avoid. Decrypting a process's traffic to decide whether to allow it defeats a fair amount of the point.
The endpoint application firewall I built instead treats the TLS handshake itself as the signal, not the payload behind it. Two fields do almost all the work:
- SNI (Server Name Indication) — sent in the clear during the handshake, before encryption kicks in, telling you which hostname the client is trying to reach. Enough to enforce "this process may talk to
api.internal.corp, nothing else," without seeing a single encrypted byte. - JA3 — a fingerprint of how a TLS client negotiates (cipher suites, extensions, elliptic curves, in the order it offers them), rather than what it's saying. Different TLS libraries and versions produce different JA3 hashes even hitting the same server, which makes it useful for a narrower question than SNI: not just "where is this process connecting," but "does this process's TLS stack look like what I expect it to look like."
The other half of the design was attribution: mapping each outgoing connection back to the process that opened it, via /proc and netlink sockets, so policy isn't just "block this destination" but "this specific process may reach this specific destination, and nothing else may." A rule engine sits on top with allow/deny/throttle actions, plus a Flask REST console for managing policy across multiple endpoints instead of editing config files on each machine by hand.
None of this requires the firewall to see inside the encrypted channel at all — which is the point. The moment a security control needs to decrypt traffic to make a decision, that control becomes a target and a liability of its own. SNI and JA3 give you enough signal to enforce meaningful policy while leaving the actual encrypted conversation exactly as opaque to the firewall as it is to everyone else on the wire.