Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit typo especific

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;)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msg:"Vlan ID is equal to 400"; vlan.id:300;

These do not seem to match...

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we check the vlan id in the alert data ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't understand the question. Could you be more specific, please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we we add in this match section a check about vlan.id: 200 ? (with the good syntax and value)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Should I use these other commits as examples for the implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

schema.json tells me that it should be vlan[0]: 200

- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 3