]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect: add test for ldap.request.dn keyword
authorAlice Akaki <akakialice@gmail.com>
Fri, 31 Jan 2025 12:48:47 +0000 (08:48 -0400)
committerVictor Julien <victor@inliniac.net>
Fri, 21 Feb 2025 13:57:14 +0000 (14:57 +0100)
Ticket: #7471

tests/detect-ldap-dn/README.md [new file with mode: 0644]
tests/detect-ldap-dn/test.rules [new file with mode: 0644]
tests/detect-ldap-dn/test.yaml [new file with mode: 0644]

diff --git a/tests/detect-ldap-dn/README.md b/tests/detect-ldap-dn/README.md
new file mode 100644 (file)
index 0000000..127a77e
--- /dev/null
@@ -0,0 +1,5 @@
+Test ldap.request.dn keyword.
+
+PCAP from ../ldap-search/ldap.pcap
+
+Redmine ticket: https://redmine.openinfosecfoundation.org/issues/7471
\ No newline at end of file
diff --git a/tests/detect-ldap-dn/test.rules b/tests/detect-ldap-dn/test.rules
new file mode 100644 (file)
index 0000000..5554354
--- /dev/null
@@ -0,0 +1 @@
+alert ldap any any -> any any (msg:"Test ldap request dn"; ldap.request.dn; content:"dc=example,dc=com"; startswith; endswith; sid:1;)
diff --git a/tests/detect-ldap-dn/test.yaml b/tests/detect-ldap-dn/test.yaml
new file mode 100644 (file)
index 0000000..c649f47
--- /dev/null
@@ -0,0 +1,17 @@
+requires:
+  min-version: 8
+
+pcap: ../ldap-search/ldap.pcap
+
+args:
+  - -k none --set stream.inline=true
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        pcap_cnt: 4
+        ldap.request.operation: search_request
+        ldap.request.search_request.base_object: dc=example,dc=com
+        alert.signature_id: 1