diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86e452d..3e03ba8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,6 +72,11 @@ jobs: ENVOY_IMAGE=$image go run mage.go e2e done + # Currently excluded, go-ftw fails to find the destination after a while. Locally works fine. + # - name: Run regression tests (ftw) + # shell: bash + # run: go run mage.go ftw + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 diff --git a/example/docker-compose.yml b/example/docker-compose.yml index ea25747..846cd83 100644 --- a/example/docker-compose.yml +++ b/example/docker-compose.yml @@ -11,7 +11,6 @@ services: - chown -R 101:101 /home/envoy/logs volumes: - logs:/home/envoy/logs:rw - envoy: depends_on: - chown diff --git a/ftw/docker-compose.yml b/ftw/docker-compose.yml index d176d7f..34bfbb3 100644 --- a/ftw/docker-compose.yml +++ b/ftw/docker-compose.yml @@ -1,6 +1,6 @@ services: httpbin: - image: ealen/echo-server:latest + image: kennethreitz/httpbin:latest chown: image: alpine:3.16 command: diff --git a/ftw/envoy-config.yaml b/ftw/envoy-config.yaml index b00437b..31a8f3d 100644 --- a/ftw/envoy-config.yaml +++ b/ftw/envoy-config.yaml @@ -33,11 +33,12 @@ static_resources: root_id: "" configuration: "@type": "type.googleapis.com/google.protobuf.StringValue" + # NB: inline rules order matter. Some ftw-config rules override the coraza-recommended default ones. value: | { "rules": [ + {"inline": "Include coraza.conf-recommended.conf"}, {"inline": "Include ftw-config.conf"}, - {"inline": "Include coraza.conf-recommended"}, {"inline": "Include crs-setup.conf.example"}, {"inline": "Include crs/*.conf"} ] diff --git a/ftw/ftw.yml b/ftw/ftw.yml index 4819dd1..d20b13f 100644 --- a/ftw/ftw.yml +++ b/ftw/ftw.yml @@ -1,52 +1,376 @@ --- -# For caddy configuration see the next file, Caddyfile -# Just type: go-ftw run -d ./coreruleset/tests/regression --config .ftw.yaml logfile: '/home/envoy/logs/ftw.log' testoverride: input: dest_addr: envoy ignore: - '911100-5': 'Rejected by Envoy with Error 400' - '911100-7': 'Rejected by Envoy with Error 400' + '911100-5': 'Invalid HTTP method. Rejected by Envoy with Error 400' + '911100-7': 'Invalid HTTP method. Rejected by Envoy with Error 400' '920100-4': 'Accepted by Envoy. Valid request. It is only disabled by default from Apache and Nginx' - '920100-10': 'Invalid HTTP method is rejected by Envoy' - '920100-14': 'Invalid HTTP method is rejected by Envoy' - '920181-1': 'Invalid URL, Coraza stops this.' - '942490-17': 'Invalid URL, Coraza stops this.' - '942260-17': 'Invalid URL, Coraza stops this.' - '942260-6': 'Invalid URL, Coraza stops this.' - '942150-6': 'Invalid URL, Coraza stops this.' - '920240-1': 'Invalid URL, Coraza stops this.' - '920240-5': 'Invalid URL, Coraza stops this.' - '920240-6': 'Invalid URL, Coraza stops this.' - '941130-11': 'Invalid URL, Coraza stops this.' - '941130-2': 'Invalid URL, Coraza stops this.' - '941130-4': 'Invalid URL, Coraza stops this.' - '941130-6': 'Invalid URL, Coraza stops this.' - '941130-9': 'Invalid URL, Coraza stops this.' - '941130-10': 'Invalid URL, Coraza stops this.' - '941130-12': 'Invalid URL, Coraza stops this.' - '941130-14': 'Invalid URL, Coraza stops this.' - '941130-16': 'Invalid URL, Coraza stops this.' - '921150-1': 'Invalid URL, Coraza stops this.' - '921160-1': 'Invalid URL, Coraza stops this.' - '941110-6': 'Invalid URL, Coraza stops this.' - '942100-10': 'Invalid URL, Coraza stops this.' + '920100-10': 'Invalid HTTP method. Rejected by Envoy with Error 400' + '920100-14': 'Invalid HTTP method. Rejected by Envoy with Error 400' '932140-3': 'Invalid URL, Coraza stops this.' - '941280-2': 'Invalid URL, Coraza stops this.' - '942100-13': 'Invalid URL, Coraza stops this.' '920120-4': 'Rule bug' '920120-6': 'Rule bug' '920120-7': 'Rule bug' - '920170-7': 'TODO(anuraaga): HTTP/1.0 issue?' - '920460-1': 'Quadruple backslash issue' - '941330-1': 'Quadruple backslash issue' - '920460-2': 'Quadruple backslash issue' - '920460-3': 'Quadruple backslash issue' - '920460-4': 'Quadruple backslash issue' '932180-2': 'Bad multipart' + '942490-17': 'Invalid URL, Coraza stops this.' + '920400-1': 'Httpbin fails this test. ealen/echo-server fails 920272-5' # Temporary: '953120-0': 'Temporary, this works but the testing framework does not support it yet.' '953120-2': 'Temporary, this works but the testing framework does not support it yet.' '953120-4': 'Temporary, this works but the testing framework does not support it yet.' '943110-4': 'Temporary, this works but the testing framework does not support it yet.' + + # Rules somewhat working + '920270-4': 'Log contains 920270.Test has log_contains disabled.' + '920270-5': 'Manually working, with go-ftw rule not in the log' + '920340-2': 'Log contains 920340, but tests expects expect_error: true' + + # Rules not working + '920171-2': 'Rule 920171 not detected. GET/HEAD with body' + '920171-3': 'Rule 920171 not detected. GET/HEAD with body' + '920180-4': 'Rule 920180 not detected.' + '920210-2': 'Rule 920210 not detected.' + '920210-3': 'Rule 920210 not detected.' + '920210-4': 'Rule 920210 not detected.' + '920210-6': 'Rule 920210 not detected.' + '920210-7': 'Rule 920210 not detected.' + '920274-2': 'False positive. Rule 920274 always triggered' + '920274-3': 'False positive. Rule 920274 always triggered' + '920274-5': 'False positive. Rule 920274 always triggered' + '920280-1': 'Rule 920280 not detected. Host not present' + '920280-3': 'Rule 920280 not detected. Host not present' + '920290-1': 'Rule 920290 not detected. Empty Host' + '920400-1': 'Rule 920400 not detected.' + '920430-3': 'Rule 920430 not detected.' + '920430-5': 'Rule 920430 not detected. HTTP protocol version' + '920430-8': 'Rule 920430 not detected. HTTP protocol version' + '920430-9': 'Rule 920430 not detected. HTTP protocol version' + '921180-2': 'False Positive. Parameters with the same name' + '921180-4': 'False Positive. Parameters with the same name' + '921180-5': 'False Positive. Parameters with the same name' + '921180-6': 'False Positive. Parameters with the same name' + '934120-28': 'Rule 934120 partially detected. Enclosed alphanumerics not detected' + '934120-29': 'Rule 934120 partially detected. Enclosed alphanumerics not detected' + '934120-30': 'Rule 934120 partially detected. Enclosed alphanumerics not detected' + '934120-31': 'Rule 934120 partially detected. Enclosed alphanumerics not detected' + '934130-7': 'Rule 934130 partially detected.' + '934130-8': 'Rule 934130 partially detected.' + '934130-9': 'Rule 934130 partially detected.' + '934130-10': 'Rule 934130 partially detected.' + '934130-11': 'Rule 934130 partially detected.' + '934131-1': 'Rule 934131 not detected' + '941101-1': 'Rule 941101 not detected' + '941110-4': 'Rule 941110 partially detected. Referer header' + '941110-9': 'Rule 941110 partially detected. Referer header' + '941310-1': 'Rule 941310 partially detected' + '941310-3': 'Rule 941310 partially detected' + '942190-42': 'Rule 942190 partially detected. SQLi' + '942440-16': 'False Positive. Rx' + '942440-17': 'False Positive. Rx' + '942440-18': 'False Positive. Rx' + '944100-13': 'Rule 944100 partially detected. XML attributes' + '944100-14': 'Rule 944100 partially detected. XML attributes' + '944100-17': 'Rule 944100 partially detected. XML attributes' + '944100-18': 'Rule 944100 partially detected. XML attributes' + '944110-13': 'Rule 944110 partially detected. XML attributes' + '944110-14': 'Rule 944110 partially detected. XML attributes' + '944110-17': 'Rule 944110 partially detected. XML attributes' + '944110-18': 'Rule 944110 partially detected. XML attributes' + '944120-7': 'Rule 944120 partially detected. XML attributes' + '944120-8': 'Rule 944120 partially detected. XML attributes' + '944120-9': 'Rule 944120 partially detected. XML attributes' + '944120-24': 'Rule 944120 partially detected. XML attributes' + '944120-25': 'Rule 944120 partially detected. XML attributes' + '944120-26': 'Rule 944120 partially detected. XML attributes' + '944120-41': 'Rule 944120 partially detected. XML attributes' + '944120-42': 'Rule 944120 partially detected. XML attributes' + '944120-43': 'Rule 944120 partially detected. XML attributes' + '944120-58': 'Rule 944120 partially detected. XML attributes' + '944120-59': 'Rule 944120 partially detected. XML attributes' + '944120-60': 'Rule 944120 partially detected. XML attributes' + '944120-75': 'Rule 944120 partially detected. XML attributes' + '944120-76': 'Rule 944120 partially detected. XML attributes' + '944120-77': 'Rule 944120 partially detected. XML attributes' + '944120-92': 'Rule 944120 partially detected. XML attributes' + '944120-93': 'Rule 944120 partially detected. XML attributes' + '944120-94': 'Rule 944120 partially detected. XML attributes' + '944120-109': 'Rule 944120 partially detected. XML attributes' + '944120-110': 'Rule 944120 partially detected. XML attributes' + '944120-111': 'Rule 944120 partially detected. XML attributes' + '944120-126': 'Rule 944120 partially detected. XML attributes' + '944120-127': 'Rule 944120 partially detected. XML attributes' + '944120-128': 'Rule 944120 partially detected. XML attributes' + '944130-5': 'Rule 944130 partially detected. XML attributes' + '944130-6': 'Rule 944130 partially detected. XML attributes' + '944130-7': 'Rule 944130 partially detected. XML attributes' + '944130-16': 'Rule 944130 partially detected. XML attributes' + '944130-17': 'Rule 944130 partially detected. XML attributes' + '944130-18': 'Rule 944130 partially detected. XML attributes' + '944130-27': 'Rule 944130 partially detected. XML attributes' + '944130-28': 'Rule 944130 partially detected. XML attributes' + '944130-29': 'Rule 944130 partially detected. XML attributes' + '944130-38': 'Rule 944130 partially detected. XML attributes' + '944130-39': 'Rule 944130 partially detected. XML attributes' + '944130-40': 'Rule 944130 partially detected. XML attributes' + '944130-49': 'Rule 944130 partially detected. XML attributes' + '944130-50': 'Rule 944130 partially detected. XML attributes' + '944130-51': 'Rule 944130 partially detected. XML attributes' + '944130-60': 'Rule 944130 partially detected. XML attributes' + '944130-61': 'Rule 944130 partially detected. XML attributes' + '944130-62': 'Rule 944130 partially detected. XML attributes' + '944130-71': 'Rule 944130 partially detected. XML attributes' + '944130-72': 'Rule 944130 partially detected. XML attributes' + '944130-73': 'Rule 944130 partially detected. XML attributes' + '944130-82': 'Rule 944130 partially detected. XML attributes' + '944130-83': 'Rule 944130 partially detected. XML attributes' + '944130-84': 'Rule 944130 partially detected. XML attributes' + '944130-93': 'Rule 944130 partially detected. XML attributes' + '944130-94': 'Rule 944130 partially detected. XML attributes' + '944130-95': 'Rule 944130 partially detected. XML attributes' + '944130-104': 'Rule 944130 partially detected. XML attributes' + '944130-105': 'Rule 944130 partially detected. XML attributes' + '944130-106': 'Rule 944130 partially detected. XML attributes' + '944130-115': 'Rule 944130 partially detected. XML attributes' + '944130-116': 'Rule 944130 partially detected. XML attributes' + '944130-117': 'Rule 944130 partially detected. XML attributes' + '944130-126': 'Rule 944130 partially detected. XML attributes' + '944130-127': 'Rule 944130 partially detected. XML attributes' + '944130-128': 'Rule 944130 partially detected. XML attributes' + '944130-137': 'Rule 944130 partially detected. XML attributes' + '944130-138': 'Rule 944130 partially detected. XML attributes' + '944130-139': 'Rule 944130 partially detected. XML attributes' + '944130-148': 'Rule 944130 partially detected. XML attributes' + '944130-149': 'Rule 944130 partially detected. XML attributes' + '944130-150': 'Rule 944130 partially detected. XML attributes' + '944130-159': 'Rule 944130 partially detected. XML attributes' + '944130-160': 'Rule 944130 partially detected. XML attributes' + '944130-161': 'Rule 944130 partially detected. XML attributes' + '944130-170': 'Rule 944130 partially detected. XML attributes' + '944130-171': 'Rule 944130 partially detected. XML attributes' + '944130-172': 'Rule 944130 partially detected. XML attributes' + '944130-181': 'Rule 944130 partially detected. XML attributes' + '944130-182': 'Rule 944130 partially detected. XML attributes' + '944130-183': 'Rule 944130 partially detected. XML attributes' + '944130-192': 'Rule 944130 partially detected. XML attributes' + '944130-193': 'Rule 944130 partially detected. XML attributes' + '944130-194': 'Rule 944130 partially detected. XML attributes' + '944130-203': 'Rule 944130 partially detected. XML attributes' + '944130-204': 'Rule 944130 partially detected. XML attributes' + '944130-205': 'Rule 944130 partially detected. XML attributes' + '944130-214': 'Rule 944130 partially detected. XML attributes' + '944130-215': 'Rule 944130 partially detected. XML attributes' + '944130-216': 'Rule 944130 partially detected. XML attributes' + '944130-225': 'Rule 944130 partially detected. XML attributes' + '944130-226': 'Rule 944130 partially detected. XML attributes' + '944130-227': 'Rule 944130 partially detected. XML attributes' + '944130-236': 'Rule 944130 partially detected. XML attributes' + '944130-237': 'Rule 944130 partially detected. XML attributes' + '944130-238': 'Rule 944130 partially detected. XML attributes' + '944130-247': 'Rule 944130 partially detected. XML attributes' + '944130-248': 'Rule 944130 partially detected. XML attributes' + '944130-249': 'Rule 944130 partially detected. XML attributes' + '944130-258': 'Rule 944130 partially detected. XML attributes' + '944130-259': 'Rule 944130 partially detected. XML attributes' + '944130-260': 'Rule 944130 partially detected. XML attributes' + '944130-269': 'Rule 944130 partially detected. XML attributes' + '944130-270': 'Rule 944130 partially detected. XML attributes' + '944130-271': 'Rule 944130 partially detected. XML attributes' + '944130-280': 'Rule 944130 partially detected. XML attributes' + '944130-281': 'Rule 944130 partially detected. XML attributes' + '944130-282': 'Rule 944130 partially detected. XML attributes' + '944130-291': 'Rule 944130 partially detected. XML attributes' + '944130-292': 'Rule 944130 partially detected. XML attributes' + '944130-293': 'Rule 944130 partially detected. XML attributes' + '944130-302': 'Rule 944130 partially detected. XML attributes' + '944130-303': 'Rule 944130 partially detected. XML attributes' + '944130-304': 'Rule 944130 partially detected. XML attributes' + '944130-313': 'Rule 944130 partially detected. XML attributes' + '944130-314': 'Rule 944130 partially detected. XML attributes' + '944130-315': 'Rule 944130 partially detected. XML attributes' + '944130-324': 'Rule 944130 partially detected. XML attributes' + '944130-325': 'Rule 944130 partially detected. XML attributes' + '944130-326': 'Rule 944130 partially detected. XML attributes' + '944130-335': 'Rule 944130 partially detected. XML attributes' + '944130-336': 'Rule 944130 partially detected. XML attributes' + '944130-337': 'Rule 944130 partially detected. XML attributes' + '944130-346': 'Rule 944130 partially detected. XML attributes' + '944130-347': 'Rule 944130 partially detected. XML attributes' + '944130-348': 'Rule 944130 partially detected. XML attributes' + '944130-357': 'Rule 944130 partially detected. XML attributes' + '944130-358': 'Rule 944130 partially detected. XML attributes' + '944130-359': 'Rule 944130 partially detected. XML attributes' + '944130-368': 'Rule 944130 partially detected. XML attributes' + '944130-369': 'Rule 944130 partially detected. XML attributes' + '944130-370': 'Rule 944130 partially detected. XML attributes' + '944130-379': 'Rule 944130 partially detected. XML attributes' + '944130-380': 'Rule 944130 partially detected. XML attributes' + '944130-381': 'Rule 944130 partially detected. XML attributes' + '944130-390': 'Rule 944130 partially detected. XML attributes' + '944130-391': 'Rule 944130 partially detected. XML attributes' + '944130-392': 'Rule 944130 partially detected. XML attributes' + '944130-401': 'Rule 944130 partially detected. XML attributes' + '944130-402': 'Rule 944130 partially detected. XML attributes' + '944130-403': 'Rule 944130 partially detected. XML attributes' + '944130-412': 'Rule 944130 partially detected. XML attributes' + '944130-413': 'Rule 944130 partially detected. XML attributes' + '944130-414': 'Rule 944130 partially detected. XML attributes' + '944150-3': 'Rule 944150 partially detected. XML,Log4J' + '944150-4': 'Rule 944150 partially detected. XML,Log4J' + '944151-3': 'Rule 944151 partially detected. XML,Log4J' + '944151-4': 'Rule 944151 partially detected. XML,Log4J' + '944152-3': 'Rule 944152 partially detected. XML,Log4J' + '944152-4': 'Rule 944152 partially detected. XML,Log4J' + '944200-1': 'Rule 944200 not detected' + '944210-7': 'Rule 944210 partially detected' + '944210-8': 'Rule 944210 partially detected' + '944210-9': 'Rule 944210 partially detected' + '944210-24': 'Rule 944210 partially detected' + '944210-25': 'Rule 944210 partially detected' + '944210-26': 'Rule 944210 partially detected' + '944210-41': 'Rule 944210 partially detected' + '944210-42': 'Rule 944210 partially detected' + '944210-43': 'Rule 944210 partially detected' + '944240-5': 'Rule 944240 partially detected' + '944240-6': 'Rule 944240 partially detected' + '944240-7': 'Rule 944240 partially detected' + '944240-16': 'Rule 944240 partially detected' + '944240-17': 'Rule 944240 partially detected' + '944240-18': 'Rule 944240 partially detected' + '944240-27': 'Rule 944240 partially detected' + '944240-28': 'Rule 944240 partially detected' + '944240-29': 'Rule 944240 partially detected' + '944240-38': 'Rule 944240 partially detected' + '944240-39': 'Rule 944240 partially detected' + '944240-40': 'Rule 944240 partially detected' + '944240-49': 'Rule 944240 partially detected' + '944240-50': 'Rule 944240 partially detected' + '944240-51': 'Rule 944240 partially detected' + '944240-60': 'Rule 944240 partially detected' + '944240-61': 'Rule 944240 partially detected' + '944240-62': 'Rule 944240 partially detected' + '944240-71': 'Rule 944240 partially detected' + '944240-72': 'Rule 944240 partially detected' + '944240-73': 'Rule 944240 partially detected' + '944240-82': 'Rule 944240 partially detected' + '944240-83': 'Rule 944240 partially detected' + '944240-84': 'Rule 944240 partially detected' + '944250-5': 'Rule 944250 partially detected' + '944250-6': 'Rule 944250 partially detected' + '944250-7': 'Rule 944250 partially detected' + '944250-16': 'Rule 944250 partially detected' + '944250-17': 'Rule 944250 partially detected' + '944250-18': 'Rule 944250 partially detected' + '944300-5': 'Rule 944300 partially detected' + '944300-6': 'Rule 944300 partially detected' + '944300-7': 'Rule 944300 partially detected' + '944300-16': 'Rule 944300 partially detected' + '944300-17': 'Rule 944300 partially detected' + '944300-18': 'Rule 944300 partially detected' + '944300-27': 'Rule 944300 partially detected' + '944300-28': 'Rule 944300 partially detected' + '944300-29': 'Rule 944300 partially detected' + '944300-38': 'Rule 944300 partially detected' + '944300-39': 'Rule 944300 partially detected' + '944300-40': 'Rule 944300 partially detected' + '944300-49': 'Rule 944300 partially detected' + '944300-50': 'Rule 944300 partially detected' + '944300-51': 'Rule 944300 partially detected' + '944300-60': 'Rule 944300 partially detected' + '944300-61': 'Rule 944300 partially detected' + '944300-62': 'Rule 944300 partially detected' + '944300-71': 'Rule 944300 partially detected' + '944300-72': 'Rule 944300 partially detected' + '944300-73': 'Rule 944300 partially detected' + '944300-82': 'Rule 944300 partially detected' + '944300-83': 'Rule 944300 partially detected' + '944300-84': 'Rule 944300 partially detected' + '944300-93': 'Rule 944300 partially detected' + '944300-94': 'Rule 944300 partially detected' + '944300-95': 'Rule 944300 partially detected' + '944300-104': 'Rule 944300 partially detected' + '944300-105': 'Rule 944300 partially detected' + '944300-106': 'Rule 944300 partially detected' + '944300-115': 'Rule 944300 partially detected' + '944300-116': 'Rule 944300 partially detected' + '944300-117': 'Rule 944300 partially detected' + '944300-126': 'Rule 944300 partially detected' + '944300-127': 'Rule 944300 partially detected' + '944300-128': 'Rule 944300 partially detected' + '944300-137': 'Rule 944300 partially detected' + '944300-138': 'Rule 944300 partially detected' + '944300-139': 'Rule 944300 partially detected' + '944300-148': 'Rule 944300 partially detected' + '944300-149': 'Rule 944300 partially detected' + '944300-150': 'Rule 944300 partially detected' + '944300-159': 'Rule 944300 partially detected' + '944300-160': 'Rule 944300 partially detected' + '944300-161': 'Rule 944300 partially detected' + '944300-170': 'Rule 944300 partially detected' + '944300-171': 'Rule 944300 partially detected' + '944300-172': 'Rule 944300 partially detected' + '944300-181': 'Rule 944300 partially detected' + '944300-182': 'Rule 944300 partially detected' + '944300-183': 'Rule 944300 partially detected' + '944300-192': 'Rule 944300 partially detected' + '944300-193': 'Rule 944300 partially detected' + '944300-194': 'Rule 944300 partially detected' + '944300-203': 'Rule 944300 partially detected' + '944300-204': 'Rule 944300 partially detected' + '944300-205': 'Rule 944300 partially detected' + '944300-214': 'Rule 944300 partially detected' + '944300-215': 'Rule 944300 partially detected' + '944300-216': 'Rule 944300 partially detected' + '944300-225': 'Rule 944300 partially detected' + '944300-226': 'Rule 944300 partially detected' + '944300-227': 'Rule 944300 partially detected' + '944300-236': 'Rule 944300 partially detected' + '944300-237': 'Rule 944300 partially detected' + '944300-238': 'Rule 944300 partially detected' + '944300-247': 'Rule 944300 partially detected' + '944300-248': 'Rule 944300 partially detected' + '944300-249': 'Rule 944300 partially detected' + '944300-258': 'Rule 944300 partially detected' + '944300-259': 'Rule 944300 partially detected' + '944300-260': 'Rule 944300 partially detected' + '944300-269': 'Rule 944300 partially detected' + '944300-270': 'Rule 944300 partially detected' + '944300-271': 'Rule 944300 partially detected' + '944300-280': 'Rule 944300 partially detected' + '944300-281': 'Rule 944300 partially detected' + '944300-282': 'Rule 944300 partially detected' + '944300-291': 'Rule 944300 partially detected' + '944300-292': 'Rule 944300 partially detected' + '944300-293': 'Rule 944300 partially detected' + '944300-302': 'Rule 944300 partially detected' + '944300-303': 'Rule 944300 partially detected' + '944300-304': 'Rule 944300 partially detected' + '944300-313': 'Rule 944300 partially detected' + '944300-314': 'Rule 944300 partially detected' + '944300-315': 'Rule 944300 partially detected' + '944300-324': 'Rule 944300 partially detected' + '944300-325': 'Rule 944300 partially detected' + '944300-326': 'Rule 944300 partially detected' + '949110-3': 'Rule 949110 not detected' + '951110-0': 'RESPONSE_BODY Rule. Not detected' + '951120-0': 'RESPONSE_BODY Rule. Not detected' + '951130-0': 'RESPONSE_BODY Rule. Not detected' + '951140-0': 'RESPONSE_BODY Rule. Not detected' + '951150-0': 'RESPONSE_BODY Rule. Not detected' + '951160-0': 'RESPONSE_BODY Rule. Not detected' + '951170-0': 'RESPONSE_BODY Rule. Not detected' + '951180-0': 'RESPONSE_BODY Rule. Not detected' + '951190-0': 'RESPONSE_BODY Rule. Not detected' + '951200-0': 'RESPONSE_BODY Rule. Not detected' + '951210-0': 'RESPONSE_BODY Rule. Not detected' + '951220-0': 'RESPONSE_BODY Rule. Not detected' + '951230-0': 'RESPONSE_BODY Rule. Not detected' + '951240-0': 'RESPONSE_BODY Rule. Not detected' + '951250-0': 'RESPONSE_BODY Rule. Not detected' + '951260-0': 'RESPONSE_BODY Rule. Not detected' + '954100-0': 'RESPONSE_BODY Rule. Not detected' + '959100-0': 'RESPONSE_BODY Rule. Not detected' + '959100-2': 'RESPONSE_BODY Rule. Not detected' + '980170-0': 'Related to phase 4. Not detected' + '980170-1': 'Related to phase 4. Not detected' diff --git a/ftw/tests.sh b/ftw/tests.sh index dac22ba..940e9d7 100755 --- a/ftw/tests.sh +++ b/ftw/tests.sh @@ -31,4 +31,4 @@ echo -e "\n[Ok] Got status code $status_code, expected 200. Ready to start." FTW_CLOUDMODE=${FTW_CLOUDMODE:-false} -go-ftw run -d coreruleset/tests/regression/tests --config ftw.yml --read-timeout=10s --cloud=$FTW_CLOUDMODE || (echo "Envoy Logs:" && cat /home/envoy/logs/envoy.log) +go-ftw run -d coreruleset/tests/regression/tests --config ftw.yml --read-timeout=10s --cloud=$FTW_CLOUDMODE || (echo "Envoy Logs:" && cat /home/envoy/logs/envoy.log; exit 1) diff --git a/main.go b/main.go index b970cb4..40c638a 100644 --- a/main.go +++ b/main.go @@ -273,7 +273,6 @@ func (ctx *httpContext) OnHttpResponseBody(bodySize int, endOfStream bool) types proxywasm.LogCriticalf("failed to get response body: %v", err) return types.ActionContinue } - _, err = tx.ResponseBodyWriter().Write(body) if err != nil { proxywasm.LogCriticalf("failed to read response body: %v", err) diff --git a/main_test.go b/main_test.go index 2282bd6..4dff827 100644 --- a/main_test.go +++ b/main_test.go @@ -611,7 +611,7 @@ func TestParseCRS(t *testing.T) { opt := proxytest. NewEmulatorOption(). WithVMContext(vm). - WithPluginConfiguration([]byte(`{ "rules": [ {"inline": "Include ftw-config.conf\nInclude coraza.conf-recommended\nInclude crs-setup.conf.example\nInclude crs/*.conf"} ] }`)) + WithPluginConfiguration([]byte(`{ "rules": [ {"inline": "Include ftw-config.conf\nInclude coraza.conf-recommended.conf\nInclude crs-setup.conf.example\nInclude crs/*.conf"} ] }`)) host, reset := proxytest.NewHostEmulator(opt) defer reset() diff --git a/rules/coraza.conf-recommended b/rules/coraza.conf-recommended.conf similarity index 100% rename from rules/coraza.conf-recommended rename to rules/coraza.conf-recommended.conf diff --git a/rules/ftw-config.conf b/rules/ftw-config.conf index 098a0b9..6e6fb34 100644 --- a/rules/ftw-config.conf +++ b/rules/ftw-config.conf @@ -1,3 +1,6 @@ +# Overrides default SecResponseBodyMimeType in order to add application/json (httpbin response Content-Type) +SecResponseBodyMimeType text/plain text/html text/xml application/json + SecAction "id:900005,\ phase:1,\ nolog,\