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: add test for alert-then-pass issue 5466 #1579

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
Binary file not shown.
21 changes: 21 additions & 0 deletions tests/issue-5466-alert-then-pass-01/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
%YAML 1.1
---

action-order:
- pass
- drop
- reject
- alert

outputs:
- eve-log:
enabled: yes
filetype: regular
types:
- alert
- drop:
flows: all
alerts: yes
- files
- http
- flow
2 changes: 2 additions & 0 deletions tests/issue-5466-alert-then-pass-01/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pass tcp any any -> any 22 (alert; sid:2; gid:10000003; msg:"PASS SSH";)
drop tcp any any -> any any (noalert; sid:1; rev:1; msg:"DROP all TCP";)
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

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

The sid vs signature order here is sneaky xD

Copy link
Member Author

Choose a reason for hiding this comment

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

hehe yeah, just copied and updated the 4663-03 test, so came from there :)

33 changes: 33 additions & 0 deletions tests/issue-5466-alert-then-pass-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
requires:
min-version: 8

args:
- --simulate-ips
- -k none

checks:
- filter:
count: 0
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
alert.signature: "PASS SSH"
- filter:
count: 0
match:
event_type: drop
- filter:
count: 2
match:
event_type: flow
- filter:
min-version: 7
count: 1
match:
event_type: flow
flow.action: pass
Loading