Passthrough implementation#185
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new “passthrough” rule type that proxies TCP connections between clients and real targets, logging bidirectional traffic.
- Adds
Passthroughto the rule enum and exposesRuleType - Implements
HandlePassThroughinprotocols/tcp/passthrough.gowith two goroutines for source→target and target→source streaming - Registers the new handler in
protocols/protocols.goand adds a sample rule inconfig/rules.yaml
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| rules/rules.go | Export RuleType, add Passthrough constant and init case |
| protocols/tcp/passthrough.go | New handler to proxy TCP streams and log data |
| protocols/protocols.go | Register "passthrough" handler |
| config/rules.yaml | Add sample passthrough rule |
Comments suppressed due to low confidence (2)
protocols/tcp/passthrough.go:26
- [nitpick] The comment is unclear and contains informal shorthand ('w/o', 'w it'). Consider rephrasing to explain the function’s purpose clearly, e.g., “HandlePassThrough opens a TCP connection to the real target and proxies traffic bidirectionally without modifying payloads.”
// Dial to the source ip, acting as a proxy between the client and real source by piping the data back and forth w/o interfering w it.
protocols/tcp/passthrough.go:1
- The new passthrough handler doesn’t have any associated unit or integration tests. Adding tests would help ensure correct proxy behavior under various scenarios and catch regressions.
package tcp
|
Made traffic capture configurable via config.yaml. You can now enable or disable payload capturing by toggling the |
glaslos
left a comment
There was a problem hiding this comment.
Some minor comments. Did you consider adding some tests?
|
@glaslos Just for the info, here is a summary of our last two meetings: Mid-term Review Meeting Minutes: July Week 5 Sync: |
|
In the latest commit : Also, I have tested the passthrough implementation with various protocols (SMTP, SSH etc). I will be writing some more tests to increase the code coverage. cc. @glaslos @furusiyya |
|
@furusiyya what is needed to get this over the finish line? In case @namay26 is not available anymore, I can get the PR ready to be merged. |
Resolves #172 :
Adds a passthrough handler, which acts like a proxy and sets up two go routines to listen to and log the information passed between the client and the destination.