Skip to content

Commit

Permalink
Unit test for fd.net + in operator fixes
Browse files Browse the repository at this point in the history
Tests fix for #339. Depends on
draios/sysdig#1091.
  • Loading branch information
mstemm committed Apr 2, 2018
1 parent 559240b commit ffe8e45
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/falco_tests.yaml
Expand Up @@ -663,4 +663,11 @@ trace_files: !mux
rules_file:
- rules/rule_append.yaml
trace_file: trace_files/cat_write.scap
stdout_contains: "^(?!.*Warning An open of /dev/null was seen.*)"
stdout_contains: "^(?!.*Warning An open of /dev/null was seen.*)"

in_operator_netmasks:
detect: True
detect_level: INFO
rules_file:
- rules/detect_connect_using_in.yaml
trace_file: trace_files/connect_localhost.scap
6 changes: 6 additions & 0 deletions test/rules/detect_connect_using_in.yaml
@@ -0,0 +1,6 @@
- rule: Localhost connect
desc: Detect any connect to the localhost network, using fd.net and the in operator
condition: evt.type=connect and fd.net in ("127.0.0.1/24")
output: Program connected to localhost network
(user=%user.name command=%proc.cmdline connection=%fd.name)
priority: INFO
Binary file added test/trace_files/connect_localhost.scap
Binary file not shown.

0 comments on commit ffe8e45

Please sign in to comment.