Skip to content

TLS

TLS (Transport Layer Security) is the encryption layer under HTTPS and under most other modern protocols that carry sensitive data: mail, chat, VPNs, software updates, API calls and the beaconing of a good share of malware. Almost every connection that leaves a network today is wrapped in it.

For anyone monitoring a network, TLS is interesting for the opposite reason one might expect. The payload is encrypted, but the handshake that sets the encryption up is not, or only partially. That handshake reveals which server a client wants to talk to, which software the client is, which certificate the server presents, and whether that certificate can be trusted. Nzyme observes these handshakes passively and records them, without decrypting anything.

You can find all recorded TLS sessions on the Sessions tab and every certificate ever seen on the Certificates tab of the TLS page under Ethernet in the sidebar of your Nzyme web interface.

A short primer for analysts

You don't need to know TLS in depth to make sense of the data, but a little background helps.

How a TLS session is set up

A TLS session starts on an established TCP connection, and Nzyme links every TLS session to its underlying TCP session. The handshake has a few steps, and Nzyme tracks each of them:

  • The Client Hello. The client opens with the TLS versions, cipher suites and extensions it supports, usually the name of the server it wants to reach (the SNI), and the application protocols it would like to speak (ALPN, for example h2 for HTTP/2). This message is always in clear text, and it is where most of the information about the client comes from.
  • The Server Hello. The server picks a version and a cipher suite, and answers the client's extensions.
  • The certificate. The server presents its certificate chain so the client can verify who it is talking to. In TLS 1.2 and older this is sent in clear text. In TLS 1.3 it is already encrypted (see below). The server may also ask the client for a certificate, which is how mutual TLS works.
  • Change Cipher Spec and application data. Both sides switch to encryption and the actual payload flows. Nzyme can only count records and bytes from here on.

Either side can send a TLS alert message at any point, for example when a handshake fails or when a session is closed. These are messages of the TLS protocol itself, not Nzyme alerts, and they are described in more detail below.

Client and server

TLS has clear roles: the client is the device that opened the TCP connection and sent the Client Hello, the server is the one it connected to. Nzyme uses these roles throughout.

What TLS 1.3 hides

TLS 1.3, which is what most browsers and services negotiate today, encrypts everything after the Server Hello. This means that for a TLS 1.3 session Nzyme does not see the server certificate, the server's ALPN selection, or the content of most TLS alert messages. The Client Hello, including the server name, remains visible unless the client uses Encrypted Client Hello (ECH), which hides the server name as well. Nzyme flags sessions that use ECH.

TLS 1.2 sessions expose the full certificate chain, and they still make up a meaningful share of traffic, especially from embedded devices, older software and internal services.

What Nzyme reports

Each TLS session includes:

  • The client and server endpoints, with MAC and asset context where available.
  • The server name (SNI) the client asked for.
  • The negotiated version and the highest version the client offered. A gap between the two is worth a look.
  • The cipher suite the server picked.
  • The ALPN values the client offered and the one the server selected.
  • The JA4 client fingerprint (see below).
  • The server certificate chain, with a trust verdict, whether the server name matches the certificate, and whether the certificate was valid at the time of the handshake (see below).
  • The client certificate chain, if the server requested one and the client presented it.
  • Whether the session was resumed, used a Hello Retry Request, used Encrypted Client Hello or had a client certificate requested.
  • All observed TLS alert messages (see below).
  • Application data record and byte counts in each direction, total bytes, duration, and whether the session is still active.
  • Timestamps of session establishment, most recent segment and termination.

The session details page additionally shows the complete parsed Client Hello and Server Hello: supported versions, every offered cipher suite, every extension, supported groups and signature algorithms. This is the raw material an analyst needs to understand why a particular client looks the way it does.

Certificate chain trust

For every session with a visible server certificate chain, Nzyme validates the chain against the trust store of the nzyme-node system it runs on, the same way a browser or operating system would:

Verdict Meaning
Trusted The chain validates up to a certificate authority the node trusts.
Untrusted The chain does not validate. The reason is shown on hover and on the details page, for example an unknown issuer, an expired certificate or a failed signature check.
Encrypted The session is TLS 1.3 and the certificate was never visible on the wire.
n/a No certificate chain was observed, for example because the handshake never got that far.

An Untrusted verdict is not automatically a problem. By far the most common reason is a self-signed certificate: the kind that cameras, printers, switches, hypervisors and development servers ship with. There is no certificate authority behind it, so nothing can vouch for it, and the chain can never validate. Nzyme tracks self-signed certificates as their own attribute, so you can filter on Self-Signed Server Certificate to set them apart from, or exclude them from, the sessions whose chains failed for other reasons. The second most common reason is a certificate from a private CA, which will show as untrusted unless that CA is installed in the trust store of the system running nzyme-node.

A session to a public service that presents an untrusted chain, however, is one of the most important things this view can show you, because it is what a man-in-the-middle looks like.

Two more checks accompany the verdict:

  • Server name matches certificate. Whether the name the client asked for is covered by the certificate's subject or subject alternative names. A mismatch means the client either ignored it or is being served the wrong certificate.
  • Certificate valid at handshake. Whether the handshake happened inside the certificate's validity period. This is evaluated against the time of the handshake, not the time you look at it, so an old session is not retroactively marked invalid.

JA4 client fingerprint

