diff --git a/.github/workflows/configure-rules-for-test.sh b/.github/workflows/configure-rules-for-test.sh index 6b3afd6..d29e285 100755 --- a/.github/workflows/configure-rules-for-test.sh +++ b/.github/workflows/configure-rules-for-test.sh @@ -6,7 +6,8 @@ set -e conf_file="${1}" -env_file="${2}" +readme_file="${2}" +env_file="${3}" if [ -f "${env_file}" ]; then rm "${env_file}" @@ -19,6 +20,12 @@ while read -r line; do var_name="$(cut -d'|' -f2 <<< "${line}")" test_value="$(cut -d'|' -f5 <<< "${line}")" + + if ! grep -q "${var_name}" "${readme_file}"; then + echo "Failed to find environment variable `${var_name}` in README." + exit 1 + fi + echo "Setting ${var_name}=${test_value}" echo "${var_name}=${test_value}" >> "${env_file}" done < "${conf_file}" diff --git a/.github/workflows/verifyimage.yml b/.github/workflows/verifyimage.yml index 9de7b95..9cc363e 100644 --- a/.github/workflows/verifyimage.yml +++ b/.github/workflows/verifyimage.yml @@ -64,7 +64,8 @@ jobs: run: | . .github/workflows/configure-rules-for-test.sh \ src/opt/modsecurity/configure-rules.conf \ - "$(pwd)/${{ matrix.target }}.env" + README.md \ + "${{ matrix.target }}.env" echo "Starting container ${{ matrix.target }}" docker run \ --pull "never" \ diff --git a/src/opt/modsecurity/configure-rules.conf b/src/opt/modsecurity/configure-rules.conf index 103f59a..287b7d9 100644 --- a/src/opt/modsecurity/configure-rules.conf +++ b/src/opt/modsecurity/configure-rules.conf @@ -10,8 +10,8 @@ false|BLOCKING_PARANOIA|900000|blocking_paranoia_level|4 true|EXECUTING_PARANOIA|900001|executing_paranoia_level|4 false|DETECTION_PARANOIA|900001|detection_paranoia_level|4 false|ENFORCE_BODYPROC_URLENCODED|900010|enforce_bodyproc_urlencoded|0 -false|INBOUND_ANOMALY|900110|inbound_anomaly_score_threshold|6 -false|OUTBOUND_ANOMALY|900110|outbound_anomaly_score_threshold|6 +false|ANOMALY_INBOUND|900110|inbound_anomaly_score_threshold|6 +false|ANOMALY_OUTBOUND|900110|outbound_anomaly_score_threshold|6 false|ALLOWED_METHODS|900200|allowed_methods|GET OPTIONS false|ALLOWED_REQUEST_CONTENT_TYPE|900220|allowed_request_content_type|application/json false|ALLOWED_REQUEST_CONTENT_TYPE_CHARSET|900280|allowed_request_content_type_charset|utf-8