Skip to content

Commit d60a6c6

Browse files
authored
Docs/waf v5 docs (#6694)
1 parent 9af8ad1 commit d60a6c6

File tree

2 files changed

+140
-5
lines changed

2 files changed

+140
-5
lines changed

site/content/configuration/security.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ By default, the ServiceAccount has access to all Secret resources in the cluster
3434
### Configure root filesystem as read-only
3535

3636
{{< caution >}}
37-
This feature is not compatible with [NGINX App Protect WAF](https://docs.nginx.com/nginx-app-protect-waf/) or [NGINX App Protect DoS](https://docs.nginx.com/nginx-app-protect-dos/).
37+
This feature is compatible with [NGINX App Protect WAFv5](https://docs.nginx.com/nginx-app-protect-waf-v5/). It is not compatible with [NGINX App Protect WAF](https://docs.nginx.com/nginx-app-protect-waf/) or [NGINX App Protect DoS](https://docs.nginx.com/nginx-app-protect-dos/).
3838
{{< /caution >}}
3939

40-
NGINX Ingress Controller is designed to be resilient against attacks in various ways, such as running the service as non-root to avoid changes to files. We recommend setting filesystems to read-only so that the attack surface is further reduced by limiting changes to binaries and libraries.
40+
NGINX Ingress Controller is designed to be resilient against attacks in various ways, such as running the service as non-root to avoid changes to files. We recommend setting filesystems on all containers to read-only, this includes `nginx-ingress-controller`, though also includes `waf-enforcer` and `waf-config-mgr` when NGINX App Protect WAFv5 is in use. This is so that the attack surface is further reduced by limiting changes to binaries and libraries.
4141

42-
This is not enabled by default, but can be enabled with **Helm** using the [**controller.readOnlyRootFilesystem**]({{< relref "installation/installing-nic/installation-with-helm.md#configuration" >}}) argument.
42+
This is not enabled by default, but can be enabled with **Helm** using the [**readOnlyRootFilesystem**]({{< relref "installation/installing-nic/installation-with-helm.md#configuration" >}}) argument in security contexts on all containers: `nginx-ingress-controller`, `waf_enforcer` and `waf_config_mgr`.
4343

44-
For **Manifests**, uncomment the following sections of the deployment:
44+
For **Manifests**, uncomment the following sections of the deployment and add sections for `waf-enforcer` and `waf-config-mgr` containers:
4545

4646
- `readOnlyRootFilesystem: true`
4747
- The entire **volumeMounts** section
@@ -77,6 +77,9 @@ The block below shows the code you will look for:
7777
# name: nginx-log
7878
```
7979

80+
- Add **waf-enforcer** and **waf-config-mgr** container sections
81+
- Add `readOnlyFilesystem: true` in both containers security context sections
82+
8083
### Prometheus
8184

8285
If Prometheus metrics are [enabled]({{< relref "/logging-and-monitoring/prometheus.md" >}}), we recommend [using HTTPS]({{< relref "configuration/global-configuration/command-line-arguments.md#cmdoption-prometheus-tls-secret" >}}).

site/content/installation/integrations/app-protect-waf-v5/installation.md

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ volumeMounts:
162162

163163
### Enabling WAF v5
164164

165-
Start by setting `controller.appprotect.enable` to `true` in your Helm values. This will the standard App Protect WAF fetatures.
165+
Start by setting `controller.appprotect.enable` to `true` in your Helm values. This will the standard App Protect WAF features.
166166
Afterwords, set `controller.approtect.v5` to `true`.
167167
This ensures that both the `waf-enforcer` and `waf-config-mgr` containers are deployed alongside the NGINX Ingress Controller containers.
168168
These two additional containers are required when using App Protect WAF v5.
@@ -218,6 +218,70 @@ controller:
218218
```
219219
{{< /note >}}
220220

221+
### Configuring `readOnlyRootFilesystem`
222+
223+
Create required volumes:
224+
225+
```yaml
226+
volumes:
227+
- name: nginx-etc
228+
emptyDir: {}
229+
- name: nginx-cache
230+
emptyDir: {}
231+
- name: nginx-lib
232+
emptyDir: {}
233+
- name: nginx-log
234+
emptyDir: {}
235+
- emptyDir: {}
236+
name: app-protect-bd-config
237+
- emptyDir: {}
238+
name: app-protect-config
239+
- emptyDir: {}
240+
name: app-protect-bundles
241+
```
242+
243+
Set `controller.securityContext.readOnlyRootFilesystem` to `true`.
244+
245+
Example Helm values:
246+
247+
```yaml
248+
controller:
249+
...
250+
securityContext:
251+
readOnlyRootFilesystem: true
252+
...
253+
```
254+
255+
Set `controller.appprotect.enforcer.securityContext.readOnlyRootFilesystem` to `true`.
256+
257+
Example Helm values:
258+
259+
```yaml
260+
controller:
261+
...
262+
appprotect:
263+
...
264+
enforcer:
265+
securityContext:
266+
readOnlyRootFilesystem: true
267+
...
268+
```
269+
270+
Set `controller.appprotect.configManager.securityContext.readOnlyRootFilesystem` to `true`.
271+
272+
Example Helm values:
273+
274+
```yaml
275+
controller:
276+
...
277+
appprotect:
278+
...
279+
configManager:
280+
securityContext:
281+
readOnlyRootFilesystem: true
282+
...
283+
```
284+
221285
{{%/tab%}}
222286

223287
{{%tab name="With Manifest"%}}
@@ -329,6 +393,74 @@ Add `volumeMounts` as below:
329393
...
330394
```
331395
396+
### Configure `readOnlyRootFilesystem`
397+
398+
Add `readOnlyRootFilesystem` to the NIC container and set valut to `true` as below:
399+
400+
```yaml
401+
...
402+
- image: <my_docker_registery>:<version_tag>
403+
imagePullPolicy: IfNotPresent
404+
name: nginx-plus-ingress
405+
...
406+
securityContext:
407+
allowPrivilegeEscalation: false
408+
capabilities:
409+
add:
410+
- NET_BIND_SERVICE
411+
drop:
412+
- ALL
413+
readOnlyRootFilesystem: true
414+
runAsNonRoot: true
415+
runAsUser: 101
416+
readOnlyRootFilesystem: true
417+
...
418+
volumeMounts:
419+
- mountPath: /etc/nginx
420+
name: nginx-etc
421+
- mountPath: /var/cache/nginx
422+
name: nginx-cache
423+
- mountPath: /var/lib/nginx
424+
name: nginx-lib
425+
- mountPath: /var/log/nginx
426+
name: nginx-log
427+
- mountPath: /opt/app_protect/bd_config
428+
name: app-protect-bd-config
429+
- mountPath: /opt/app_protect/config
430+
name: app-protect-config
431+
- mountPath: /etc/app_protect/bundles
432+
name: app-protect-bundles
433+
...
434+
```
435+
436+
Add `readOnlyRootFilesystem` to the `waf-config-mgr` container and set value to `true` as below:
437+
438+
```yaml
439+
...
440+
- name: waf-config-mgr
441+
image: private-registry.nginx.com/nap/waf-config-mgr:<version-tag>
442+
imagePullPolicy: IfNotPresent
443+
...
444+
securityContext:
445+
readOnlyRootFilesystem: true
446+
...
447+
...
448+
```
449+
450+
Add `readOnlyRootFilesystem` to the `waf-enforcer` container and set value to `true` as below:
451+
452+
```yaml
453+
...
454+
- name: waf-enforcer
455+
image: private-registry.nginx.com/nap/waf-enforcer:<version-tag>
456+
imagePullPolicy: IfNotPresent
457+
...
458+
securityContext:
459+
readOnlyRootFilesystem: true
460+
...
461+
...
462+
```
463+
332464
### Using a Deployment
333465
334466
{{< include "installation/manifests/deployment.md" >}}

0 commit comments

Comments
 (0)