Conversation
Allows for quickly checking if sig operates on frames during parsing.
Make `Signature::proto` an optional member, meaning that if it is NULL we can skip the check. This can be done for `alert ip`, as no check is needed, and for `alert tcp` and `alert udp` as having a rule in a sgh for those means that the protocol matches. Some exceptions are rules that require: - ipv4/ipv6 specific matching - frames, due to sharing prefilter between tcp and udp - ip-only rules, due to those not being per sgh
Support `alert ether` for matching all ethernet packets. Add `alert arp` for matching ARP packets. Ticket: OISF#8313.
Sticky buffer to inspect the ethernet header.
Example rule:
alert ether any any -> any any ( \
ether.hdr; content:"|08 06|"; offset:12; depth:2; \
sid:1;)
Ticket: OISF#8327.
To indicate it's not just like `alert ip`.
`alert pkthdr` was initially just an alias for `alert ip`, as that was really just a way of stating that "any" should be matched. However with the Ethernet matching in place, it no long makes sense to treat `alert ip` as "any". Since `pkthdr` is used to match on decoder events, also for packets that completely failed to parse, it should no longer be treated as `alert ip` but rather as it's own distinct logic.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15079 +/- ##
========================================
Coverage 82.59% 82.60%
========================================
Files 990 992 +2
Lines 271761 271916 +155
========================================
+ Hits 224465 224609 +144
- Misses 47296 47307 +11
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
WARNING:
Pipeline = 30462 |
jufajardini
left a comment
There was a problem hiding this comment.
Looks good, from my perspective.
The pkthdr info made me wonder if something on this alias aspect should be added to the 80x docs, but not sure.
|
|
||
| Up until Suricata 8 this protocol was an alias for `alert ip`, but in Suricata 9 it | ||
| is only to be used in decoder event rules. | ||
|
|
jasonish
left a comment
There was a problem hiding this comment.
Functionally seems OK, I tested the arp passing on an AFP firewall.
This should probably get documented sooner than later though.
One observation: "alert ether" rules.. They don't have much context, not even the ethernet address. Would it be odd to enable ethernet header logging automatically on such rules?
Was thinking about doing it more generically: if we're in bridge mode (IPS/fw), enable it by default. |
Yes, I think that makes sense. At least its how I would like it. |
|
|
replaced by #15108 |
SV_BRANCH=OISF/suricata-verify#2953
#15029 rebased, with
eth.hdrrenamed toether.hdr.