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 Dec 11, 2024
1 parent 4a9d6ad commit 0f99e37
Show file tree
Hide file tree
Showing 4 changed files with 24 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.
2 changes: 2 additions & 0 deletions tests/detect-vlan-id/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert ip any any -> any any (msg:"Vlan ID is equal to 200 with specific layer"; vlan.id:200,1; sid:1;)
alert ip any any -> any any (msg:"Vlan ID is equal to 400"; vlan.id:400; sid:2;)
19 changes: 19 additions & 0 deletions tests/detect-vlan-id/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
requires:
min-version: 8

args:
- -k none

checks:
- filter:
count: 1
match:
event_type: alert
vlan[0]: 200
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
vlan[2]: 400
alert.signature_id: 2

0 comments on commit 0f99e37

Please sign in to comment.