Re:Show HN: Subtrace – Wireshark for Docker Containers
by adtac on Wednesday February 19, 2025 @03:06PM
(#43106868)
Yep, certificate pinning is the one scenario Subtrace can't handle in my experience. And IMO there is no general solution to the problem [1], but it's one of those very interesting problems to daydream thinking about when you're stuck in traffic or whatever :)
We still try our best by handling as much of the long tail of environments with some library/framework specific environment variables (e.g. Deno bundles all TLS certs in its binary so we set the DENO_CERT env var when applicable).
Re:Show HN: Subtrace – Wireshark for Docker Containers
by chatmasta on Thursday February 20, 2025 @01:13AM
(#43111657)
No general solution? :) If you came up with this hack I’m sure you can extend it…
Cert pinning has to read a public cert from memory, right? And a public cert has a well-known shape… and you have bpf and access to the memory…
Re:Show HN: Subtrace – Wireshark for Docker Containers
by adtac on Thursday February 20, 2025 @02:19AM
(#43111986)
in a different context, maybe: https://news.ycombinator.com/item?id=38044786 :)
Re:Show HN: Subtrace – Wireshark for Docker Containers
by smw on Thursday February 20, 2025 @01:25PM
(#43118244)
kubeshark [0] is using ebpf to catch calls to openssl/go's tls lib and thus no need to juggle certs. Has pros and cons compared to your method, but an interesting comparison.
Re:Show HN: Subtrace – Wireshark for Docker Containers
by ddelnano on Thursday February 20, 2025 @01:47PM
(#43118481)
The approach you describe above is common for similar projects:
- Pixie (https://px.dev) -- which I contribute to
- Beyla (https://github.com/grafana/beyla)
- Coroot (https://github.com/coroot/coroot)
If you are interested in the details and how the strategy for this tracing has evolved, you can learn more in this blog (https://blog.px.dev/ebpf-tls-tracing-past-present-future/).
It won't work with programs that defensively validate the cert chain but those are rare.
It won't work with programs that embed their own root cert store, which is also rare but I would guess less rare than the previous one. The usual reason to do this is to minimize OS deps, and in the case of Docker containers to save on container image size by only including the roots you care about.
But yes for the vast majority of programs it should work fine.