Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/decode: Verify unknown ethertype event #1954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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/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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this ? (deserves a comment maybe)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add a readme file for this test explaining things.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unresolving until a README is added then


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

Choose a reason for hiding this comment

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

do we have the unknown ether type logged ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the unknown value is not logged

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm... How could we get it ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess pcap logging would be one way to get it...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is not ether.ether_type: 47099 what we want ?

Loading