contrib: add Wireshark plugins for NetworkDB#50316
Merged
vvoland merged 1 commit intomoby:masterfrom Jul 8, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for logging NetworkDB encryption keys for use by new Wireshark dissectors and contributes two Lua plugins for dissecting memberlist and NetworkDB gossip traffic.
- Introduce
logEncKeysto write hex-encoded keys to a file configurable viaNETWORKDBKEYLOGFILE. - Invoke
logEncKeysinSetKeyand during cluster initialization. - Add two Lua dissectors (
memberlist.luaandmoby-networkdb.lua) plus updated documentation for installing and configuring them.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libnetwork/networkdb/debug.go | New logEncKeys function to write keys to a logfile |
| libnetwork/networkdb/cluster.go | Call logEncKeys in SetKey and clusterInit |
| contrib/wireshark/moby-networkdb.lua | Wireshark plugin for NetworkDB gossip messages |
| contrib/wireshark/memberlist.lua | Wireshark plugin for HashiCorp/memberlist protocol |
| contrib/wireshark/README.md | Documentation for installing and configuring plugins |
Comments suppressed due to low confidence (3)
libnetwork/networkdb/debug.go:11
- Consider adding unit tests to validate that
logEncKeyscorrectly creates/appends to the file, handles missing env var, and logs errors when file operations fail.
func logEncKeys(ctx context.Context, keys ...[]byte) {
contrib/wireshark/moby-networkdb.lua:32
- The variable
dissectoris undefined in this scope. Consider using a defined identifier such asprotobuf_dissectorordecodeasto correctly reference the failing dissector in the error message.
if not ok then tree:add_expert_info(PI_DISSECTOR_BUG, PI_ERROR, "Dissector " .. dissector .. " failed: " .. tostring(err)) end
contrib/wireshark/moby-networkdb.lua:49
- The variable
dissectoris undefined here as well. Use a valid reference (e.g.protobuf_dissectoror the localdecodeasvalue) to avoid runtime errors in this error path.
if not ok then tree:add_expert_info(PI_DISSECTOR_BUG, PI_ERROR, "Dissector " .. dissector .. " failed: " .. tostring(err)) end
bc318e2 to
860e3fb
Compare
Contribute a Wireshark plugin for decrypting and dissecting hashicorp/memberlist messages. And contribue a plugin for dissecting the NetworkDB messages transported as memberlist User messages. Add a feature to NetworkDB to log the encryption keys to a file for the Wireshark memberlist plugin to consume, configured using an environment variable. Signed-off-by: Cory Snider <[email protected]>
860e3fb to
ebfafa1
Compare
vvoland
approved these changes
Jul 8, 2025
akerouanton
approved these changes
Jul 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
- How I did it
Contribute a Wireshark plugin for decrypting and dissecting hashicorp/memberlist messages. And contribue a plugin for dissecting the NetworkDB messages transported as memberlist User messages.
Add a feature to NetworkDB to log the encryption keys to a file for the Wireshark memberlist plugin to consume, configured using an environment variable.
Screenshots
- How to verify it
NETWORKDBKEYLOGFILE=path/to/ndbkeys.txt dockerdnetworkdb.keylog:path/to/ndbkeys.txt- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)