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

Filestore 6388 v3 #1427

Closed
wants to merge 2 commits 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
12 changes: 12 additions & 0 deletions tests/filestore-dont/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Description

Test filestore does not store too much

# Ticket

https://redmine.openinfosecfoundation.org/issues/6388
https://redmine.openinfosecfoundation.org/issues/6390

# PCAP

The pcap was manually crafted to have HTTP/1 pipelining POST request with multipart files when the first response is not over
Binary file added tests/filestore-dont/input.pcap
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/filestore-dont/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
types:
- files
- alert
- http
- file-store:
version: 2
enabled: yes
force-filestore: no
stream-depth: 0
1 change: 1 addition & 0 deletions tests/filestore-dont/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any (msg:"FILE HTTP filtore"; http.uri; content: "pipeline"; filestore:both,flow; sid:2; rev:1;)
12 changes: 12 additions & 0 deletions tests/filestore-dont/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
requires:
min-version: 6
features:
- HAVE_NSS

args:
- -k none

checks:
- shell:
# if there is this file hash, it must have the full 2048 bytes content
args: not test -e output//filestore/eb/eb076a2ec6ced9ee2e823e098446513cf5b2bb60fbcb04e6c85dc23dedaa414a || ( wc -c output//filestore/eb/eb076a2ec6ced9ee2e823e098446513cf5b2bb60fbcb04e6c85dc23dedaa414a | grep 2048 )
8 changes: 8 additions & 0 deletions tests/filestore-response/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Description

Test filestore stores all files with one direction

# Ticket

https://redmine.openinfosecfoundation.org/issues/6388
https://redmine.openinfosecfoundation.org/issues/6392
Binary file added tests/filestore-response/input.pcap
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/filestore-response/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
%YAML 1.1
---

outputs:
- eve-log:
enabled: yes
types:
- files
- alert
- http
- file-store:
version: 2
enabled: yes
force-filestore: no
stream-depth: 0
1 change: 1 addition & 0 deletions tests/filestore-response/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any (msg:"FILE HTTP filtore"; file.data; content: "123456789abcdef"; filestore:response,flow; sid:2; rev:1;)
26 changes: 26 additions & 0 deletions tests/filestore-response/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
requires:
min-version: 6
features:
- HAVE_NSS

args:
- -k none

checks:
- filter:
count: 1
match:
app_proto: http
event_type: fileinfo
fileinfo.sha256: eb076a2ec6ced9ee2e823e098446513cf5b2bb60fbcb04e6c85dc23dedaa414a
fileinfo.stored: true
count: 1
match:
app_proto: http
event_type: fileinfo
fileinfo.sha256: a87f126892a71279399ddda2dab8bbe1fcc6681b051c506e95294e71f639af72
fileinfo.stored: true
count: 1
match:
event_type: alert
alert.signature_id: 2