Skip to content

Commit 578585b

Browse files
authored
Support the latest NGINX App Protect DoS directives (#277)
1 parent b4dc63b commit 578585b

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENHANCEMENTS:
88
* Add support for the latest NGINX Plus R26 directives:
99
* `auth_jwt_require` now allows you to optionally set the `error` code you wish to return.
1010
* `health_check` now lets you set a `keepalive_time`.
11+
* Add support for the latest NGINX App Protect DoS directives (`app_protect_dos_arb_fqdn`, `app_protect_dos_api`, and `app_protect_dos_accelerated_mitigation`).
1112

1213
BUG FIXES:
1314

defaults/main/template.yml

+3
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ nginx_config_http_template:
348348
enable: true # Required
349349
uri: example.com
350350
port: 80
351+
arb_fqdn: 192.168.1.10 # Available only in the 'http' context
352+
api: false # Available only in the 'location' context
353+
accelerated_mitigation: false # Available only in the 'http' context
351354
proxy: # Configure proxy settings
352355
bind: # Set to 'false' and remove/comment nested variables to disable proxy_bind
353356
address: 0.0.0.0 # Required

molecule/plus/converge.yml

+12
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@
161161
failure_mode_action: pass
162162
cookie_seed: testseed
163163
compressed_requests_action: drop
164+
app_protect_dos:
165+
liveliness:
166+
enable: true
167+
uri: /app_protect_dos_liveliness
168+
port: 8090
169+
readiness:
170+
enable: true
171+
uri: /app_protect_dos_readiness
172+
port: 8090
173+
arb_fqdn: 192.168.1.10
174+
accelerated_mitigation: false
164175
grpc:
165176
bind:
166177
address: $remote_addr
@@ -396,6 +407,7 @@
396407
path: /etc/app_protect_dos/log-default.json
397408
dest: syslog:server=10.1.1.1:514
398409
monitor: http://10.1.1.1:5000/monitor
410+
api: true
399411
auth_jwt:
400412
enable: false
401413
leeway: 0s

templates/http/app_protect.j2

+13-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ app_protect_cookie_seed {{ app_protect_waf['cookie_seed'] }};
1717
{% if app_protect_waf['compressed_requests_action'] is defined and app_protect_waf['compressed_requests_action'] in ['pass', 'drop'] %}{# 'app_protect_compressed_requests_action' directive is only available in the 'http' context #}
1818
app_protect_compressed_requests_action {{ app_protect_waf['compressed_requests_action'] }};
1919
{% endif %}
20-
{% if app_protect_waf['reconnect_period_seconds'] is defined and app_protect_waf['reconnect_period_seconds'] is number %}{# 'app_protect_reconnect_period_seconds' directive is only available in the 'http' context #}
21-
app_protect_reconnect_period_seconds {{ app_protect_waf['reconnect_period_seconds'] }};
22-
{% endif %}
2320
{% if app_protect_waf['request_buffer_overflow_action'] is defined and app_protect_waf['request_buffer_overflow_action'] in ['pass', 'drop'] %}{# 'app_protect_request_buffer_overflow_action' directive is only available in the 'http' context #}
2421
app_protect_request_buffer_overflow_action {{ app_protect_waf['request_buffer_overflow_action'] }};
2522
{% endif %}
@@ -30,6 +27,9 @@ app_protect_user_defined_signatures {{ signature }};
3027
app_protect_user_defined_signatures {{ app_protect_waf['user_defined_signatures'] }};
3128
{% endfor %}
3229
{% endif %}
30+
{% if app_protect_waf['reconnect_period_seconds'] is defined and app_protect_waf['reconnect_period_seconds'] is number %}{# 'app_protect_reconnect_period_seconds' directive is only available in the 'http' context #}
31+
app_protect_reconnect_period_seconds {{ app_protect_waf['reconnect_period_seconds'] }};
32+
{% endif %}
3333
{% if app_protect_waf['enable'] is defined and app_protect_waf['enable'] is boolean %}
3434
app_protect_enable {{ app_protect_waf['enable'] | ternary('on', 'off') }};
3535
{% endif %}
@@ -73,7 +73,16 @@ app_protect_dos_security_log {{ app_protect_dos['security_log']['path'] }} {{ ap
7373
app_protect_dos_liveness {{ app_protect_dos['liveness']['enable'] | ternary('on', 'off') }}{{ (' uri:' + app_protect_dos['liveness']['uri'] | string) if app_protect_dos['liveness']['uri'] is defined }}{{ (' port:' + app_protect_dos['liveness']['port'] | string) if app_protect_dos['liveness']['port'] is defined }};
7474
{% endif %}
7575
{% if app_protect_dos['readiness']['enable'] is defined and app_protect_dos['readiness'] is boolean %}{# 'app_protect_dos_readiness' directive is only available in the 'http' context #}
76-
app_protect_dos_readiness {{ app_protect_dos['readiness'] | ternary('on', 'off') }}{{ (' uri:' + app_protect_dos['readiness']['uri'] | string) if app_protect_dos['readiness']['uri'] is defined }}{{ (' port:' + app_protect_dos['readiness']['port'] | string) if app_protect_dos['readiness']['port'] is defined }};
76+
app_protect_dos_readiness {{ app_protect_dos['readiness']['enable'] | ternary('on', 'off') }}{{ (' uri:' + app_protect_dos['readiness']['uri'] | string) if app_protect_dos['readiness']['uri'] is defined }}{{ (' port:' + app_protect_dos['readiness']['port'] | string) if app_protect_dos['readiness']['port'] is defined }};
77+
{% endif %}
78+
{% if app_protect_dos['arb_fqdn'] is defined %}{# 'app_protect_dos_arb_fqdn' directive is only available in the 'http' context #}
79+
app_protect_dos_arb_fqdn {{ app_protect_dos['arb_fqdn'] }};
80+
{% endif %}
81+
{% if app_protect_dos['api'] is defined and app_protect_dos['api'] is boolean and app_protect_dos['api'] | bool %}{# 'app_protect_dos_api' directive is only available in the 'location' context #}
82+
app_protect_dos_api;
83+
{% endif %}
84+
{% if app_protect_dos['accelerated_mitigation'] is defined and app_protect_dos['accelerated_mitigation'] is boolean %}{# 'app_protect_dos_accelerated_mitigation' directive is only available in the 'http' context #}
85+
app_protect_dos_accelerated_mitigation {{ app_protect_dos['accelerated_mitigation'] | ternary('on', 'off') }};
7786
{% endif %}
7887

7988
{% endmacro %}

0 commit comments

Comments
 (0)