tests: add test for imap proto#2908
Conversation
5c27882 to
02c7a66
Compare
| @@ -0,0 +1,6 @@ | |||
| alert imap any any -> any any (msg:"IMAP CAPABILITY command"; imap.request; content:"CAPABILITY"; sid:1; rev:1;) | |||
| alert imap any any -> any any (msg:"IMAP server ready"; imap.response; content:"OK IMAP server ready"; sid:2; rev:1;) | |||
| alert imap any any -> any any (msg:"IMAP email Body"; flow:to_client; imap.email.body; content:"Hello"; imap.email.direction:to_client;sid:3; rev:1;) | |||
There was a problem hiding this comment.
Why do we need a imap.email.direction keyword ? can we not use flow: to_client; ?
| alert imap any any -> any any (msg:"IMAP CAPABILITY command"; imap.request; content:"CAPABILITY"; sid:1; rev:1;) | ||
| alert imap any any -> any any (msg:"IMAP server ready"; imap.response; content:"OK IMAP server ready"; sid:2; rev:1;) | ||
| alert imap any any -> any any (msg:"IMAP email Body"; flow:to_client; imap.email.body; content:"Hello"; imap.email.direction:to_client;sid:3; rev:1;) | ||
| alert imap any any -> any any (msg:"IMAP email header name and value"; flow:to_client; imap.email.header; content:"from:"; content:"digitalinvestigator"; sid:4; rev:1;) |
There was a problem hiding this comment.
Does the email.from keyword also work ?
| imap.responses[3]: "* OK [PERMANENTFLAGS (\\Answered \\Flagged \\Draft \\Deleted \\Seen \\*)] Unlimited" | ||
| imap.responses[4]: "* OK [UIDNEXT 2] Predicted next UID" | ||
| imap.responses[5]: "* OK [UIDVALIDITY 1377199071] UIDs valid" | ||
| imap.responses[6]: "4 OK [READ-WRITE] SELECT completed" |
There was a problem hiding this comment.
Is this not too verbose by default ?
| pcap_cnt: 12 | ||
| event_type: imap | ||
| imap.requests[0]: "2 AUTHENTICATE plain" | ||
| imap.requests[1]: "AGRpZ2l0YWxpbnZlc3RpZ2F0b3JAbmV0d29ya3NpbXMuY29tAG5hcGllcjEyMw==" |
There was a problem hiding this comment.
Are we logging clear-text credentials here ?
| @@ -0,0 +1,6 @@ | |||
| alert imap any any -> any any (msg:"IMAP CAPABILITY command"; imap.request; content:"CAPABILITY"; sid:1; rev:1;) | |||
There was a problem hiding this comment.
Could we get also frame rules, or a dedicated test for the frames?
| count: 2 | ||
| match: | ||
| event_type: alert | ||
| alert.signature_id: 9 |
There was a problem hiding this comment.
Could we test that we get imap metadata in alerts ?
| match: | ||
| pcap_cnt: 8 | ||
| event_type: imap | ||
| imap.requests[0]: "1 CAPABILITY" |
There was a problem hiding this comment.
Question : does it make sense to log the imap tag ?
| # Test Purpose | ||
|
|
||
| Test that IMAP parser and sticky buffers are working correctly. | ||
|
|
There was a problem hiding this comment.
Please add ticket number ;-)
| imap.responses[0]: "* 1 FETCH (UID 1 RFC822.SIZE 452 BODY[] {452})" | ||
| imap.responses[1]: "8 OK UID FETCH completed" | ||
| email.direction: "to_client" | ||
| email.from: "DI <digitalinvestigator@networksims.com>" |
There was a problem hiding this comment.
Do we have tests with emails in both ways ?
|
Suricata PR: OISF/suricata#15064 |
|
Suricata PR: OISF/suricata#15209 |
Ticket
If your pull request is related to a Suricata ticket, please provide
the full URL to the ticket here so this pull request can monitor
changes to the ticket status:
Redmine ticket: https://redmine.openinfosecfoundation.org/issues/8276