Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
M4tteoP committed Oct 24, 2024
1 parent a935c4a commit 11f2521
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ env:
TINYGO_VERSION: 0.33.0
# Run e2e tests against latest two releases and latest dev
ENVOY_IMAGES: >
envoyproxy/envoy:v1.31-latest
envoyproxy/envoy:v1.30-latest
envoyproxy/envoy:v1.29-latest
envoyproxy/envoy-dev:latest
istio/proxyv2:1.22.1
istio/proxyv2:1.21.3
istio/proxyv2:1.23.3
istio/proxyv2:1.22.6
jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
services:
httpbin:
image: mccutchen/go-httpbin:v2.9.0
image: mccutchen/go-httpbin:v2.15.0
command: [ "/bin/go-httpbin", "-port", "8081" ]
ports:
- 8081:8081
envoy:
depends_on:
- httpbin
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.28-latest}
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.31-latest}
# Entryoint is explicited in order to make the ENVOY_IMAGE compatible also with istio/proxyv2 images
# The latter has as default entrypoint pilot-agent instead of envoy
# See https://github.com/tetratelabs/proxy-wasm-go-sdk/blob/main/.github/workflows/workflow.yaml#L104
Expand Down
2 changes: 1 addition & 1 deletion example/envoy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
depends_on:
- chown
- httpbin
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.28-latest}
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.31-latest}
command:
- -c
- /conf/envoy-config.yaml
Expand Down
7 changes: 3 additions & 4 deletions ftw/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright 2022 The OWASP Coraza contributors
# SPDX-License-Identifier: Apache-2.0

# Stick with go-ftw:0.6.4 until CRS tests new format is merged (https://github.com/coreruleset/coreruleset/pull/3369)
FROM ghcr.io/coreruleset/go-ftw:0.6.4
FROM ghcr.io/coreruleset/go-ftw:1.1.0

RUN apk update && apk add curl

WORKDIR /workspace

# Keep this CRS version aligned with the one embedded in wasmplugin/rules
ADD https://github.com/coreruleset/coreruleset/archive/refs/tags/v4.3.0.tar.gz /workspace/coreruleset/
RUN cd coreruleset && tar -xf v4.3.0.tar.gz --strip-components 1
ADD https://github.com/coreruleset/coreruleset/archive/refs/tags/v4.5.0.tar.gz /workspace/coreruleset/
RUN cd coreruleset && tar -xf v4.5.0.tar.gz --strip-components 1

COPY ftw.yml /workspace/ftw.yml
COPY tests.sh /workspace/tests.sh
Expand Down
8 changes: 4 additions & 4 deletions ftw/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
httpbin:
image: mccutchen/go-httpbin:v2.9.0
albedo:
image: ghcr.io/coreruleset/albedo:0.0.16
chown:
image: alpine:3.16
command:
Expand All @@ -13,8 +13,8 @@ services:
envoy:
depends_on:
- chown
- httpbin
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.28-latest}
- albedo
image: ${ENVOY_IMAGE:-envoyproxy/envoy:v1.31-latest}
command:
- -c
- ${ENVOY_CONFIG:-/conf/envoy-config.yaml}
Expand Down
2 changes: 1 addition & 1 deletion ftw/envoy-config-nowasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ static_resources:
- endpoint:
address:
socket_address:
address: httpbin
address: albedo
port_value: 8080
2 changes: 1 addition & 1 deletion ftw/envoy-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ static_resources:
- endpoint:
address:
socket_address:
address: httpbin
address: albedo
port_value: 8080
2 changes: 2 additions & 0 deletions ftw/ftw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ testoverride:
'934120-39': 'Rule 934120 partially detected. With HTTP/1.1 Envoy return 400. With HTTP/2 Enclosed alphanumerics not detected. Coraza Side'
'932200-13': 'Unfortunate match inside logs against a different rule log. wip'
'930110-7': 'Coraza/CRS side: See https://github.com/corazawaf/coraza/pull/1081'

'980170-3': 'FTW stops at Retrying test once'
8 changes: 7 additions & 1 deletion ftw/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ while [[ "$status_code" -eq "000" ]]; do
exit 1
fi
done
if [[ "$status_code" -ne "200" ]]; then
echo -e "\n[Fail] Unexpected status code $status_code, expected 200. Exiting."
exit 1
fi
echo -e "\n[Ok] Got status code $status_code, expected 200. Ready to start."


FTW_CLOUDMODE=${FTW_CLOUDMODE:-false}

FTW_INCLUDE=$([ "${FTW_INCLUDE}" == "" ] && echo "" || echo "-i ${FTW_INCLUDE}")

/ftw run -d coreruleset/tests/regression/tests --config ftw.yml --read-timeout=10s --cloud=$FTW_CLOUDMODE $FTW_INCLUDE || exit 1
/ftw run -d coreruleset/tests/regression/tests --config ftw.yml --read-timeout=10s --cloud=$FTW_CLOUDMODE $FTW_INCLUDE

0 comments on commit 11f2521

Please sign in to comment.