Skip to content

Commit 7c3ebf2

Browse files
committed
fix: use per version config file
Signed-off-by: Felipe Zipitria <[email protected]>
1 parent a70cd51 commit 7c3ebf2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/verifyimage.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,17 @@ jobs:
8383

8484
- name: Run ${{ matrix.target }}
8585
run: |
86+
# get the major version from the matrix.target
87+
# Format: apache-debian-3-3-7, apache-alpine-4-18-0, nginx-debian-writable-3-3-7, nginx-alpine-writable-4-18-0
88+
if echo "${{ matrix.target }}" | grep -q "nginx"; then
89+
# nginx format: nginx-debian-writable-3-3-7 (5 parts) -> get $4
90+
CRS_VERSION="v$(echo "${{ matrix.target }}" | awk -F'-' '{print $4}')"
91+
else
92+
# apache format: apache-debian-3-3-7 (4 parts) -> get $3
93+
CRS_VERSION="v$(echo "${{ matrix.target }}" | awk -F'-' '{print $3}')"
94+
fi
8695
. .github/workflows/configure-rules-for-test.sh \
87-
src/opt/modsecurity/configure-rules.conf \
96+
src/opt/modsecurity/configure-rules.${CRS_VERSION}.conf \
8897
README.md \
8998
"${{ matrix.target }}.env"
9099
echo "Starting container ${{ matrix.target }}-verification"

src/opt/modsecurity/configure-rules.v3.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ false|ALLOWED_REQUEST_CONTENT_TYPE|900220|allowed_request_content_type|applicati
1616
false|ALLOWED_REQUEST_CONTENT_TYPE_CHARSET|900280|allowed_request_content_type_charset|utf-8
1717
false|ALLOWED_HTTP_VERSIONS|900230|allowed_http_versions|1.1
1818
false|RESTRICTED_EXTENSIONS|900240|restricted_extensions|.exe/
19-
false|RESTRICTED_HEADERS_BASIC|900250|restricted_headers_basic|/if/
20-
false|RESTRICTED_HEADERS_EXTENDED|900255|restricted_headers_extended|/x-some-header/
19+
false|RESTRICTED_HEADERS_BASIC|900250|restricted_headers|/if/
2120
false|MAX_NUM_ARGS|900300|max_num_args|100
2221
false|ARG_NAME_LENGTH|900310|arg_name_length|200
2322
false|ARG_LENGTH|900320|arg_length|300

0 commit comments

Comments
 (0)