]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
snmp: adds test for community keyword 1815/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 26 Apr 2024 14:25:18 +0000 (16:25 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 2 May 2024 17:49:30 +0000 (19:49 +0200)
as was done by unit test DetectSNMPCommunityTest

tests/snmp-community/README.md [new file with mode: 0644]
tests/snmp-community/test.rules [new file with mode: 0644]
tests/snmp-community/test.yaml [new file with mode: 0644]

diff --git a/tests/snmp-community/README.md b/tests/snmp-community/README.md
new file mode 100644 (file)
index 0000000..764e6b6
--- /dev/null
@@ -0,0 +1,7 @@
+# Test Purpose
+
+Match on SNMP community keyword
+
+## PCAP
+
+This PCAP from snmp-v2c-get is reused, as was done in DetectSNMPCommunityTest for first packet
diff --git a/tests/snmp-community/test.rules b/tests/snmp-community/test.rules
new file mode 100644 (file)
index 0000000..fe402de
--- /dev/null
@@ -0,0 +1,2 @@
+alert snmp any any -> any any (msg:"SNMP Test Rule"; snmp.community; content:"[R0_C@cti!]"; sid:1; rev:1;)
+alert snmp any any -> any any (msg:"SNMP Test Rule"; snmp.community; content:"private"; sid:2; rev:1;)
diff --git a/tests/snmp-community/test.yaml b/tests/snmp-community/test.yaml
new file mode 100644 (file)
index 0000000..c36f372
--- /dev/null
@@ -0,0 +1,14 @@
+pcap: ../snmp-v2c-get/SNMPv2c_get_requests.pcap
+
+checks:
+ - filter:
+     count: 8
+     match:
+       event_type: alert
+       alert.signature_id: 1
+
+ - filter:
+     count: 0
+     match:
+       event_type: alert
+       alert.signature_id: 2