Skip to content

Images: Remove redundant ModSecurity-nginx patch. #13740

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

Merged
Merged
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
15 changes: 0 additions & 15 deletions images/nginx/rootfs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -410,21 +410,6 @@ Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-980-CORRELATION.conf
Include /etc/nginx/owasp-modsecurity-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
" > /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf

# NGINX compiles a small test program to check if an added module works as expected.
#
# ModSecurity-nginx provides 'printf("hello");' as a test, but newer versions of GCC,
# as included in Alpine 3.22, do not allow implicit declaration of function 'printf':
#
# objs/autotest.c:7:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
#
# For this reason we replace 'printf("hello");' by 'msc_init();', which is always available.
#
# This fix is taken from a PR, that has been proposed to the ModSecurity-nginx project:
#
# https://github.com/owasp-modsecurity/ModSecurity-nginx/pull/275
#
sed -i "s/ngx_feature_test='printf(\"hello\");'/ngx_feature_test='msc_init();'/" $BUILD_PATH/ModSecurity-nginx/config

# build nginx
cd "$BUILD_PATH/nginx-$NGINX_VERSION"

Expand Down