NeusoftSecurity / SEnginx

Security-Enhanced nginx by Neusoft corporation.

Home Page:www.senginx.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEnginx 1.5.11 configuration bug for '/naxsi/naxsi_src' [optional module]

peterbowey opened this issue · comments

Please consider this patch for auto/install to overcome a compile error if the '/naxsi/naxsi_src' [optional module] is not enabled.

The patch is for the file /auto/install

        test -d '\$(DESTDIR)$NGX_PREFIX/html' \
                || cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'

-        test -d '\$(DESTDIR)$NGX_PREFIX/naxsi' || mkdir -p '\$(DESTDIR)$NGX_PREFIX/naxsi'
-        cp -R 3rd-party/naxsi/nx_util '\$(DESTDIR)$NGX_PREFIX/naxsi/'
-        cp -R 3rd-party/naxsi/naxsi_config '\$(DESTDIR)$NGX_PREFIX/naxsi/'
-        sed -i 's#naxsi_core_rules=.*#naxsi_core_rules=\$(DESTDIR)$NGX_PREFIX/naxsi/naxsi_config/naxsi_core.rules#' '\$(DESTDIR)$NGX_PREFIX/naxsi/nx_util/nx_util.conf'
-        sed -i 's#data_dir=.*#data_dir=\$(DESTDIR)$NGX_PREFIX/naxsi/nx_util/nx_datas#' '\$(DESTDIR)$NGX_PREFIX/naxsi/nx_util/nx_util.conf'
END


if test -n "$NGX_ERROR_LOG_PATH"; then
    cat << END                                                >> $NGX_MAKEFILE

        test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' || \
                mkdir -p '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`'
END

fi

Otherwise, without the optional '/naxsi/naxsi_src' module compiling will fail with this error:

test -d '/root/rpmbuild/BUILDROOT/nginx-1.5.12-1.fc20.x86_64/usr/share/nginx/naxsi' || mkdir -p '/root/rpmbuild/BUILDROOT/nginx-1.5.12-1.fc20.x86_64/usr/share/nginx/naxsi'
cp -R 3rd-party/naxsi/nx_util '/root/rpmbuild/BUILDROOT/nginx-1.5.12-1.fc20.x86_64/usr/share/nginx/naxsi/'
cp: cannot stat '3rd-party/naxsi/nx_util': No such file or directory
make[1]: *** [install] Error 1

if naxsi is compiled, the naxsi related files need to be installed into where SEnginx is installed. so you can't just simply remove these lines.

Thanks Paul,

I did realize that - after I did some more 'live' tests.

So there are some 'conditional' dependencies here with SEnginx.

In fact, I found the live run-time for SEnginx 'fails' with 'worker process exited on signal 11' if I even try to remove some of those 'third-party' modules. (I did not expect this..)

Issue closed.