From: Philippe Antoine Date: Fri, 26 Sep 2025 10:44:46 +0000 (+0200) Subject: http2: adds test for http2.errorcode keyword X-Git-Tag: suricata-8.0.2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=54e283b3c34ba90a29af5e495bf90f60eb0a4184;p=thirdparty%2Fsuricata-verify.git http2: adds test for http2.errorcode keyword Ticket: 7889 --- diff --git a/tests/http2-errorcode/README.md b/tests/http2-errorcode/README.md new file mode 100644 index 000000000..e5b39cb5f --- /dev/null +++ b/tests/http2-errorcode/README.md @@ -0,0 +1,11 @@ +# Description + +Test http2.errorcode keyword + +# Ticket + +https://redmine.openinfosecfoundation.org/issues/7889 + +# PCAP + +The pcap comes from https://github.com/grpc/grpc-node/issues/2744 diff --git a/tests/http2-errorcode/input.pcap b/tests/http2-errorcode/input.pcap new file mode 100644 index 000000000..1bc3c77ac Binary files /dev/null and b/tests/http2-errorcode/input.pcap differ diff --git a/tests/http2-errorcode/test.rules b/tests/http2-errorcode/test.rules new file mode 100644 index 000000000..d3f6de011 --- /dev/null +++ b/tests/http2-errorcode/test.rules @@ -0,0 +1,6 @@ +alert http2 any any -> any any (http2.errorcode:INTERNAL_ERROR; sid:1;) +alert http2 any any -> any any (http2.errorcode:!NO_ERROR; sid:2;) +# no match +alert http2 any any -> any any (http2.errorcode:HTTP_1_1_REQUIRED; sid:3;) +# new format +alert http2 any any -> any any (http2.errorcode:HTTP11_REQUIRED; sid:4;) diff --git a/tests/http2-errorcode/test.yaml b/tests/http2-errorcode/test.yaml new file mode 100644 index 000000000..0d9683109 --- /dev/null +++ b/tests/http2-errorcode/test.yaml @@ -0,0 +1,25 @@ +requires: + min-version: 9 + +# disables checksum verification +args: + - -k none + +checks: + - filter: + count: 2 + match: + event_type: alert + alert.signature_id: 1 + http.http2.request.error_code: INTERNALERROR + - filter: + count: 2 + match: + event_type: alert + alert.signature_id: 2 + http.http2.request.error_code: INTERNALERROR + - filter: + count: 0 + match: + event_type: alert + alert.signature_id: 3