]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: add test for ldap.request.attribute_type keyword
authorAlice Akaki <akakialice@gmail.com>
Thu, 13 Feb 2025 05:20:56 +0000 (01:20 -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 [new file with mode: 0644]
tests/detect-ldap-attribute/test.rules [new file with mode: 0644]
tests/detect-ldap-attribute/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-ldap-attribute/README.md b/tests/detect-ldap-attribute/README.md
new file mode 100644 (file)
index 0000000..e824abd
--- /dev/null
@@ -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 (file)
index 0000000..d1d2853
--- /dev/null
@@ -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 (file)
index 0000000..d126cec
--- /dev/null
@@ -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