Skip to content

Commit 8e30899

Browse files
committed
docs: corrections
1 parent 2d79e89 commit 8e30899

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

content/blog/2025-05-21-modsecurity-nginx-connector-1.0.4.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ date: '2025-05-21T00:00:00+02:00'
44
author: airween
55
---
66

7-
The OWASP ModSecurity team is pleased to announce the release of versions of ModSecurity-nginx connector, 1.0.4. This version includes a mixture of new features and bug fixes.
7+
The OWASP ModSecurity team is pleased to announce the release of ModSecurity-nginx connector version 1.0.4. This version includes a mixture of new features and bug fixes.
88

99
<!--more-->
1010

11-
The latest release was almost three years ago, meanwhile some relevant features were added to the connector.
11+
The previous version has been released almost three years ago, and meanwhile some important features were added to the connector.
1212

1313
##### Contributors:
1414

@@ -19,27 +19,27 @@ The latest release was almost three years ago, meanwhile some relevant features
1919
* added a workflow for Github CI (@theseion, @airween)
2020
* added Windows port (@eduar-hte)
2121
* fix recovery context after internal redirect (@liudongmiao, @airween)
22-
* set correct hostname in log produced by Nginx (@airween)
22+
* set correct hostname in log produced by nginx (@airween)
2323

24-
#### Important change in log format
24+
#### Important change in the log format
2525

26-
Please note that there was an important change in logformat. Here is the explanation what changed.
27-
Old behavior: if ModSecurity catches an attack then it produces log entries. The problem is that the `[hostname]` field contains the server's IP address - which carries no information at all:
26+
Please note that there was an important change in log format.
27+
28+
Old behavior: if ModSecurity determines a positive rule match it (generally) produces log entries. The problem is that the `[hostname]` field contains the server's IP address - i.e., the address of the server ModSecurity is running on, which isn't helpful information:
2829

2930
```
3031
ModSecurity: Warning. ... [hostname "18.19.20.21"] [uri "/xmlrpc.php"]...
3132
```
3233

33-
At the end of the line, Nginx (and not ModSecurity) puts other fields, like server and host, but unfortunately those can be truncated if the other parts of line are too long, eg. [data] field by ModSecurity, or request field by Nginx, because **Nginx truncates the log line after 2048 bytes**.
34-
35-
The other advantage of this patch that now the fields will be the same as in case of mod_security2, so parsing the lines (hopefully) will be easier.
34+
At the end of the line, nginx (and not ModSecurity) puts other fields, like `[server]` and `[host]`, but unfortunately those can be truncated if the other parts of line are too long (e.g., the `[data]` field from ModSecurity, or the `[request]` field from nginx), because **nginx truncates the log line after 2048 bytes**.
3635

3736
Here is the new logformat:
38-
3937
```
4038
ModSecurity: Warning. ... [hostname "foobar.com"] [uri "/"] ...
4139
```
4240

43-
Please take a look at the `[hostname]` field, now it contains the `Hostname` field from the request, or if it does not exists then the virtual host's context name (`server`). Don't forget to align your log processor!
41+
The `[hostname]` field now contains the `Host` field from the request, or if it does not exist, the virtual host's context name (`server`). This change ensures that the `[hostname]` field contains helpful information and that the host information will no longer be truncated from long log lines.
42+
43+
The other advantage of this patch that now the fields will be the same as in mod_security2, so parsing the lines will (hopefully) be easier. Remember to update your log parsers to accomodate for this change.
4444

45-
Ervin Hegedüs
45+
Ervin Hegedüs

0 commit comments

Comments
 (0)