Skip to content

Commit 56d14a7

Browse files
authored
doc: update doc with new features
1 parent 569e6eb commit 56d14a7

File tree

1 file changed

+26
-34
lines changed

1 file changed

+26
-34
lines changed

README.md

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# 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
23

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)
145

156
There are a number of libraries and packages which ModSecurity3 depends on and will be installed via this role.
167

@@ -20,11 +11,7 @@ Nginx support is primarily provided by the dependent role `ansible-role-nginx` b
2011

2112
https://github.com/jdauphant/ansible-role-nginx
2213

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.
2815

2916
## Requirements
3017

@@ -35,26 +22,33 @@ Install any required [Ansible](https://www.ansible.com) roles from `requirements
3522
```bash
3623
ansible-galaxy install -r requirements.yml
3724
```
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-
4125
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:
4226

4327
```yml
44-
- src: perryk.nginx_modsec3_crs3
28+
- src: coopdevs.nginx_modsec3_crs
4529

46-
- src: https://github.com/jdauphant/ansible-role-nginx
47-
version: master
30+
- src: jdauphant.nginx
31+
version: v2.21.2
4832
```
4933
50-
5134
## Role Variables
5235
5336
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.
5437
55-
There are currently no variables of note being set.
38+
Specific-role vars are explained below, with their default value set.
5639
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.
5852
5953
6054
## Example Playbook
@@ -75,15 +69,12 @@ Example playbook calling the role adding and enabling ModSecurity for the defaul
7569
- ngx_http_modsecurity_module
7670
nginx_sites:
7771
default:
78-
- listen 80
79-
- server_name _
80-
- "Modsecurity on"
81-
- "modsecurity_rules_file /etc/nginx/modsec/main.conf"
82-
- root "/usr/share/nginx/html"
83-
- index index.html
84-
72+
- ...
73+
- modsecurity on;
74+
- modsecurity_rules_file /etc/nginx/modsec/main.conf;
75+
- ...
8576
roles:
86-
- perryk.nginx-modsec3-crs3
77+
- coopdevs.nginx_modsec3_crs
8778
```
8879
8980
# License
@@ -93,4 +84,5 @@ MIT
9384
## Author Information
9485
9586
Perry Kollmorgen - https://github.com/perryk
87+
Coopdevs - https://coopdevs.org
9688

0 commit comments

Comments
 (0)