Add typed host event egress rule
This commit is contained in:
parent
0b010df514
commit
3b037646d2
15 changed files with 360 additions and 31 deletions
|
|
@ -71,9 +71,21 @@ class TestRuleEventCompatibility(unittest.TestCase):
|
|||
}
|
||||
self.assertIn(100061, self._sids(event))
|
||||
|
||||
def test_host_event_accepts_tcp_connect_shape(self):
|
||||
event = {
|
||||
"event": "tcp_connect",
|
||||
"pid": "4242",
|
||||
"ppid": "1",
|
||||
"uid": "1000",
|
||||
"comm": "python3",
|
||||
"remote_ip": "8.8.8.8",
|
||||
"remote_port": "4444",
|
||||
}
|
||||
self.assertIn(100067, self._sids(event))
|
||||
|
||||
def test_unknown_event_shape_still_errors(self):
|
||||
with self.assertRaisesRegex(
|
||||
ValueError, "event JSON must be an exec or syscall event"
|
||||
ValueError, "event JSON must be an exec, syscall, or host event"
|
||||
):
|
||||
ruleops.test_event(self.cfg, {"pid": 4242})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue