]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: add test for ldap.responses.attribute_type keyword 2430/head
authorAlice Akaki <akakialice@gmail.com>
Mon, 3 Mar 2025 15:45:14 +0000 (11:45 -0400)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Apr 2025 20:04:24 +0000 (22:04 +0200)
Ticket: #7533

tests/detect-ldap-attribute/README.md
tests/detect-ldap-attribute/test.rules
tests/detect-ldap-attribute/test.yaml

index e824abd1a82deaf65b043b27cf8f639b9c4d6e51..434dbaeee5033d05c6f855d88df3551b0bbfb731 100644 (file)
@@ -1,4 +1,4 @@
-Test ldap.request.attribute_type keyword.
+Test ldap.request.attribute_type and ldap.responses.attribute_type keywords.
 
 PCAP from ../ldap-search/ldap.pcap
 
index d1d2853e3e24e4242a196c5197ab8007a9b27897..e0dce85adf56fd152eb29d56edfed239f8055d83 100644 (file)
@@ -1,2 +1,4 @@
 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;)
+alert ldap any any -> any any (msg:"Test responses attribute type"; ldap.responses.attribute_type; content:"objectClass"; startswith; endswith; sid:3;)
+alert ldap any any -> any any (msg:"Test responses attribute type"; ldap.responses.attribute_type; content:"dc"; startswith; endswith; sid:4;)
\ No newline at end of file
index d126cec12a379852418089c2dee278cd96493aeb..3463f396275e0d2a413a02b44e2c634097999dbb 100644 (file)
@@ -20,4 +20,18 @@ checks:
         event_type: alert
         ldap.request.operation: search_request
         ldap.request.search_request.attributes[1]: +
-        alert.signature_id: 2
\ No newline at end of file
+        alert.signature_id: 2
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        ldap.responses[0].operation: search_result_entry
+        ldap.responses[0].search_result_entry.attributes[0].type: objectClass
+        alert.signature_id: 3
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        ldap.responses[0].operation: search_result_entry
+        ldap.responses[0].search_result_entry.attributes[1].type: dc
+        alert.signature_id: 4