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

detect/integers: test enum with negated strings - v1 #2250

Closed
wants to merge 1 commit into from
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
7 changes: 7 additions & 0 deletions tests/detect-uint-enum/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Test for checking the working of function detect_parse_uint_enum
when passing negated strings.


PCAP from ../websocket-ping/input.pcap

redmine ticket: https://redmine.openinfosecfoundation.org/issues/7513
2 changes: 2 additions & 0 deletions tests/detect-uint-enum/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert websocket any any -> any any (msg:"There is no pong opcode in this packet"; websocket.opcode:!pong; sid:1;)
alert websocket any any -> any any (msg:"There is no ping opcode in this packet"; websocket.opcode:!ping; sid:2;)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you should just reuse the existing websocket-ping test, and add these rules to it

19 changes: 19 additions & 0 deletions tests/detect-uint-enum/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
requires:
min-version: 8

pcap: ../websocket-ping/input.pcap

args:
- -k none --set stream.inline=true

checks:
- filter:
count: 1
match:
event_type: alert
Copy link
Collaborator

Choose a reason for hiding this comment

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

test the webscoket.opcode and comment pong is not ping

pcap_cnt: 8
- filter:
count: 1
match:
event_type: alert
pcap_cnt: 11
Loading