From 6a3a7305731280f16b2cf0070ef8106857339916 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Sat, 14 Nov 2026 15:52:38 +0100 Subject: [PATCH] docs: follow-up nits on log paths, YAJL_LIB and CRS reporting link - README: a debug-log directory that does not exist also makes a reload fail; nginx then keeps running with the old configuration. - README: the directory only has to be writable by the user nginx is started as when the log file does not exist yet. - README: YAJL_LIB becomes -L/-lyajl linker flags and does not work for MSVC builds. - SECURITY.md: link CRS to its "Report a vulnerability" form, like the libmodsecurity entry. Follow-up to #406. --- README.md | 32 +++++++++++++++++--------------- SECURITY.md | 2 +- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 36b859c..0fe7092 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,12 @@ If libmodsecurity is not installed in the system library path or in location, set `YAJL_LIB` to the directory that contains it (not to the library file); `YAJL_LIB` is only honoured together with `MODSECURITY_INC` / `MODSECURITY_LIB` and is ignored when the library is auto-discovered (including -from `/usr/local/modsecurity`). On Linux, set `NGX_IGNORE_RPATH=YES` to avoid -embedding the library path in the resulting binary; the dynamic loader then has -to find libmodsecurity at runtime, for example through `ld.so.conf` or -`LD_LIBRARY_PATH`. On platforms where nginx uses `-R` (such as Solaris), the -path is always embedded. +from `/usr/local/modsecurity`). `config` turns it into `-L`/`-lyajl` linker +flags, so it does not work for MSVC builds. On Linux, set +`NGX_IGNORE_RPATH=YES` to avoid embedding the library path in the resulting +binary; the dynamic loader then has to find libmodsecurity at runtime, for +example through `ld.so.conf` or `LD_LIBRARY_PATH`. On platforms where nginx +uses `-R` (such as Solaris), the path is always embedded. For building on Windows with MSVC, see [win32/README.md](win32/README.md). @@ -144,16 +145,17 @@ server { ``` Replace `/path/to/modsec_debug.log` with a real path. The directory must -already exist, otherwise the rules fail to load and nginx does not start. The -debug log is opened by the nginx master process (usually running as root) when -the configuration is loaded, so the directory must be writable by the user -nginx is started as, and neither it nor any of its parent directories may be -writable by anyone else (in particular not by the worker user, for example -`www-data` or `nginx`, nor through a group or ACL): anyone who can write -there could replace the log file, or a directory on its path, with a symlink -and have root append request data to any file. The debug log contains request -data, so also keep the directory and file unreadable by unprivileged users (see -the +already exist, otherwise the rules fail to load and nginx refuses to start, or, +on a reload, rejects the new configuration and keeps running with the old one. +The debug log is opened by the nginx master process (usually running as root) +when the configuration is loaded, so unless the log file already exists, the +directory must be writable by the user nginx is started as. Neither the +directory nor any of its parent directories may be writable by anyone else (in +particular not by the worker user, for example `www-data` or `nginx`, nor +through a group or ACL): anyone who can write there could replace the log file, +or a directory on its path, with a symlink and have root append request data to +any file. The debug log contains request data, so also keep the directory and +file unreadable by unprivileged users (see the [Hardening Notes](SECURITY.md#hardening-notes)). modsecurity_transaction_id diff --git a/SECURITY.md b/SECURITY.md index 999b317..5171392 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -30,7 +30,7 @@ related projects to them directly: - **libmodsecurity** (rule engine, operators, transformations, body parsers): [owasp-modsecurity/ModSecurity](https://github.com/owasp-modsecurity/ModSecurity/security/advisories/new) - **OWASP CRS** (rule false negatives/bypasses): - [coreruleset/coreruleset](https://github.com/coreruleset/coreruleset/security/policy) + [coreruleset/coreruleset](https://github.com/coreruleset/coreruleset/security/advisories/new) If you are not sure which component is at fault, report it here and we will route it.