Decrypting SSL at scale with eBPF, libbpf and K8s
containiq.com
Decrypting SSL at scale with eBPF, libbpf and K8s
1–7 of 7 posts
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#2Wait, how can this be? Doesn't OpenSSL need to encrypt and decrypt all of the data that goes across the connection, for the connection's entire lifetime?
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#3> OpenSSL goes to great lengths to make them unreadable once the handshake is finished. Even if you have access to a program’s memory once they are derived, they are useless to Wireshark. Wait, how can this be? Doesn't OpenSSL need to encrypt and decrypt all of the data that goes across the connection, for the connection's entire lifetime?
This is in process, we are using eBPF to read the keys out of memory in process and then write them into a pcapng file that tshark can use.
The handshake is only partially encrypted, the public keys and client random can be traced from the network, but the private keys need to be read from memory.
Some of the keys necessary to decrypt the stream are only found in memory for a limited time after which they are overwritten, if the keys are not retrieved in this time window the connection cannot be decrypted by tshark.
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#4> OpenSSL goes to great lengths to make them unreadable once the handshake is finished. Even if you have access to a program’s memory once they are derived, they are useless to Wireshark. Wait, how can this be? Doesn't OpenSSL need to encrypt and decrypt all of the data that goes across the connection, for the connection's entire lifetime?
Author here. This is in process, we are using eBPF to read the keys out of memory in process and then write them into a pcapng file that tshark can use. The handshake is only partially encrypted, the public keys and client random can be traced from the network, but the private keys need to be read from memory. Some of the keys necessary to decrypt the stream are only found in memory for a limited time after which the…
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#5Earlier quoted context omitted.
Author here. This is in process, we are using eBPF to read the keys out of memory in process and then write them into a pcapng file that tshark can use. The handshake is only partially encrypted, the public keys and client random can be traced from the network, but the private keys need to be read from memory. Some of the keys necessary to decrypt the stream are only found in memory for a limited time after which the…
But don't the keys to decrypt the stream have to remain in memory for at least as long as the stream itself is active? Or is the issue that the connection completes too quickly, so that that doesn't give you enough time?
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#6Earlier quoted context omitted.
But don't the keys to decrypt the stream have to remain in memory for at least as long as the stream itself is active? Or is the issue that the connection completes too quickly, so that that doesn't give you enough time?
The application keys definitely do. The handshake keys are modified and at some point become useless to tshark. Not sure if it is a defensive coding thing, or what, but yeah if we don't catch it at the exact right moment they don't work.
Re: Decrypting SSL at scale with eBPF, libbpf and K8s
#7Earlier quoted context omitted.
The application keys definitely do. The handshake keys are modified and at some point become useless to tshark. Not sure if it is a defensive coding thing, or what, but yeah if we don't catch it at the exact right moment they don't work.
Okay, that makes sense. What do you need the handshake keys for, though? Aren't the application keys enough to decrypt all of the data that you need to?