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
Describe the use case and detail of the change. If this PR addresses an issue on GitHub, make sure to include a link to that issue using one of the [supported keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) here in this description (not in the title of the PR).
3
+
4
+
### Checklist
5
+
Before creating a PR, run through this checklist and mark each as complete.
6
+
7
+
-[ ] I have read the [CONTRIBUTING](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/CONTRIBUTING.md) document
8
+
-[ ] I have added Molecule tests that prove my fix is effective or that my feature works
9
+
-[ ] I have checked that all Molecule tests pass after adding my changes
10
+
-[ ] I have updated any relevant documentation (`defaults/main/*.yml`, `README.md` and `CHANGELOG.md`)
This role installs and configures NGINX App Protect (WAF) for NGINX Plus on your target host.
10
10
@@ -41,144 +41,116 @@ The NGINX App Protect Ansible role supports all platforms supported by [NGINX Pl
41
41
42
42
```yaml
43
43
CentOS:
44
-
versions:
45
-
- 7.4
46
-
- 7.5
47
-
- 7.6
48
-
- 7.7
49
-
- 7.8
44
+
- 7.4+
50
45
RHEL:
51
-
versions:
52
-
- 7.4
53
-
- 7.5
54
-
- 7.6
55
-
- 7.7
56
-
- 7.8
46
+
- 7.4+
57
47
Debian:
58
-
versions:
59
-
- 9.0
60
-
- 9.1
61
-
- 9.2
62
-
- 9.3
63
-
- 9.4
64
-
- 9.5
65
-
- 9.6
66
-
- 9.7
67
-
- 9.8
68
-
- 9.9
69
-
- 9.10
70
-
- 9.11
71
-
- 9.12
72
-
- 9.13
48
+
- 9
73
49
Ubuntu:
74
-
versions:
75
-
- 18.04
50
+
- 18.04
76
51
```
77
52
78
53
Role Variables
79
54
--------------
80
55
81
-
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[defaults/main.yml](./defaults/main.yml)`**.
82
-
56
+
This role has multiple variables. The descriptions and defaults for all these variables can be found in the **[defaults/main.yml](https://github.com/nginxinc/ansible-role-nginx-app-protect/blob/main/defaults/main.yml)**.
83
57
84
58
Dependencies
85
59
------------
86
60
87
-
- Since this role uses the [package_facts](https://docs.ansible.com/ansible/latest/modules/package_facts_module.html) module, on debian-based systems the `python-apt` package must be installed on targeted hosts.
61
+
- Since this role uses the [package_facts](https://docs.ansible.com/ansible/latest/modules/package_facts_module.html) module, on debian-based systems the `python-apt` package must be installed on targeted hosts.
88
62
89
-
- If NGINX+ is *not* already installed on the system, this role will install the version of NGINX+ that is dependent on the version of NGINX App Protect set with the `app_protect_version` variable. If none is specified, the latest version of NGINX+ and NGINX App Protect will be installed.
63
+
- If NGINX Plus is *not* already installed on the system, this role will install the version of NGINX Plus that is dependent on the version of NGINX App Protect set with the `nginx_app_protect_version` variable. If none is specified, the latest version of NGINX Plus and NGINX App Protect will be installed.
90
64
91
-
- When using the `app_protect_version` variable, a specific version of NGINX+ must already be installed on the target system.
65
+
- When using the `nginx_app_protect_version` variable, a specific version of NGINX Plus must already be installed on the target system.
92
66
93
67
Example Playbook
94
68
----------------
95
69
96
-
97
70
This is a sample playbook file for using the role to install NGINX App Protect on NGINX Plus and configure it using basic settings to all `wafs` inventory hosts.
98
71
99
72
A copy of this is in the sample-playbook directory in this repo.
100
73
101
74
First create a file for all the variables as `nginx-app-protect-vars.yml`
75
+
102
76
```yaml
103
77
---
104
-
105
-
# Specify whether you want to maintain your version of NGINX App Protect, upgrade to the latest version, or remove NGINX App Protect.
106
-
# Can be used with `app_protect_version` to achieve fine grained control on which version of NGINX App Protect is installed/used on each playbook execution.
107
-
# Using 'present' will install the latest version (or 'app_protect_version') of NGINX App Protect on a fresh install.
108
-
# Using 'latest' will upgrade NGINX App Protect to the latest version (that matches your 'app_protect_version') of NGINX App Protect on every playbook execution.
109
-
# Using 'absent' will remove NGINX App Protect from your system.
110
-
# Default is present.
111
-
app_protect_state: present
112
-
113
-
# OPTIONAL: Installs a specific version of NGINX App Protect
114
-
app_protect_version: 22
115
-
116
-
# The installation of NGINX App Protect includes a base signature set, which may be out of date.
117
-
# This option installs the latest NGINX App Protect signatures.
118
-
app_protect_install_signatures: true
119
-
120
-
# The installation of NGINX App Protect can include a page of frequently-updated, high-accuracy signatures called Threat Campaigns.
121
-
# This option installs the latest NGINX App Protect Threat Campaigns signatures.
122
-
app_protect_install_threat_campaigns: true
123
-
124
-
# Creates basic configuration files and enables NGINX App Protect on the target host
125
-
app_protect_configure: true
126
-
127
-
# Removes the license (certificate and key) for the NGINX App Protect repositories on the target host(s) when playbook run is complete.
128
-
app_protect_delete_license: true
129
-
130
-
# If you have a RHEL subscription, NGINX App Protect's dependencies will use subscription repos.
131
-
# Otherwise, it will source packages from CentOS' repositories.
132
-
app_protect_use_rhel_subscription_repos: false
133
-
134
-
# For use with the app_protect_configure option to determine if the default security policy will be written to the target host
135
-
# Used when `app_protect_configure: true`.
136
-
app_protect_security_policy_template_enable: true
137
-
138
-
# Default app protect enforcement mode. Values can be `blocking` or `transparent`.
139
-
# Used when `app_protect_configure: true` and `app_protect_security_policy_template_enable: true`.
140
-
security_policy_enforcement_mode: blocking
141
-
142
-
# For use with the app_protect_configure option to determine if the default log policy will be written to the target host.
143
-
# Used when `app_protect_configure: true`.
144
-
app_protect_log_policy_template_enable: true
145
-
146
-
# Which violation types to log. Possible values: all, illegal, blocked
147
-
# Used when `app_protect_configure: true` and `app_protect_log_policy_template_enable: true`.
148
-
log_policy_filter_request_type: all
149
-
150
-
# For use with the app_protect_configure option to determine if the sample nginx.conf will be written to the target host.
151
-
# Since this can be dangerous, this value is default to false in the role defaults.
152
-
# Used when `app_protect_configure: true`.
153
-
nginx_conf_template_enable: true
154
-
155
-
# For use with the app_protect_configure option to determine the syslog target to be injected
156
-
# into the default log policy that will be written to the target host.
157
-
# Used when `nginx_conf_template_enable: true`.
158
-
log_policy_syslog_target: 10.1.1.8:5144
159
-
160
-
# DEPRECATED: A proxy pass workload used in the sample nginx.conf for demo purposes.
161
-
# Will be removed from this role in the future.
162
-
# Used when `nginx_conf_template_enable: true`.
163
-
nginx_demo_workload: http://10.1.10.105:8080
164
-
165
-
# The location of the certificate and key to be used when downloading the packages onto the host
# Specify whether you want to maintain your version of NGINX App Protect, upgrade to the latest version, or remove NGINX App Protect.
79
+
# Can be used with `nginx_app_protect_version` to achieve fine grained control on which version of NGINX App Protect is installed/used on each playbook execution.
80
+
# Using 'present' will install the latest version (or 'nginx_app_protect_version') of NGINX App Protect on a fresh install.
81
+
# Using 'latest' will upgrade NGINX App Protect to the latest version (that matches your 'nginx_app_protect_version') of NGINX App Protect on every playbook execution.
82
+
# Using 'absent' will remove NGINX App Protect from your system.
83
+
# Default is present.
84
+
nginx_app_protect_state: present
85
+
86
+
# OPTIONAL: Installs a specific version of NGINX App Protect
87
+
nginx_app_protect_version: 22
88
+
89
+
# The installation of NGINX App Protect includes a base signature set, which may be out of date.
90
+
# This option installs the latest NGINX App Protect signatures.
91
+
nginx_app_protect_install_signatures: true
92
+
93
+
# The installation of NGINX App Protect can include a page of frequently-updated, high-accuracy signatures called Threat Campaigns.
94
+
# This option installs the latest NGINX App Protect Threat Campaigns signatures.
95
+
nginx_app_protect_install_threat_campaigns: true
96
+
97
+
# Creates basic configuration files and enables NGINX App Protect on the target host
98
+
nginx_app_protect_configure: true
99
+
100
+
# Removes the license (certificate and key) for the NGINX App Protect repositories on the target host(s) when playbook run is complete.
101
+
nginx_app_protect_delete_license: true
102
+
103
+
# If you have a RHEL subscription, NGINX App Protect's dependencies will use subscription repos.
104
+
# Otherwise, it will source packages from CentOS' repositories.
0 commit comments