Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set correct variable names for ANOMALY_INBOUND and OUTBOUND #321

Merged
merged 3 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
fzipi marked this conversation as resolved.
Show resolved Hide resolved
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