Skip to content

Commit bb5bb07

Browse files
roikolrafaeldtinoco
authored andcommitted
signature: use socket_dup event instead of dup(s) syscalls in stdio_over_socket.go
1 parent 6a0f8a3 commit bb5bb07

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

signatures/golang/export.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import "github.com/aquasecurity/tracee/types/detect"
55
// ExportedSignatures fulfills the goplugins contract required by the rule-engine
66
// this is a list of signatures that this plugin exports
77
var ExportedSignatures = []detect.Signature{
8-
&stdioOverSocket{},
8+
&StdioOverSocket{},
99
&K8sApiConnection{},
1010
&AslrInspection{},
1111
&DroppedExecutable{},

signatures/golang/stdio_over_socket_test.go

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func TestStdioOverSocket(t *testing.T) {
187187
Findings: map[string]detect.Finding{},
188188
},
189189
{
190-
Name: "should not trigger detection - socket_dup legit port",
190+
Name: "should not trigger detection - socket_dup wrong FD",
191191
Events: []trace.Event{
192192
{
193193
EventName: "socket_dup",
@@ -198,6 +198,29 @@ func TestStdioOverSocket(t *testing.T) {
198198
},
199199
Value: int32(3),
200200
},
201+
{
202+
ArgMeta: trace.ArgMeta{
203+
Name: "remote_addr",
204+
},
205+
Value: map[string]string{"sa_family": "AF_INET", "sin_port": "53", "sin_addr": "10.225.0.2"},
206+
},
207+
},
208+
},
209+
},
210+
Findings: map[string]detect.Finding{},
211+
},
212+
{
213+
Name: "should not trigger detection - socket_dup legit port",
214+
Events: []trace.Event{
215+
{
216+
EventName: "socket_dup",
217+
Args: []trace.Argument{
218+
{
219+
ArgMeta: trace.ArgMeta{
220+
Name: "newfd",
221+
},
222+
Value: int32(1),
223+
},
201224
{
202225
ArgMeta: trace.ArgMeta{
203226
Name: "remote_addr",

0 commit comments

Comments
 (0)