Skip to content

Commit

Permalink
detect: adds check for decode-event with prefilter
Browse files Browse the repository at this point in the history
Ticket: 6728
  • Loading branch information
catenacyber committed Jul 26, 2024
1 parent 8ce08a9 commit 4e4dafd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/decode-too-small/test.rules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
alert tcp any any -> any any (msg:"TCP packet too small"; decode-event:tcp.pkt_too_small; sid:1;)
alert tcp any any -> any any (msg:"TCP packet too small"; decode-event:tcp.pkt_too_small; prefilter; requires: version >= 8; sid:1; rev: 2;)
alert udp any any -> any any (msg:"UDP packet too small"; decode-event:udp.hlen_too_small; sid:2;)
alert ip any any -> any any (msg:"GRE packet too small"; decode-event:gre.pkt_too_small; sid:3;)
12 changes: 12 additions & 0 deletions tests/decode-too-small/test.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
requires:
min-version: 7

checks:
# Look for IPv4 TCP too small
- filter:
Expand All @@ -7,6 +10,15 @@ checks:
src_ip: 1.1.1.1
alert.signature_id: 1

- filter:
min-version: 8
count: 1
match:
event_type: alert
src_ip: 1.1.1.1
alert.signature_id: 1
alert.rev: 2

# Look for IPv6 TCP too small
- filter:
count: 1
Expand Down

0 comments on commit 4e4dafd

Please sign in to comment.