Skip to content

Commit

Permalink
tests/decode: Verify unknown ethertype event
Browse files Browse the repository at this point in the history
Issue: 7129
  • Loading branch information
jlucovsky committed Oct 1, 2024
1 parent 3be0daf commit 09abe76
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/decode-unknown-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This test is for pre-8.0 deployments.

In 8.0, an event is generated when an unknown ethertype is encountered.
1 change: 1 addition & 0 deletions tests/decode-unknown-1/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
requires:
min-version: 7
lt-version: 8

args:
- -k none
Expand Down
15 changes: 15 additions & 0 deletions tests/decode-unknown-2/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
filename: eve.json
filetype: regular
ethernet: yes
types:
- anomaly:
types:
decode: yes
- stats:
totals: yes
1 change: 1 addition & 0 deletions tests/decode-unknown-2/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert udp any any -> any any (content:"data|0a 0a|"; startswith; endswith; sid:1;)
23 changes: 23 additions & 0 deletions tests/decode-unknown-2/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
requires:
min-version: 8

args:
- -k none

pcap: ../decode-unknown-1/input.pcap

checks:
- filter:
count: 1
match:
event_type: stats
- stats:
decoder.ethernet: 1
decoder.unknown_ethertype: 1
- filter:
count: 1
match:
event_type: anomaly
ether.ether_type: 47099
anomaly.type: decode
anomaly.event: decoder.ethernet.unknown_ethertype

0 comments on commit 09abe76

Please sign in to comment.