]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
add test for extended security ipopts
authorSascha Steinbiss <satta@debian.org>
Thu, 22 Sep 2022 14:11:19 +0000 (16:11 +0200)
committerShivani Bhardwaj <shivani@oisf.net>
Fri, 28 Oct 2022 11:55:28 +0000 (17:25 +0530)
tests/ipopts-esec/suricata.yaml [new file with mode: 0644]
tests/ipopts-esec/test.pcap [new file with mode: 0644]
tests/ipopts-esec/test.rules [new file with mode: 0644]
tests/ipopts-esec/test.yaml [new file with mode: 0644]

diff --git a/tests/ipopts-esec/suricata.yaml b/tests/ipopts-esec/suricata.yaml
new file mode 100644 (file)
index 0000000..4ac212a
--- /dev/null
@@ -0,0 +1,9 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      types:
+        - alert
+        - flow
diff --git a/tests/ipopts-esec/test.pcap b/tests/ipopts-esec/test.pcap
new file mode 100644 (file)
index 0000000..d9c3c55
Binary files /dev/null and b/tests/ipopts-esec/test.pcap differ
diff --git a/tests/ipopts-esec/test.rules b/tests/ipopts-esec/test.rules
new file mode 100644 (file)
index 0000000..0b4f174
--- /dev/null
@@ -0,0 +1 @@
+alert ip any any <> any any (msg:"ESEC option set"; ipopts:esec; sid: 42;)
\ No newline at end of file
diff --git a/tests/ipopts-esec/test.yaml b/tests/ipopts-esec/test.yaml
new file mode 100644 (file)
index 0000000..fa99120
--- /dev/null
@@ -0,0 +1,21 @@
+requires:
+  script:
+    - grep IPV4_OPT_ESEC src/decode-ipv4.h > /dev/null
+
+args:
+  - --set stream.midstream=true -k none
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        alert.signature_id: 42
+        alert.signature: "ESEC option set"
+
+  - filter:
+      count: 1
+      match:
+        event_type: flow
+        src_ip: "1.2.3.4"
+        dest_ip: "4.5.6.7"