]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
tests/eve-alert-verbose: introduce test 852/head
authorEric Leblond <eric@regit.org>
Sun, 2 Aug 2020 16:49:42 +0000 (18:49 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 13 Jun 2022 06:42:14 +0000 (08:42 +0200)
Introduce test on alert verbosity change.

tests/eve-alert-verbose/suricata.yaml [new file with mode: 0644]
tests/eve-alert-verbose/test.rules [new file with mode: 0644]
tests/eve-alert-verbose/test.yaml [new file with mode: 0644]
tests/eve-alert-verbose/testmyids.pcap [new file with mode: 0644]

diff --git a/tests/eve-alert-verbose/suricata.yaml b/tests/eve-alert-verbose/suricata.yaml
new file mode 100644 (file)
index 0000000..49392f5
--- /dev/null
@@ -0,0 +1,31 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular
+      filename: eve.json
+      full-logging-for-alerted-flows: printable
+
+      types:
+        - alert:
+            http-headers: yes
+        - http:
+            extended: yes
+        - dns:
+            query: yes     # enable logging of DNS queries
+            answer: yes    # enable logging of DNS answers
+        - tls:
+            extended: yes     # enable this for extended logging information
+        - files:
+            force-magic: no   # force logging magic on all logged files
+        - smtp:
+        - ssh
+        - stats:
+            totals: yes       # stats for all threads merged together
+            threads: no       # per thread stats
+            deltas: no        # include delta values
+        - flow
+        - netflow
+        - metadata
diff --git a/tests/eve-alert-verbose/test.rules b/tests/eve-alert-verbose/test.rules
new file mode 100644 (file)
index 0000000..0789cd5
--- /dev/null
@@ -0,0 +1,5 @@
+# Silly rule to set the flowbit "traffic/label/cli-http" on
+# the curl user-agent.
+alert http any any -> any any (msg:"TEST"; \
+      http.user_agent; content:"curl"; \
+      sid:1; rev:1;)
diff --git a/tests/eve-alert-verbose/test.yaml b/tests/eve-alert-verbose/test.yaml
new file mode 100644 (file)
index 0000000..b7baee9
--- /dev/null
@@ -0,0 +1,20 @@
+requires:
+
+  script:
+    - grep "http-headers" suricata.yaml.in > /dev/null
+
+checks:
+
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        has-key: flow
+        has-key: http.response_headers
+        has-key: http.request_headers
+  - filter:
+      count: 1
+      match:
+        event_type: http
+        has-key: http.response_headers
+        has-key: http.request_headers
diff --git a/tests/eve-alert-verbose/testmyids.pcap b/tests/eve-alert-verbose/testmyids.pcap
new file mode 100644 (file)
index 0000000..868c57e
Binary files /dev/null and b/tests/eve-alert-verbose/testmyids.pcap differ