Skip to content

Commit

Permalink
tests: assert that tags are supported
Browse files Browse the repository at this point in the history
Signed-off-by: Djalal Harouni <[email protected]>
  • Loading branch information
tixxdz committed Mar 28, 2024
1 parent 03b5227 commit 89eaf57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sensors/tracing/kprobe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6159,6 +6159,7 @@ spec:
syscall: false
return: true
message: "Access sensitive files /etc/passwd"
tags: [ "observability.filesystem" ]
args:
- index: 0
type: "file" # (struct file *) used for getting the path
Expand All @@ -6182,6 +6183,7 @@ spec:
syscall: false
return: true
message: "Access sensitive files /etc/shadow"
tags: [ "observability.filesystem" ]
args:
- index: 0
type: "file" # (struct file *) used for getting the path
Expand Down Expand Up @@ -6228,6 +6230,7 @@ spec:

kpCheckersRead := ec.NewProcessKprobeChecker("").
WithMessage(sm.Full("Access sensitive files /etc/passwd")).
WithTags(ec.NewStringListMatcher().WithValues(sm.Full("observability.filesystem"))).
WithFunctionName(sm.Full("security_file_permission")).
WithArgs(ec.NewKprobeArgumentListMatcher().
WithOperator(lc.Ordered).
Expand All @@ -6238,6 +6241,7 @@ spec:

kpCheckersMmap := ec.NewProcessKprobeChecker("").
WithMessage(sm.Full("Access sensitive files /etc/shadow")).
WithTags(ec.NewStringListMatcher().WithValues(sm.Full("observability.filesystem"))).
WithFunctionName(sm.Full("security_mmap_file")).
WithArgs(ec.NewKprobeArgumentListMatcher().
WithOperator(lc.Ordered).
Expand Down

0 comments on commit 89eaf57

Please sign in to comment.