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/flowvar: adds test for flowvar persistence #1999

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
12 changes: 12 additions & 0 deletions tests/detect-flowvar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Test
====

Test flow variable functionality

https://redmine.openinfosecfoundation.org/issues/7197

PCAP
====

Pcap crafted with some http server and some python client that delays or not the writing of the headers

Binary file added tests/detect-flowvar/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/detect-flowvar/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any ( sid: 1; http.uri; content: "param"; fast_pattern; pcre: "/param=(.*)/,flow:paramval"; http.request_header; content: "Header1";)
20 changes: 20 additions & 0 deletions tests/detect-flowvar/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
requires:
min-version: 8

args:
- -k none

checks:
- filter:
# we should get twice the extracted flowvar
count: 2
match:
event_type: alert
alert.signature_id: 1
metadata.flowvars[0].paramval: value
- filter:
# we have twice the same data in 2 flows, rule matches twice and it is ok
count: 2
match:
event_type: alert
alert.signature_id: 1
Loading