Conversation
48117a3 to
bac0693
Compare
| alert ip any any -> any any (msg:"VLAN ID at layer 1 is less than 400"; vlan.id:<400,1; sid:8;) | ||
| alert ip any any -> any any (msg:"One Vlan ID is greater than or equal to 200"; vlan.id:>=0xC8; sid:9;) | ||
| alert ip any any -> any any (msg:"All the Vlan IDs are greater than 100"; vlan.id:>100,all; sid:10;) | ||
| alert ip any any -> any any (msg:"Packet has 3 VLAN layers"; vlan.id:3,count; sid:11;) No newline at end of file |
There was a problem hiding this comment.
This PR is really fine.
You could also add prefilter in some signatures, like vlan.id:>100,all; prefilter;
You could also add a signature with vlan.id:0,count; and a packet without vlan
catenacyber
left a comment
There was a problem hiding this comment.
Good for me even if we can always test more
jufajardini
left a comment
There was a problem hiding this comment.
As Philippe mentioned, very good work 👏🏽
I do think we should take advantage of this moment to add the rule checks that we think would make the test more complete (the ones suggested by Philippe).
My comments are just to refine an already great job :)
| #! /usr/bin/env python3 | ||
| from scapy.all import * |
There was a problem hiding this comment.
Can we also have the scapy version as a comment here in the script? Makes it easier to not lose the information :)
| @@ -0,0 +1,3 @@ | |||
| Test for checking the working of vlan.id keyword by creating rules and matching a crafted packet against them. The packet is an ICMP packet with 3 different VLAN ids [200,300,400]. | |||
There was a problem hiding this comment.
As with the docs, these look better if we keep lines to a certain character count limit.
Let's try around 79 or 80?
| @@ -0,0 +1,3 @@ | |||
| Test for checking the working of vlan.id keyword by creating rules and matching a crafted packet against them. The packet is an ICMP packet with 3 different VLAN ids [200,300,400]. | |||
|
|
|||
| PCAP created with scapy 2.5.0. | |||
There was a problem hiding this comment.
Could you add the redmine ticket link reference here?
Ticket: #1065
Description:
test.rules changes:
vlan.id:!500;tovlan.id:!500,all;: line 6count: line 11test.yaml changes:
countrule : line 62Redmine ticket: https://redmine.openinfosecfoundation.org/issues/1065
Previous PR: #2188
Suricata PR: OISF/suricata#12301