Also added a few more cases for disabled config.
Related to (backport ticket 7726)
Bug #7725
--- /dev/null
+%YAML 1.1
+---
+
+decoder:
+ ipv4:
+ ipip:
+ enabled: true
+ track-parent-flow: true
+
+stats:
+ enabled: yes
+ interval: 8
+
+logging:
+ default-log-level: notice
+ default-output-filter:
+ outputs:
+ - console:
+ enabled: yes
+
+outputs:
+ - eve-log:
+ enabled: yes
+ filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+ filename: eve.json
+ types:
+ - alert
+ - drop:
+ alerts: yes
+ - flow
+ - stats:
+ enabled: yes
+ filename: stats.log
requires:
- min-version: 8
+ min-version: 7.0.12
args:
- -k none
- --simulate-ips
- --set stream.midstream=true
+- --runmode=single
checks:
- filter:
--- /dev/null
+# Test
+
+Test that in a scenario where a rule inspects traffic in an IP-in-IP tunnel, the
+engine will not generate alerts if this decoding is not enabled in the configuration
+file.
+
+## PCAP
+
+Shared by reporter.
+
+## Redmine ticket
+
+https://redmine.openinfosecfoundation.org/issues/7725
--- /dev/null
+%YAML 1.1
+---
+
+decoder:
+ ipv4:
+ ipip:
+ enabled: false
+ track-parent-flow: false
+
+stats:
+ enabled: yes
+ interval: 8
+
+logging:
+ default-log-level: notice
+ default-output-filter:
+ outputs:
+ - console:
+ enabled: yes
+
+outputs:
+ - eve-log:
+ enabled: yes
+ filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+ filename: eve.json
+ types:
+ - alert
+ - drop:
+ alerts: yes
+ - flow
+ - stats
+ - stats:
+ enabled: yes
+ filename: stats.log
--- /dev/null
+alert ip any any -> 10.0.0.0/8 any (msg:"IP-in-IP Test rule 1 - outer layer"; classtype:misc-activity; sid:60000000; rev:1;)
+drop ip any any -> 192.168.0.0/16 any (msg:"IP-in-IP Test rule 2 - inner layer"; classtype:misc-activity; sid:60000001; rev:1;)
--- /dev/null
+requires:
+ min-version: 7.0.12
+ lt-version: 8
+
+args:
+- -k none
+- --simulate-ips
+- --set stream.midstream=true
+- --runmode=single
+
+checks:
+ - filter:
+ count: 6
+ match:
+ event_type: alert
+ alert.signature_id: 60000000
+ pkt_src: wire/pcap
+ proto: IP-in-IP
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ tunnel.src_ip: 10.0.0.94
+ tunnel.dest_ip: 10.1.0.237
+ tunnel.proto: IP-in-IP
+ - filter:
+ count: 0
+ match:
+ event_type: drop
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 0
+ match:
+ event_type: drop
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 0
+ match:
+ event_type: flow
+ proto: IP-in-IP
+ src_ip: 10.0.0.94
+ dest_ip: 10.1.0.237
+ flow.alerted: true
+ - filter:
+ count: 0
+ match:
+ event_type: flow
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ flow.alerted: true
+ flow.action: drop
--- /dev/null
+# Test
+
+Test that in a scenario where a rule inspects traffic in an IP-in-IP tunnel, the
+engine will not generate alerts if this decoding is not enabled in the configuration
+file.
+
+## PCAP
+
+Shared by reporter.
+
+## Redmine ticket
+
+https://redmine.openinfosecfoundation.org/issues/7725
- drop:
alerts: yes
- flow
+ - stats
- stats:
enabled: yes
filename: stats.log
--- /dev/null
+alert ip any any -> 10.0.0.0/8 any (msg:"IP-in-IP Test rule 1 - outer layer"; classtype:misc-activity; sid:60000000; rev:1;)
+drop ip any any -> 192.168.0.0/16 any (msg:"IP-in-IP Test rule 2 - inner layer"; classtype:misc-activity; sid:60000001; rev:1;)
--- /dev/null
+requires:
+ min-version: 7.0.12
+ lt-version: 8
+
+args:
+- -k none
+- --simulate-ips
+- --set stream.midstream=true
+- --runmode=single
+
+checks:
+ - filter:
+ count: 6
+ match:
+ event_type: alert
+ alert.signature_id: 60000000
+ pkt_src: wire/pcap
+ proto: IP-in-IP
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ tunnel.src_ip: 10.0.0.94
+ tunnel.dest_ip: 10.1.0.237
+ tunnel.proto: IP-in-IP
+ - filter:
+ count: 0
+ match:
+ event_type: drop
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 0
+ match:
+ event_type: drop
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 0
+ match:
+ event_type: flow
+ proto: IP-in-IP
+ src_ip: 10.0.0.94
+ dest_ip: 10.1.0.237
+ flow.alerted: true
+ - filter:
+ count: 0
+ match:
+ event_type: flow
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ flow.alerted: true
+ flow.action: drop
--- /dev/null
+# Test
+
+Test that in a scenario where a rule inspects traffic in an IP-in-IP tunnel, the
+engine will properly generate alerts if this decoding is enabled in the configuration
+file, and not set up a new flow for said packets, if this configuration is disabled.
+
+## PCAP
+
+Shared by reporter.
+
+## Redmine ticket
+
+https://redmine.openinfosecfoundation.org/issues/7725
--- /dev/null
+%YAML 1.1
+---
+
+decoder:
+ ipv4:
+ ipip:
+ enabled: true
+ track-parent-flow: false
+
+stats:
+ enabled: yes
+ interval: 8
+
+logging:
+ default-log-level: notice
+ default-output-filter:
+ outputs:
+ - console:
+ enabled: yes
+
+outputs:
+ - eve-log:
+ enabled: yes
+ filetype: regular #regular|syslog|unix_dgram|unix_stream|redis
+ filename: eve.json
+ types:
+ - alert
+ - drop:
+ alerts: yes
+ - flow
+ - stats
+ - stats:
+ enabled: yes
+ filename: stats.log
--- /dev/null
+alert ip any any -> 10.0.0.0/8 any (msg:"IP-in-IP Test rule 1 - outer layer"; classtype:misc-activity; sid:60000000; rev:1;)
+drop ip any any -> 192.168.0.0/16 any (msg:"IP-in-IP Test rule 2 - inner layer"; classtype:misc-activity; sid:60000001; rev:1;)
--- /dev/null
+requires:
+ min-version: 7.0.12
+ lt-version: 8
+
+args:
+- -k none
+- --simulate-ips
+- --set stream.midstream=true
+- --runmode=single
+
+
+checks:
+ - filter:
+ count: 0
+ match:
+ event_type: alert
+ alert.signature_id: 60000000
+ pkt_src: wire/pcap
+ proto: IP-in-IP
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ tunnel.src_ip: 10.0.0.94
+ tunnel.dest_ip: 10.1.0.237
+ tunnel.proto: IP-in-IP
+ - filter:
+ count: 1
+ match:
+ event_type: drop
+ alert.signature_id: 60000001
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 2
+ match:
+ event_type: drop
+ pkt_src: ipv4 tunnel
+ proto: ICMP
+ - filter:
+ count: 0
+ match:
+ event_type: flow
+ proto: IP-in-IP
+ src_ip: 10.0.0.94
+ dest_ip: 10.1.0.237
+ flow.alerted: true
+ - filter:
+ count: 1
+ match:
+ event_type: flow
+ proto: ICMP
+ src_ip: 192.168.0.94
+ dest_ip: 192.168.0.237
+ flow.alerted: true
+ flow.action: drop