-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for tapping into TPM communication #515
base: master
Are you sure you want to change the base?
Conversation
tcpLayer.SrcPort = layers.TCPPort(2321) | ||
tcpLayer.DstPort = layers.TCPPort(50001) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look too much into this PR, but we probably want to move these ports customizable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but that wouldn't change much functionally. The PCAP is used just as a container in this case; we're not actually capturing traffic from/to those ports. The bytes read from and written to the TPM device are "massaged into network packets", so to say.
This PR adds support for tapping into all communication to and from the TPM. It's currently only supported on Linux.
A couple concrete implementations of taps are provided too, incl. one that writes binary data by simply writing all reads and writes to a single
io.Writer
, and one that writes inpcapng
format. The binary tap is compatible with https://github.com/joholl/tpmstream, and the output of thepcapng
tap can be inspected using Wireshark (or compatible tooling).Example output: