Skip to content

detect: add test for vlan keywords - v11#2222

Merged
victorjulien merged 2 commits intoOISF:masterfrom
AkakiAlice:detect-vlan-1065-v11
Jan 14, 2025
Merged

detect: add test for vlan keywords - v11#2222
victorjulien merged 2 commits intoOISF:masterfrom
AkakiAlice:detect-vlan-1065-v11

Conversation

@AkakiAlice
Copy link
Contributor

@AkakiAlice AkakiAlice commented Jan 8, 2025

Ticket: #1065

Description:

  • Add Suricata-Verify test for vlan.id and vlan.layers

Changes:

  • remove count tests from detect-vlan-id dir
  • create new dir detect-vlan-layers and add tests for vlan.layers keyword
  • rename branch from detect-vlan-id-1065-v11 to detect-vlan-v11

Redmine ticket: https://redmine.openinfosecfoundation.org/issues/1065

Previous PR: #2208
Suricata PR: OISF/suricata#12374

Copy link
Collaborator

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Good tests for the suricata PR

@catenacyber
Copy link
Collaborator

You just rebased this SV branch, right ?

alert ip any any -> any any (msg:"Packet has 3 VLAN layers"; vlan.layers:3; sid:1;)
alert ip any any -> any any (msg:"Packet has more than 2 VLAN layers"; vlan.layers:>2; sid:2;)
alert ip any any -> any any (msg:"The number of layers in the packet is not 1"; vlan.layers:!1; sid:3;)
alert ip any any -> any any (msg:"Packet has 0 VLAN layers"; vlan.layers:0; sid:4;) No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

so this means no vlan in the packet at all, right?

Can we use the keyword to test for vlan?
vlan.layers:0 meaning no vlan in packet
vlan.layers:>0 meaning there is a vlan header in the packet?

Copy link
Collaborator

Choose a reason for hiding this comment

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

so this means no vlan in the packet at all, right?

Yes

Can we use the keyword to test for vlan? vlan.layers:0 meaning no vlan in packet vlan.layers:>0 meaning there is a vlan header in the packet?

Indeed, how do you like it ?

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense to me.

@AkakiAlice AkakiAlice force-pushed the detect-vlan-1065-v11 branch from 1600a4f to 41a2c6b Compare January 13, 2025 16:04
@AkakiAlice
Copy link
Contributor Author

just rebased

Copy link
Collaborator

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Approving the rebased version

@victorjulien victorjulien self-requested a review January 13, 2025 18:34
@victorjulien victorjulien merged commit 41a2c6b into OISF:master Jan 14, 2025
6 of 10 checks passed
@victorjulien
Copy link
Member

Merged in #2235, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants