Skip to content

Commit 91861fb

Browse files
authored
Advanced monitor updates for NAP DoS 2.0 (#182)
1 parent 884af02 commit 91861fb

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ FEATURES:
200200
* Explicitly list Jinja2 `2.11.3` as a requirement, as well as detail the minimum supported version (`2.11.x`).
201201
* Implement Release Drafter.
202202
* Add support for configuring NGINX App Protect DoS (Denial of Service) module and directives.
203-
* Add support for configuring the NGINX Rest API module and the NGINX stub status module
203+
* Add support for configuring the NGINX Rest API module and the NGINX stub status module.
204204

205205
ENHANCEMENTS:
206206

molecule/plus/converge.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
main:
2525
load_module:
2626
- modules/ngx_http_app_protect_module.so
27-
# - modules/ngx_http_app_protect_dos_module.so
27+
- modules/ngx_http_app_protect_dos_module.so
2828
user: nginx
2929
worker_processes: auto
3030
error_log:
@@ -311,13 +311,17 @@
311311
dest: syslog:server=10.1.1.1:514
312312
- path: /etc/app_protect/conf/log_default.json
313313
dest: syslog:server=10.1.1.2:514
314-
# app_protect_dos:
315-
# enable: true
316-
# policy_file: /etc/app_protect/conf/BADOSDefaultPolicy.json
317-
# security_log_enable: true
318-
# security_log:
319-
# path: /etc/app_protect_dos/log-default.json
320-
# dest: syslog:server=10.1.1.1:514
314+
app_protect_dos:
315+
enable: true
316+
policy_file: /etc/app_protect/conf/BADOSDefaultPolicy.json
317+
security_log_enable: true
318+
security_log:
319+
path: /etc/app_protect_dos/log-default.json
320+
dest: syslog:server=10.1.1.1:514
321+
monitor:
322+
uri: http://10.1.1.1:5000/monitor
323+
protocol: http2
324+
timeout: 10
321325
auth_jwt:
322326
enable:
323327
realm: realm
@@ -346,6 +350,14 @@
346350
dest: syslog:server=10.1.1.1:514
347351
- path: /etc/app_protect/conf/log_default.json
348352
dest: syslog:server=10.1.1.2:514
353+
app_protect_dos:
354+
enable: true
355+
policy_file: /etc/app_protect/conf/BADOSDefaultPolicy.json
356+
security_log_enable: true
357+
security_log:
358+
path: /etc/app_protect_dos/log-default.json
359+
dest: syslog:server=10.1.1.1:514
360+
monitor: http://10.1.1.1:5000/monitor
349361
auth_jwt:
350362
enable: false
351363
leeway: 0s

molecule/plus/prepare.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
name: nginxinc.nginx_app_protect
3636
vars:
3737
nginx_app_protect_waf_enable: true
38-
nginx_app_protect_dos_enable: false
38+
nginx_app_protect_dos_enable: true
3939
nginx_app_protect_setup_license: false
4040
nginx_app_protect_remove_license: false
4141
nginx_app_protect_install_signatures: false

templates/http/app_protect.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ app_protect_dos_policy_file {{ app_protect_dos['policy_file'] }};
6060
{% if app_protect_dos['name'] is defined %}
6161
app_protect_dos_name {{ app_protect_dos['name'] }};
6262
{% endif %}
63-
{% if app_protect_dos['monitor'] is defined %}
63+
{% if app_protect_dos['monitor'] is defined and app_protect_dos['monitor'] is mapping %}
64+
app_protect_dos_monitor uri={{ app_protect_dos['monitor']['uri'] | ternary(app_protect_dos['monitor']['uri'], app_protect_dos['monitor']) }}{{ app_protect_dos['monitor']['protocol'] | ternary((' protocol=' + app_protect_dos['monitor']['protocol'] | string), '') }}{{ app_protect_dos['monitor']['timeout'] | ternary((' timeout=' + app_protect_dos['monitor']['timeout'] | string), '') }};
65+
{% elif app_protect_dos['monitor'] is defined %}
6466
app_protect_dos_monitor {{ app_protect_dos['monitor'] }};
6567
{% endif %}
6668
{% if app_protect_dos['security_log_enable'] is defined and app_protect_dos['security_log_enable'] is boolean %}

0 commit comments

Comments
 (0)