]> git.ipfire.org Git - thirdparty/suricata-verify.git/commitdiff
detect/files: add nfs test over udp only 2681/head
authorPhilippe Antoine <pantoine@oisf.net>
Fri, 3 Oct 2025 14:03:28 +0000 (16:03 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 7 Oct 2025 10:30:06 +0000 (12:30 +0200)
Ticket: 7973

tests/nfs-udp-only/README.md [new file with mode: 0644]
tests/nfs-udp-only/suricata.yaml [new file with mode: 0644]
tests/nfs-udp-only/test.rules [new file with mode: 0644]
tests/nfs-udp-only/test.yaml [new file with mode: 0644]

diff --git a/tests/nfs-udp-only/README.md b/tests/nfs-udp-only/README.md
new file mode 100644 (file)
index 0000000..c15a5e4
--- /dev/null
@@ -0,0 +1,11 @@
+# Test Description
+
+Test nfs on UDP only
+
+## PCAP
+
+Reused
+
+## Related issues
+
+https://redmine.openinfosecfoundation.org/issues/7973
diff --git a/tests/nfs-udp-only/suricata.yaml b/tests/nfs-udp-only/suricata.yaml
new file mode 100644 (file)
index 0000000..135b0be
--- /dev/null
@@ -0,0 +1,46 @@
+%YAML 1.1
+---
+
+outputs:
+  - eve-log:
+      enabled: yes
+      filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+      filename: eve.json
+      ethernet: true
+      metadata: true
+      community-id: true
+      community-id-seed: 1234
+      types:
+        - alert:
+            payload: yes             # enable dumping payload in Base64
+            payload-buffer-size: 4kb # max size of payload buffer to output in eve-log
+            payload-printable: yes   # enable dumping payload in printable (lossy) format
+            packet: yes              # enable dumping of packet (without stream segments)
+            metadata: yes            # enable inclusion of app layer metadata with alert. Default yes
+            tagged-packets: yes
+        - anomaly:
+            enabled: yes
+            types:
+              decode: yes
+              stream: yes
+              applayer: yes
+            packethdr: yes
+        - files:
+            force-magic: yes
+            force-hash: [md5, sha1, sha256]
+        - nfs
+        - flow
+        - netflow
+  - alert-debug:
+      enabled: yes
+      filename: alert-debug.log
+      append: yes
+      #filetype: regular # 'regular', 'unix_stream' or 'unix_dgram'
+
+app-layer:
+  protocols:
+    nfs:
+      udp:
+        enabled: yes
+      tcp:
+        enabled: no
diff --git a/tests/nfs-udp-only/test.rules b/tests/nfs-udp-only/test.rules
new file mode 100644 (file)
index 0000000..2d54ae4
--- /dev/null
@@ -0,0 +1 @@
+alert nfs any any -> any any (msg:"FILE store in NFS"; filestore; sid:1; rev:1;)
diff --git a/tests/nfs-udp-only/test.yaml b/tests/nfs-udp-only/test.yaml
new file mode 100644 (file)
index 0000000..b3ca4ad
--- /dev/null
@@ -0,0 +1,12 @@
+requires:
+  min-version: 9
+
+pcap: ../issue-3277-nfsv2-filestore/nfsv2.pcap
+
+checks:
+  - filter:
+      count: 1
+      match:
+        event_type: alert
+        app_proto: nfs
+        alert.signature_id: 1