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
@@ -15,12 +17,17 @@ By using NGINX Instance Manager to compile WAF policies, the policy bundle can a
15
17
16
18
The following steps describe how to use the NGINX Instance Manager API to create a new security policy, compile a bundle, then add it to NGINX Ingress Controller.
17
19
20
+
---
21
+
18
22
## Before you start
23
+
19
24
### Requirements
20
25
- A working [NGINX Instance Manager](https://docs.nginx.com/nginx-instance-manager/deploy/) instance.
21
26
- An [NGINX Instance Manager user](https://docs.nginx.com/nginx-instance-manager/admin-guide/rbac/overview-rbac/) for API requests.
22
27
- A NGINX Ingress Controller [deployment with NGINX App Protect WAF]({{< relref "/installation/integrations/app-protect-waf/installation.md" >}}).
23
28
29
+
---
30
+
24
31
## Create a new security policy
25
32
26
33
{{< tip >}} You can skip this step if you intend to use an existing security policy. {{< /tip >}}
@@ -80,6 +87,8 @@ It is one of two unique IDs we will use to download the bundle: it will be refer
80
87
81
88
{{< /important >}}
82
89
90
+
---
91
+
83
92
## Create a new security bundle
84
93
85
94
Once you have created (Or selected) a security policy, [create a security bundle](https://docs.nginx.com/nginx-instance-manager/nginx-app-protect/manage-waf-security-policies/#create-security-policy-bundles) using the API. The version in the bundle you create **must** match the WAF compiler version you intend to use.
@@ -180,6 +189,8 @@ It is one of two unique IDs we will use to download the bundle: it will be refer
180
189
181
190
{{< /important >}}
182
191
192
+
---
193
+
183
194
## Download the security bundle
184
195
185
196
Use a GET request to download the security bundle using the policy and bundle IDs:
@@ -196,7 +207,9 @@ curl -X GET -k 'https://127.0.0.1/api/platform/v1/security/policies/6af9f261-658
## Add volumes and volumeMounts to NGINX Ingress Controller
210
+
---
211
+
212
+
## Add volumes and volumeMounts
200
213
201
214
To use WAF security bundles, your NGINX Ingress Controller instance must have *volumes* and *volumeMounts*. Precise paths are used to detect when bundles are uploaded to the cluster.
202
215
@@ -210,7 +223,7 @@ persistentVolumeClaim:
210
223
211
224
volumeMounts:
212
225
- name: <volume_mount_name>
213
-
mountPath: /etc/nginx/waf/bundles
226
+
mountPath: /etc/app_protect/bundles
214
227
```
215
228
216
229
A full example of a deployment file with `volumes` and `volumeMounts` could look like the following:
@@ -281,7 +294,7 @@ spec:
281
294
- NET_BIND_SERVICE
282
295
volumeMounts:
283
296
- name: bundle-mount
284
-
mountPath: /etc/nginx/waf/bundles
297
+
mountPath: /etc/app_protect/bundles
285
298
env:
286
299
- name: POD_NAMESPACE
287
300
valueFrom:
@@ -297,9 +310,11 @@ spec:
297
310
- -external-service=nginx-ingress
298
311
```
299
312
313
+
---
314
+
300
315
## Create WAF policy
301
316
302
-
To process a bundle, you must create a new WAF policy. This policy is added to `/etc/nginx/waf/bundles`, allowing NGINX Ingress Controller to load it into WAF.
317
+
To process a bundle, you must create a new WAF policy. This policy is added to `/etc/app_protect/bundles`, allowing NGINX Ingress Controller to load it into WAF.
303
318
304
319
The example below shows the required WAF policy, and the *apBundle* and *apLogConf* fields you must use for the security bundle binary file (A tar ball).
305
320
@@ -318,6 +333,8 @@ spec:
318
333
logDest: "<security-log-destination-URL>"
319
334
```
320
335
336
+
---
337
+
321
338
## Create VirtualServer resource and apply policy
322
339
323
340
Once the WAF policy has been created, link it to your *virtualServer resource*.
@@ -341,12 +358,14 @@ spec:
341
358
pass: webapp
342
359
```
343
360
361
+
---
362
+
344
363
## Upload the security bundle
345
364
346
-
To finish adding a security bundle, the binary file to the NGINX Ingress Controller pods.
365
+
To finish adding a security bundle, upload the binary file to the NGINX Ingress Controller pods.
0 commit comments