feat: add source ip and source port (#126)

add source ip and source port
This commit is contained in:
Mario Candela
2024-08-30 08:28:56 +02:00
committed by GitHub
parent fa472effb9
commit 0b5486964b
4 changed files with 22 additions and 1 deletions

View File

@ -35,12 +35,16 @@ func (tcpStrategy *TCPStrategy) Init(beelzebubServiceConfiguration parser.Beelze
command = string(buffer[:n])
}
host, port, _ := net.SplitHostPort(conn.RemoteAddr().String())
tr.TraceEvent(tracer.Event{
Msg: "New TCP attempt",
Protocol: tracer.TCP.String(),
Command: command,
Status: tracer.Stateless.String(),
RemoteAddr: conn.RemoteAddr().String(),
SourceIp: host,
SourcePort: port,
ID: uuid.New().String(),
Description: beelzebubServiceConfiguration.Description,
})