Skip to content
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
Binary file added tests/ftp-mimetype-detection/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/ftp-mimetype-detection/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert ftp-data any any -> any any (msg:"MIME Type Test"; file.mime_type; content:"pdf"; sid:1338; rev:1;)
19 changes: 19 additions & 0 deletions tests/ftp-mimetype-detection/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
requires:
features:
- HAVE_MIMETYPE
Copy link
Collaborator

Choose a reason for hiding this comment

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

@jasonish seeing green CI for this highlights that we need SV coverage ;-)

Copy link
Member

Choose a reason for hiding this comment

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

Please elaborate? What would this look like?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You seemed to have more ideas than me.

I was just saying that manual runs should be done for releases to ensure that every SV test/check is run.
You were saying that there were tools to do that ;-)

Copy link
Member

@jasonish jasonish Jul 22, 2025

Choose a reason for hiding this comment

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

No tools that I know of. I think Victor put out a wish directed my way that tools exist, to which I had no comment :)


# disables checksum verification
args:
- -k none --runmode=single --set outputs.1.eve-log.types.6.files.force-mimetype=yes

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1338
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we could check that the alert event has the mimetype

- filter:
count: 1
match:
event_type: fileinfo
fileinfo.mimetype: application/pdf
Binary file added tests/http-mimetype-detection/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/http-mimetype-detection/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert http any any -> any any (msg:"MIME Type Test"; file.mime_type; content:"png"; sid:1337; rev:1;)
19 changes: 19 additions & 0 deletions tests/http-mimetype-detection/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
requires:
features:
- HAVE_MIMETYPE

# disables checksum verification
args:
- -k none --set outputs.1.eve-log.types.6.files.force-mimetype=yes

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1337
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.mimetype: image/png
Binary file added tests/smb-mimetype-detection/input.pcap
Binary file not shown.
2 changes: 2 additions & 0 deletions tests/smb-mimetype-detection/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert smb any any -> any any (msg:"MIME Type Test"; file.mime_type; content:"executable"; sid:1337; rev:1;)
alert smb any any -> any any (msg:"MIME Type Test"; file.mime_type; content:"download"; sid:1338; rev:1;)
29 changes: 29 additions & 0 deletions tests/smb-mimetype-detection/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
requires:
features:
- HAVE_MIMETYPE

# disables checksum verification
args:
- -k none --set outputs.1.eve-log.types.6.files.force-mimetype=yes

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1337
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1338
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.mimetype: application/vnd.microsoft.portable-executable
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.mimetype: application/x-msdownload
Binary file added tests/smtp-mimetype-detection/input.pcap
Binary file not shown.
1 change: 1 addition & 0 deletions tests/smtp-mimetype-detection/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert smtp any any -> any any (msg:"MIME Type Test"; file.mime_type; content:"pdf"; sid:1337; rev:1;)
19 changes: 19 additions & 0 deletions tests/smtp-mimetype-detection/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
requires:
features:
- HAVE_MIMETYPE

# disables checksum verification
args:
- -k none --set outputs.1.eve-log.types.6.files.force-mimetype=yes

checks:
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 1337
- filter:
count: 1
match:
event_type: fileinfo
fileinfo.mimetype: application/pdf
Loading