From: Alice Akaki Date: Thu, 13 Feb 2025 05:20:56 +0000 (-0400) Subject: detect: add test for ldap.request.attribute_type keyword X-Git-Tag: suricata-7.0.11~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46f62dcd72179db4c5809129bc4eabe7ef626385;p=thirdparty%2Fsuricata-verify.git detect: add test for ldap.request.attribute_type keyword Ticket: #7533 --- diff --git a/tests/detect-ldap-attribute/README.md b/tests/detect-ldap-attribute/README.md new file mode 100644 index 000000000..e824abd1a --- /dev/null +++ b/tests/detect-ldap-attribute/README.md @@ -0,0 +1,5 @@ +Test ldap.request.attribute_type keyword. + +PCAP from ../ldap-search/ldap.pcap + +Redmine ticket: https://redmine.openinfosecfoundation.org/issues/7533 \ No newline at end of file diff --git a/tests/detect-ldap-attribute/test.rules b/tests/detect-ldap-attribute/test.rules new file mode 100644 index 000000000..d1d2853e3 --- /dev/null +++ b/tests/detect-ldap-attribute/test.rules @@ -0,0 +1,2 @@ +alert ldap any any -> any any (msg:"Test request attribute type"; ldap.request.attribute_type; content:"*"; startswith; endswith; sid:1;) +alert ldap any any -> any any (msg:"Test request attribute type"; ldap.request.attribute_type; content:"+"; startswith; endswith; sid:2;) diff --git a/tests/detect-ldap-attribute/test.yaml b/tests/detect-ldap-attribute/test.yaml new file mode 100644 index 000000000..d126cec12 --- /dev/null +++ b/tests/detect-ldap-attribute/test.yaml @@ -0,0 +1,23 @@ +requires: + min-version: 8 + +pcap: ../ldap-search/ldap.pcap + +args: + - -k none --set stream.inline=true + +checks: + - filter: + count: 1 + match: + event_type: alert + ldap.request.operation: search_request + ldap.request.search_request.attributes[0]: "*" + alert.signature_id: 1 + - filter: + count: 1 + match: + event_type: alert + ldap.request.operation: search_request + ldap.request.search_request.attributes[1]: + + alert.signature_id: 2 \ No newline at end of file