@@ -88,17 +88,21 @@ func (netMonitor *NetworkMonitor) handlePacket(attrs nflog.Attribute) {
8888 // Get actual TCP data from this layer
8989 ipv4 , _ := ipv4Layer .(* layers.IPv4 )
9090 netMonitor .netMutex .Lock ()
91- _ , found := ipAddresses [ipv4 .DstIP .String ()]
91+ ipv4Address := ipv4 .DstIP .String ()
92+ _ , found := ipAddresses [ipv4Address ]
9293 if ! found {
93- ipAddresses [ipv4 . DstIP . String () ] = 1
94+ ipAddresses [ipv4Address ] = 1
9495
9596 if isSYN {
9697 netMonitor .ApiClient .sendNetConnection (netMonitor .CorrelationId , netMonitor .Repo ,
97- ipv4 . DstIP . String () , port , netMonitor .Status , timestamp , Tool {Name : Unknown , SHA256 : Unknown })
98+ ipv4Address , port , netMonitor .Status , timestamp , Tool {Name : Unknown , SHA256 : Unknown })
9899
99100 if netMonitor .Status == "Dropped" {
100- go WriteLog (fmt .Sprintf ("ip address dropped: %s" , ipv4 .DstIP .String ()))
101- go WriteAnnotation (fmt .Sprintf ("Traffic to IP Address %s was blocked" , ipv4 .DstIP .String ()))
101+ go WriteLog (fmt .Sprintf ("ip address dropped: %s" , ipv4Address ))
102+
103+ if ipv4Address != StepSecuritySinkHoleIPAddress { // Sinkhole IP address will be covered by DNS block
104+ go WriteAnnotation (fmt .Sprintf ("Traffic to IP Address %s was blocked" , ipv4Address ))
105+ }
102106 }
103107 }
104108 }
0 commit comments