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
# Ansible role for Installing Nginx, compiling ModSecurity3, and installing the OWASP CRS v3 ruleset
1
+
# nginx_modsec3_crs role
2
+
## Ansible role for Installing Nginx, compiling ModSecurity3, and installing the OWASP CRS v3 ruleset
2
3
3
-
ModSecurity3 is a powerful open source cross-platform web application firewall (WAF).
4
-
5
-
https://modsecurity.org/
6
-
7
-
It goes hand in hand with a ruleset known as OWASP CRS.
8
-
9
-
https://modsecurity.org/crs/
10
-
11
-
Additionally both of these go hand in hand with a webserver, either Apache or Nginx, this role only supports Nginx however.
12
-
13
-
https://www.nginx.com
4
+
Forked from @perryk's [ansible-role-nginx-modsec3-crs3](https://github.com/perryk/ansible-role-nginx-modsec3-crs3)
14
5
15
6
There are a number of libraries and packages which ModSecurity3 depends on and will be installed via this role.
16
7
@@ -20,11 +11,7 @@ Nginx support is primarily provided by the dependent role `ansible-role-nginx` b
20
11
21
12
https://github.com/jdauphant/ansible-role-nginx
22
13
23
-
By default this role will install Nginx packages from OS provided repos, this is recommended to be changed to installing from the official Nginx repo instead.
24
-
25
-
This can be done by setting this variable:
26
-
27
-
``` nginx_official_repo: True```
14
+
:warning: jdauphant's nginx role is no longer mantained.
28
15
29
16
## Requirements
30
17
@@ -35,26 +22,33 @@ Install any required [Ansible](https://www.ansible.com) roles from `requirements
35
22
```bash
36
23
ansible-galaxy install -r requirements.yml
37
24
```
38
-
39
-
n.b in particular this role will call certain tasks from the nginx role so be sure to have it installed in the same location as this role and with a specific name of "ansible-role-nginx".
40
-
41
25
i.e this in the requirements.yml file for your project's playbook (not the requirements.yml file for this role) you will need to include both this role and the role mentioned above like this:
Browse the role's [defaults/main.yml](defaults/main.yml) and [vars/main.yml](vars/main.yml) files to see if there is anything you would like to change or need to override by setting in your playbook.
54
37
55
-
There are currently no variables of note being set.
38
+
Specific-role vars are explained below, with their default value set.
56
39
57
-
There are lots of variables however in the nginx role, perhaps the best explanation of these are all the examples in the role [README.md](https://github.com/jdauphant/ansible-role-nginx/blob/master/README.md) file.
40
+
```yaml
41
+
# Enables the modsecurity compilation, installation and configuration if it is not installed
42
+
nginx_modsec3_enabled: True
43
+
# Set the ruleset version
44
+
nginx_modsec3_crs_version: v3.4/dev
45
+
# Force modsecurity task despite it is already installed
46
+
nginx_modsec3_crs3_force_compile: False
47
+
# Enable the block mode (if False, then "Detection Only" mode is set)
48
+
nginx_modsec3_crs3_block_mode: True
49
+
```
50
+
51
+
There are lots of variables more in the nginx role, perhaps the best explanation of these are all the examples in the role [README.md](https://github.com/jdauphant/ansible-role-nginx/blob/master/README.md) file.
58
52
59
53
60
54
## Example Playbook
@@ -75,15 +69,12 @@ Example playbook calling the role adding and enabling ModSecurity for the defaul
0 commit comments