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

Issue 7357 v2 #2202

Open
wants to merge 3 commits 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
15 changes: 15 additions & 0 deletions tests/filestore-v2.10-wrong-direction/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
- stats
- alert
- file-store:
version: 2
enabled: yes
stream-depth: 0
write-fileinfo: true
2 changes: 2 additions & 0 deletions tests/filestore-v2.10-wrong-direction/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert http any any -> any any (msg:"alert png images"; http.uri; content:".png"; nocase; sid:1; rev:1;)
alert http any any -> any any (msg:"store png images"; http.uri; content:".png"; nocase; filestore; sid:2; rev:1;)
25 changes: 25 additions & 0 deletions tests/filestore-v2.10-wrong-direction/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pcap: ../filestore-filecontainer-http/filecontainer-http.pcap

requires:
min-version: 8

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 0
match:
event_type: fileinfo
fileinfo.stored: true
- filter:
count: 11
match:
event_type: fileinfo
15 changes: 15 additions & 0 deletions tests/filestore-v2.11-with-option/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
- stats
- alert
- file-store:
version: 2
enabled: yes
stream-depth: 0
write-fileinfo: true
2 changes: 2 additions & 0 deletions tests/filestore-v2.11-with-option/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert http any any -> any any (msg:"alert png images"; http.uri; content:".png"; nocase; sid:1; rev:1;)
alert http any any -> any any (msg:"store png images"; http.uri; content:".png"; nocase; filestore:to_client,flow; sid:2; rev:1;)
21 changes: 21 additions & 0 deletions tests/filestore-v2.11-with-option/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pcap: ../filestore-filecontainer-http/filecontainer-http.pcap

requires:
min-version: 8

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.stored: true
15 changes: 15 additions & 0 deletions tests/filestore-v2.12-with-option/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
- stats
- alert
- file-store:
version: 2
enabled: yes
stream-depth: 0
write-fileinfo: true
2 changes: 2 additions & 0 deletions tests/filestore-v2.12-with-option/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert http any any -> any any (msg:"alert png images"; http.uri; content:".png"; nocase; sid:1; rev:1;)
alert http any any -> any any (msg:"store png images"; http.uri; content:".png"; nocase; filestore:to_client,tx; sid:2; rev:1;)
21 changes: 21 additions & 0 deletions tests/filestore-v2.12-with-option/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pcap: ../filestore-filecontainer-http/filecontainer-http.pcap

requires:
min-version: 8

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.stored: true
5 changes: 5 additions & 0 deletions tests/filestore-v2.13-filedata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The pcap file contains 3 HTTP requests:
- GET on /toto url
- POST on /toto url with toto content
- POST on /toto url with tata content

15 changes: 15 additions & 0 deletions tests/filestore-v2.13-filedata/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
- stats
- alert
- file-store:
version: 2
enabled: yes
stream-depth: 0
write-fileinfo: true
1 change: 1 addition & 0 deletions tests/filestore-v2.13-filedata/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any (http.uri; content: "toto"; filestore; file.data; content: "tata"; sid:1;)
12 changes: 12 additions & 0 deletions tests/filestore-v2.13-filedata/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
requires:
min-version: 8

args:
- -k none

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1
Binary file added tests/filestore-v2.13-filedata/toto.pcap
Binary file not shown.
Loading