Skip to content

Commit

Permalink
Merge pull request #321 from franbuehler/fix-anomaly-variables
Browse files Browse the repository at this point in the history
fix: set correct variable names for ANOMALY_INBOUND and OUTBOUND
  • Loading branch information
fzipi authored Jan 31, 2025
2 parents 3055241 + 2d0f4a7 commit b745189
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/configure-rules-for-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
3 changes: 2 additions & 1 deletion .github/workflows/verifyimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
4 changes: 2 additions & 2 deletions src/opt/modsecurity/configure-rules.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b745189

Please sign in to comment.