--- /dev/null
+# Test
+
+Ensure that the engine throws an error message if the `replace` keyword is used
+in firewall rules, as it's banned from them.
+
+## Ticket
+
+https://redmine.openinfosecfoundation.org/issues/8551
--- /dev/null
+# should error out, as 'replace' is not allowed in firewall mode
+accept:hook http1:request_started any any -> any any (msg:"Test replace keyword with firewall rules or mode"; content:"foo"; replace:"bar"; sid:2000001;)
--- /dev/null
+requires:
+ min-version: 9
+
+pcap: ../../tls/tls-random/input.pcap
+
+args:
+ - --simulate-ips
+ - -v
+exit-code: 1
+
+checks:
+ - shell:
+ args: grep "keyword 'replace' is not allowed in firewall mode" stderr | wc -l
+ expect: 1
+
--- /dev/null
+# Test
+
+Ensure that the engine throws an error message if the `replace` keyword is used
+in threat detection rules, as it's banned in firewall mode.
+
+## Ticket
+
+https://redmine.openinfosecfoundation.org/issues/8551
--- /dev/null
+accept:hook tcp:all any any -> any any (msg:"Simple firewall rule."; sid: 1;)
--- /dev/null
+# should error out, as 'replace' is not allowed in firewall mode
+alert http any any -> any any (msg:"Test replace keyword with firewall rules"; content:"foo"; replace:"bar"; sid:2000001;)
--- /dev/null
+requires:
+ min-version: 9
+
+pcap: ../../tls/tls-random/input.pcap
+
+args:
+ - --simulate-ips
+ - -v
+exit-code: 1
+
+checks:
+ - shell:
+ args: grep "keyword 'replace' is not allowed in firewall mode" stderr | wc -l
+ expect: 1
+