diff --git a/tests/detect-vlan-id/README.md b/tests/detect-vlan-id/README.md new file mode 100644 index 000000000..0c097ef2c --- /dev/null +++ b/tests/detect-vlan-id/README.md @@ -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. diff --git a/tests/detect-vlan-id/input.pcap b/tests/detect-vlan-id/input.pcap new file mode 100644 index 000000000..35ee79b95 Binary files /dev/null and b/tests/detect-vlan-id/input.pcap differ diff --git a/tests/detect-vlan-id/test.rules b/tests/detect-vlan-id/test.rules new file mode 100644 index 000000000..0f87b132e --- /dev/null +++ b/tests/detect-vlan-id/test.rules @@ -0,0 +1,3 @@ +alert ip any any -> any any (msg:"Vlan ID is equal to 200 with especific layer"; vlan.id:200,1; sid:1;) +alert ip any any -> any any (msg:"Vlan ID is equal to 300 with explicit 'any' layer "; vlan.id:300,any; sid:2;) +alert ip any any -> any any (msg:"Vlan ID is equal to 400"; vlan.id:300; sid:3;) diff --git a/tests/detect-vlan-id/test.yaml b/tests/detect-vlan-id/test.yaml new file mode 100644 index 000000000..db32cdb7f --- /dev/null +++ b/tests/detect-vlan-id/test.yaml @@ -0,0 +1,22 @@ +requires: + min-version: 8 + +args: +- -k none + +checks: +- filter: + count: 1 + match: + event_type: alert + alert.signature_id: 1 +- filter: + count: 1 + match: + event_type: alert + alert.signature_id: 2 +- filter: + count: 1 + match: + event_type: alert + alert.signature_id: 3