You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ModSecurity-nginx connector is the connection point between nginx and libmodsecurity (ModSecurity v3). Said another way, this project provides a communication channel between nginx and libmodsecurity. This connector is required to use LibModSecurity with nginx.
8
9
9
-
The ModSecurity-nginx connector is the connection point between Nginx and libmodsecurity (ModSecurity v3). Said another way, this project provides a communication channel between Nginx and libmodsecurity. This connector is required to use LibModSecurity with Nginx.
10
-
11
-
The ModSecurity-nginx connector takes the form of an Nginx module. The module simply serves as a layer of communication between Nginx and ModSecurity.
10
+
The ModSecurity-nginx connector takes the form of an nginx module. The module simply serves as a layer of communication between nginx and ModSecurity.
12
11
13
12
Notice that this project depends on libmodsecurity rather than ModSecurity (version 2.9 or less).
14
-
libmodsecurity has not reached a stable release candidate, thus, use this project with caution.
15
13
16
14
### What is the difference between this project and the old ModSecurity add-on for nginx?
17
15
18
16
The old version uses ModSecurity standalone, which is a wrapper for
19
17
Apache internals to link ModSecurity to nginx. This current version is closer
20
18
to nginx, consuming the new libmodsecurity which is no longer dependent on
21
-
Apache. As a result, This current version has less dependencies, fewer bugs, and is faster. In addition, Some new functionality is also provided - such as the possibility of use of global rules configuration with per directory/location customizations (e.g. SecRuleRemoveById).
19
+
Apache. As a result, this current version has less dependencies, fewer bugs, and is faster. In addition, some new functionality is also provided - such as the possibility of use of global rules configuration with per directory/location customizations (e.g. SecRuleRemoveById).
22
20
23
21
24
22
# Compilation
25
23
26
24
Before compile this software make sure that you have libmodsecurity installed.
27
25
You can download it from the [ModSecurity git repository](https://github.com/SpiderLabs/ModSecurity). For information pertaining to the compilation and installation of libmodsecurity please consult the documentation provided along with it.
28
26
29
-
With libmodsecurity installed, you can proceed with the installation of the ModSecurity-nginx connector, which follow the Nginx 3rd party module installation procedure:
27
+
With libmodsecurity installed, you can proceed with the installation of the ModSecurity-nginx connector, which follow the nginx 3rd party module installation procedure:
Further information about nginx 3rd party add-ons support are available here:
36
34
http://wiki.nginx.org/3rdPartyModules
37
35
36
+
38
37
# Usage
39
38
40
-
ModSecurity for Nginx extends your Nginx configuration directives. It adds four
41
-
new directives and they are:
39
+
ModSecurity for nginx extends your nginx configuration directives.
40
+
It adds four new directives and they are:
42
41
43
-
modsecurity [On|Off] - This directive turns on or off ModSecurity functionality. Note that
44
-
this configuration directive is no longer related to the SecRule state. Instead, it now serves solely as an Nginx flag to enable or disable the module.
42
+
modsecurity
43
+
-----------
44
+
**syntax:***modsecurity on | off*
45
45
46
-
modsecurity_rules_file [<pathtorulesfile>] - This directive indicates the location of the modsecurity configuration file.
46
+
**context:***http, server, location*
47
47
48
-
modsecurity_rules_remote [server-key][<urltorules>] - This directive is used to indicate from where (on the internet) a modsecurity configuration file will be downloaded. It also specifies the key that will be used to authenticate to that server.
48
+
**default:***off*
49
49
50
-
modsecurity_rules [<modsecurityrule>] - This directive allows for the direct inclusion of a ModSecurity rule into the Nginx configuration.
50
+
Turns on or off ModSecurity functionality.
51
+
Note that this configuration directive is no longer related to the SecRule state.
52
+
Instead, it now serves solely as an nginx flag to enable or disable the module.
51
53
54
+
modsecurity_rules_file
55
+
----------------------
56
+
**syntax:***modsecurity_rules_file <path to rules file>*
52
57
53
-
### Usage example: injecting rules within nginx configuration
As an open source project we invite (and encourage) anyone from the community to contribute to our project. This may take the form of: new
102
129
functionality, bug fixes, bug reports, beginners user support, and anything else that you
103
130
are willing to help with. Thank you.
104
131
132
+
105
133
## Providing Patches
106
134
107
135
We prefer to have your patch within the GitHub infrastructure to facilitate our
@@ -129,7 +157,7 @@ You may also take a look at recent bug reports and open issues to get an idea of
129
157
### Testing your patch
130
158
131
159
Along with the manual testing, we strongly recommend that you to use the nginx test
132
-
utility to make sure that you patch does not adversely affect the behavior or performance of Nginx.
160
+
utility to make sure that you patch does not adversely affect the behavior or performance of nginx.
133
161
134
162
The nginx tests are available on: http://hg.nginx.org/nginx-tests/
135
163
@@ -142,14 +170,14 @@ $ cd /path/to/nginx/test/repository
142
170
$ TEST_NGINX_BINARY=/path/to/your/nginx prove .
143
171
```
144
172
145
-
If you are facing problems getting your added functionality to pass all the Nginx tests, feel free to contact us or the nginx mailing list at: http://nginx.org/en/support.html
173
+
If you are facing problems getting your added functionality to pass all the nginx tests, feel free to contact us or the nginx mailing list at: http://nginx.org/en/support.html
146
174
147
175
### Debugging
148
176
149
177
We respect the nginx debugging schema. By using the configuration option
150
-
“--with-debug” during the nginx configuration you will also be enabling the
178
+
"--with-debug" during the nginx configuration you will also be enabling the
151
179
connector's debug messages. Core dumps and crashes are expected to be debugged
152
-
in the same fashion that is used to debug Nginx. For further information,
180
+
in the same fashion that is used to debug nginx. For further information,
153
181
please check the nginx debugging information: http://wiki.nginx.org/Debugging
154
182
155
183
@@ -169,11 +197,13 @@ version of your libmodsecurity and the version of the nginx connector you are ru
169
197
Please do not publicly report any security issue. Instead, contact us at:
170
198
[email protected] to report the issue. Once the problem is fixed we will provide you with credit for the discovery.
171
199
200
+
172
201
## Feature Request
173
202
174
203
We would love to discuss any ideas that you may have for a new feature. Please keep in mind this is a community driven project so be sure to contact the community via the mailing list to get feedback first. Alternatively,
175
204
feel free to open GitHub issues requesting for new features. Before opening a new issue, please check if there is an existing feature request for the desired functionality.
176
205
206
+
177
207
## Packing
178
208
179
209
Having our packages in distros on time is something we highly desire. Let us know if
0 commit comments