Skip to content

Commit

Permalink
fix: add "" case for user.name
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <[email protected]>
  • Loading branch information
Andreagit97 authored and poiana committed Apr 29, 2024
1 parent e8eaf0a commit 4c71962
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/data/rules/legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,7 @@ var LegacyFalcoRules_v1_0_1 = run.NewStringFileAccessor(
# https://github.com/draios/sysdig/issues/954). So in that case, allow
# a setuid.
- macro: known_user_in_container
condition: (container and not user.name in ("<NA>","N/A"))
condition: (container and not user.name in ("<NA>","N/A",""))
# Add conditions to this macro (probably in a separate file,
# overwriting this macro) to allow for specific combinations of
Expand Down
4 changes: 1 addition & 3 deletions tests/falco/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2628,9 +2628,7 @@ func TestFalco_Legacy_NonSudoSetuid(t *testing.T) {
falco.WithArgs("-o", "json_include_output_property=false"),
falco.WithArgs("-o", "json_include_tags_property=false"),
)
assert.NotZero(t, res.Detections().Count())
assert.NotZero(t, res.Detections().OfPriority("NOTICE").Count())
assert.Equal(t, 1, res.Detections().OfRule("Non sudo setuid").Count())
assert.Zero(t, res.Detections().Count())
assert.NoError(t, res.Err(), "%s", res.Stderr())
assert.Equal(t, 0, res.ExitCode())
}
Expand Down

0 comments on commit 4c71962

Please sign in to comment.