NETOBSERV-2858: export readable OpenSSL TLS plaintext to JSONL - #540
NETOBSERV-2858: export readable OpenSSL TLS plaintext to JSONL#540jpinsonneau wants to merge 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
@jpinsonneau: This pull request references NETOBSERV-2858 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #540 +/- ##
==========================================
+ Coverage 13.18% 18.40% +5.22%
==========================================
Files 20 22 +2
Lines 2443 2880 +437
==========================================
+ Hits 322 530 +208
- Misses 2095 2287 +192
- Partials 26 63 +37
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
7dfc84b to
7017fbf
Compare
Add --enable_openssl packet capture wiring, PlaintextDisplay formatting (prefix stripping, HTTP peeling), and openssl/http example workloads. Writes output/plaintext/*.jsonl without wire correlation or TUI (NETOBSERV-2859). Use --background during capture; pair with agent image from NETOBSERV-2857. Co-authored-by: Cursor <cursoragent@cursor.com>
7017fbf to
d504c4d
Compare
|
New image: quay.io/netobserv/network-observability-cli:d504c4dcIt will expire in two weeks. To use this build, update your commands using: USER=netobserv VERSION=d504c4dc make commands |
|
Tested and works as expected 🥳 To generate fake traffic: Then run the capture using: See the plaintext output when capture finished with: |
leandroberetta
left a comment
There was a problem hiding this comment.
Hi @jpinsonneau, few comments below, thanks!
| // display as flow async | ||
| go AppendFlow(genericMap.Copy()) | ||
|
|
||
| writePacketData(ngw, &genericMap, &data) |
There was a problem hiding this comment.
I noticed that watchTLSKeylog acquires keylogMu when writing DSB blocks to ngw, but writePacketData writes packet data to the same NgWriter without acquiring that mutex. Since both run concurrently (main goroutine vs. the ticker goroutine), this could corrupt the pcapng output. Should keylogMu (or a shared writer mutex) also be held around writePacketData?
| // optionEnabled reports whether a named CLI option is set in the pipe-separated --options string. | ||
| // The shell passes flags as --name or name=true. | ||
| func optionEnabled(name string) bool { | ||
| if strings.Contains(options, name+"=false") { |
There was a problem hiding this comment.
optionEnabled uses strings.Contains, which means optionEnabled("enable_openssl") would also match an option like enable_openssl_debug. Minor risk today since no such option exists, but splitting by | and matching the key exactly would be safer.
Description
--enable_openssl(and related TLS plaintext options) topacketscapture, wiring agent env vars viapacket-capture.yml.output/plaintext/<timestamp>.jsonlwith a human-readablePlaintextDisplayfield (HTTP body / request line / JSON text extraction, OpenSSL metadata prefix stripping).openssl-test-podandhttp-test-podexamples plus TLS coverage notes indocs/tls-decryption-coverage.md.JSONL export only — TUI wire buffer and live plaintext columns are deferred to NETOBSERV-2859.
Test plan
make buildgo test ./cmdNETOBSERV_AGENT_IMAGE=<2857-image> ./build/oc-netobserv packets --port=8443 --peer_ip=<pod> --enable_openssl --privileged --backgroundPlaintextDisplaywith readable HTTP (not raw TLS/binary)Dependencies
netobserv/netobserv-ebpf-agent#1006
Checklist