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

File data loggging #2113

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
20 changes: 20 additions & 0 deletions tests/eve-alert-file_data/suricata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
%YAML 1.1
---

include: ../../etc/suricata-4.0.3.yaml

# Configure the type of alert (and other) logging you would like.
outputs:
- eve-log:
enabled: yes
filetype: regular
filename: eve.json

# Enable to disable top-level metadata logging. Default: yes.
#metadata: no

types:
- alert:
file-data: yes
payload-buffer-size: 50
- files
1 change: 1 addition & 0 deletions tests/eve-alert-file_data/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any (msg:"TEST"; flow:established,to_client; file.data; content:"|50 4E 47|"; sid:1; rev:1;)
15 changes: 15 additions & 0 deletions tests/eve-alert-file_data/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pcap: ../filestore-filecontainer-http/filecontainer-http.pcap

args:
- -k none

requires:
script:
- grep LOG_JSON_FILE_DATA src/output-json-alert.c > /dev/null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this requires ?


checks:
- filter:
count: 1
match:
event_type: alert
files[0].data: iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAGXRFWHRTb2Z0d2FyZQA=
7 changes: 4 additions & 3 deletions tests/filestore-v2.7-stream-depth/suricata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ outputs:
enabled: yes
types:
- files
- stream:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jasonish should we error on suricata.yaml having an unknown outputs section such as stream ?

reassembly:
depth: 1000
- file-store:
version: 2
enabled: yes
force-filestore: yes
stream-depth: 100000

stream:
reassembly:
depth: 1000
Loading