Skip to content

Commit

Permalink
test: add test for vlan.id
Browse files Browse the repository at this point in the history
Ticket: #1065
  • Loading branch information
AkakiAlice committed Nov 22, 2024
1 parent b195d4b commit b74d68f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/detect-vlan-id/README.md
Original file line number Diff line number Diff line change
@@ -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.
Binary file added tests/detect-vlan-id/input.pcap
Binary file not shown.
3 changes: 3 additions & 0 deletions tests/detect-vlan-id/test.rules
Original file line number Diff line number Diff line change
@@ -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;)
22 changes: 22 additions & 0 deletions tests/detect-vlan-id/test.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b74d68f

Please sign in to comment.