Skip to content
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
10 changes: 10 additions & 0 deletions tests/imap-detection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Simple test for imap protocol detection.

## PCAP

URL: "Pcap imap.cap provided with redmine issue https://redmine.openinfosecfoundation.org/issues/2886"

## Related issues

Ticket #2886

Binary file added tests/imap-detection/input.pcap
Binary file not shown.
35 changes: 35 additions & 0 deletions tests/imap-detection/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
requires:
min-version: 8

args:
- -k none

checks:
- filter:
count: 1
match:
app_proto: imap
dest_ip: 131.151.37.122
dest_port: 143
event_type: flow
flow.age: 26
flow.alerted: false
flow.bytes_toclient: 23493
flow.bytes_toserver: 3790
flow.pkts_toclient: 50
flow.pkts_toserver: 56
flow.reason: shutdown
flow.state: closed
proto: TCP
src_ip: 131.151.32.21
src_port: 4167
tcp.ack: true
tcp.fin: true
tcp.psh: true
tcp.state: closed
tcp.syn: true
tcp.tc_max_regions: 1
tcp.tcp_flags: 1b
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 do not need to test all these details

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nit : we do not need to test all these details

should i also remove all tcp-related details?
like

-      tcp.ack: true
-      tcp.fin: true
-      tcp.psh: true
-      tcp.state: closed
-      tcp.syn: true
-      tcp.tc_max_regions: 1
-      tcp.tcp_flags: 1b
-      tcp.tcp_flags_tc: 1b
-      tcp.tcp_flags_ts: 1b
-      tcp.ts_max_regions: 1

Copy link
Collaborator

Choose a reason for hiding this comment

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

indeed

tcp.tcp_flags_tc: 1b
tcp.tcp_flags_ts: 1b
tcp.ts_max_regions: 1