The Client Hello of a given piece of software looks the same every time it connects, regardless of the server it talks to. JA4 condenses it into a short fingerprint, for example t13d1516h2_8daaf6152771_e5627efa2ab1, that identifies the client software rather than the client device. The same browser produces the same fingerprint on every machine, which lets you group sessions by software and spot the odd one out: a fingerprint nobody else on the network produces, a fingerprint that claims to be a browser but is seen on a server, or the known fingerprint of a malware family.

Fingerprints are available as a filter, on the session details page, and as a Top Client Fingerprints ranking on the sessions page. See the JA4 repository for the specification and collections of known fingerprints.

TLS alert messages

TLS alert messages are short messages either side sends when something goes wrong, or simply to close a session cleanly. They are part of the TLS protocol and unrelated to the alerts Nzyme itself raises. Nzyme records every TLS alert message it observes, with its direction and level:

Level Meaning
warning The session may continue. The clean close at the end of a session is one of these.
fatal The session is terminated immediately.

Alert messages sent after encryption started are recorded as encrypted: Nzyme sees that one was sent, but not what it says. In practice these are nearly always the close_notify at the end of a session. Alert messages sent during the handshake are visible, and those are the interesting ones. A handshake_failure, unknown_ca, certificate_expired, bad_certificate or protocol_version alert tells you a connection was refused and why. The Alert filter matches on these visible alerts only.

Certificates

Every certificate Nzyme observes, whether in a TLS session or in a Portal Integrity probe, is stored once, keyed by its SHA-256 fingerprint, together with when it was first and last seen. The Certificates tab lists them for the selected time range, with their subject, issuer, subject alternative names, validity period, key and signature algorithms, and how many sessions referenced them. Charts show newly seen certificates over time, the top issuers, and the distribution of key types and signature algorithms. A separate list calls out certificates that are expired or expiring within 30 days.

The certificate details page shows the complete parsed certificate, including extended key usage, subject and authority key identifiers, the certificate in PEM format for use with other tools, and every session and portal integrity report that referenced it in the selected time range.

Certificates can be filtered by any of these attributes, and a certificate's fingerprint can be used as a filter on the sessions page to find everything that was presented a given certificate.

Analyzing TLS activity

The TLS views and their charts help answer common questions:

  • Who is talking to which services? The top server names ranking shows the most contacted services by SNI, and the session list shows which clients contacted them. Filtering on a server name or a client address narrows it down.
  • Is anyone being served an untrusted certificate? Filter on Chain Trusted being false, then use the Chain Trust Error filter to separate private CAs from signature failures and expired certificates.
  • Is old or weak crypto in use? The negotiated versions chart shows the share of TLS 1.0, 1.1 and 1.2. Filtering on a version or a cipher suite lists the sessions and the devices behind them.
  • Which software is on the network? The top client fingerprints ranking groups sessions by JA4. Unexpected fingerprints, or a fingerprint on a device where it does not belong, stand out.
  • Are handshakes failing? Filter on sessions that have a visible TLS alert message, or on a specific one such as handshake_failure or unknown_ca.
  • When was activity happening? The active sessions chart shows how many TLS sessions were concurrently active over time, and stays readable even on networks with many parallel sessions.
  • Which certificates are about to expire? The expiring certificates list on the Certificates tab shows every certificate seen on the network that expires within 30 days, including internal services that are easy to forget.
  • Is a client presenting a certificate? Filter on Client Certificate Requested to find mutual TLS, and check the client chain on the session details page.

Relationship to TCP sessions

Every TLS session sits on a TCP session, and the two are linked in both directions. The TLS session details page links to the underlying TCP session, and the TCP session details page shows the encapsulated TLS session, the same way it shows other recognized protocols.

Retention

TLS sessions follow the retention time of the Ethernet: Layer 4 data category. Certificates have their own data category, Ethernet: TLS Certificates, with a default retention time of 180 days. A certificate is deleted once it has not been seen for the configured time, but never while a stored TLS session or portal integrity report still references it. See Configuring Retention Times for how to change retention times.

Configuration

TLS detection is part of Nzyme's TCP analysis and requires no separate configuration beyond having Ethernet monitoring enabled on the relevant interface. See the Ethernet overview for interface configuration.

Additionally, you can tune pipeline performance in your Nzyme tap configuration files. TLS is one of the busier protocols on most networks, so this is the setting to raise if you see pipeline warnings in the tap logs:

[protocols.tls]
pipeline_size = 512
Variable Description
pipeline_size The tap process moves data internally using in-memory pipelines. You may have to increase this value if you experience high throughput of TLS segments.

Trusting your own certificate authority

Chain trust is validated by nzyme-node using the trust store of the Java runtime it ships with, not the trust store of the operating system. Certificates issued by your own CA will therefore show as Untrusted until you add that CA to the Java trust store. On a system installed from the Nzyme packages, the runtime lives in /usr/share/nzyme/jvm:

sudo /usr/share/nzyme/jvm/bin/keytool -importcert -cacerts -alias my-company-ca -file /path/to/ca.pem

The default password of the Java trust store is changeit. Confirm the import when asked, then restart nzyme-node. Sessions recorded after the restart will validate against the new CA. Already recorded sessions keep the verdict they were given when they were observed.

Repeat after upgrades

The Java runtime is replaced when the nzyme package is upgraded, which resets its trust store. Repeat the import after every upgrade, or keep your CA in a separate trust store that survives upgrades: copy /usr/share/nzyme/jvm/lib/security/cacerts to /etc/nzyme/cacerts, import your CA into the copy, and point the JVM at it in /etc/default/nzyme by adding -Djavax.net.ssl.trustStore=/etc/nzyme/cacerts to NZYME_JAVA_OPTS.