Skip to content

Commit 3647bc4

Browse files
authored
Add the security log bundle to the NIC/NIM WAF integration (#1327)
1 parent 78e2dae commit 3647bc4

File tree

2 files changed

+66
-17
lines changed

2 files changed

+66
-17
lines changed

content/nic/installation/integrations/app-protect-waf-v5/compile-waf-policies.md

Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Create the file `security-policy-bundles.json`:
106106
{
107107
"bundles": [
108108
{
109-
"appProtectWAFVersion": "4.815.0",
109+
"appProtectWAFVersion": "{{< appprotect-compiler-version >}}",
110110
"policyName": "Nginxbundletest",
111111
"policyUID": "",
112112
"attackSignatureVersionDateTime": "latest",
@@ -139,7 +139,7 @@ You should receive a response similar to the following:
139139
},
140140
"content": "",
141141
"metadata": {
142-
"appProtectWAFVersion": "4.815.0",
142+
"appProtectWAFVersion": "{{< appprotect-compiler-version >}}",
143143
"attackSignatureVersionDateTime": "2024.02.21",
144144
"created": "2024-06-12T13:28:20.023775785-07:00",
145145
"modified": "2024-06-12T13:28:20.023775785-07:00",
@@ -169,7 +169,7 @@ curl --location 'https://127.0.0.1/api/platform/v1/security/policies/bundles' \
169169
},
170170
"content": "",
171171
"metadata": {
172-
"appProtectWAFVersion": "4.815.0",
172+
"appProtectWAFVersion": "{{< appprotect-compiler-version >}}",
173173
"attackSignatureVersionDateTime": "2024.02.21",
174174
"created": "2024-06-13T09:09:10.809-07:00",
175175
"modified": "2024-06-13T09:09:20-07:00",
@@ -193,7 +193,7 @@ It is one of two unique IDs we will use to download the bundle: it will be refer
193193

194194
---
195195

196-
## Download the security bundle
196+
## Download the security policy bundle
197197

198198
Use a GET request to download the security bundle using the policy and bundle IDs:
199199

@@ -209,6 +209,14 @@ curl -X GET -k 'https://127.0.0.1/api/platform/v1/security/policies/6af9f261-658
209209
| jq -r '.content' | base64 -d > security-policy-bundle.tgz
210210
```
211211

212+
## Download the security log bundle
213+
214+
Use a GET request to download the `secops_dashboard` security log bundle. The security log bundle adjusts the format of the policy events to be compatible with NGINX Instance Manager:
215+
216+
```shell
217+
curl -X GET "https://{NMS_FQDN}/api/platform/v1/security/logprofiles/secops_dashboard/{{< appprotect-compiler-version >}}/bundle" -H "Authorization: Bearer <access token>" | jq -r .compiledBundle | base64 -d > secops_dashboard.tgz
218+
```
219+
212220
---
213221

214222
## Add volumes and volumeMounts
@@ -314,11 +322,61 @@ spec:
314322

315323
---
316324

325+
## Upload the security log bundle
326+
327+
Upload the security log bundle binary file to the NGINX Ingress Controller pods.
328+
329+
{{<tabs name="security-log">}}
330+
331+
{{%tab name="Helm"%}}
332+
333+
```shell
334+
kubectl cp /your/local/path/secops_dashboard.tgz <namespace>/<pod-name>:etc/app_protect/bundles/secops_dashboard.tgz -c nginx-ingress
335+
```
336+
337+
{{% /tab %}}
338+
339+
{{%tab name="Manifests"%}}
340+
341+
```shell
342+
kubectl cp /your/local/path/secops_dashboard.tgz <namespace>/<pod-name>:etc/app_protect/bundles/secops_dashboard.tgz -c nginx-plus-ingress
343+
```
344+
345+
{{% /tab %}}
346+
347+
{{% /tabs %}}
348+
349+
## Upload the security policy bundle
350+
351+
Upload the binary file to the NGINX Ingress Controller pods.
352+
353+
{{<tabs name="security-bundle">}}
354+
355+
{{%tab name="Helm"%}}
356+
357+
```shell
358+
kubectl cp /your/local/path/<bundle_name>.tgz <namespace>/<pod-name>:etc/app_protect/bundles<bundle_name>.tgz -c nginx-ingress
359+
```
360+
361+
{{% /tab %}}
362+
363+
{{%tab name="Manifests"%}}
364+
365+
```shell
366+
kubectl cp /your/local/path/<bundle_name>.tgz <namespace>/<pod-name>:etc/app_protect/bundles<bundle_name>.tgz -c nginx-plus-ingress
367+
```
368+
369+
{{% /tab %}}
370+
371+
{{% /tabs %}}
372+
373+
---
374+
317375
## Create WAF policy
318376

319377
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.
320378

321-
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).
379+
The example below shows the required WAF policy, for the *apBundle* field you must use the [security bundle](#download-the-security-policy-bundle) binary file (a tarball). The *apLogBundle* field contains the `secops_dashboard.tgz` [file](#download-the-security-log-bundle).
322380

323381
```yaml
324382
apiVersion: k8s.nginx.org/v1
@@ -331,7 +389,7 @@ spec:
331389
apBundle: "<bundle-name>.tgz"
332390
securityLogs:
333391
- enable: true
334-
apLogBundle: "<bundle-name>.tgz"
392+
apLogBundle: "secops_dashboard.tgz"
335393
logDest: "<security-log-destination-URL>"
336394
```
337395

@@ -360,14 +418,4 @@ spec:
360418
pass: webapp
361419
```
362420

363-
---
364-
365-
## Upload the security bundle
366-
367-
To finish adding a security bundle, upload the binary file to the NGINX Ingress Controller pods.
368-
369-
```shell
370-
kubectl cp /your/local/path/<bundle_name>.tgz <namespace>/<pod-name>:etc/app_protect/bundles<bundle_name>.tgz -c nginx-plus-ingress
371-
```
372-
373-
Once the bundle has been uploaded to the cluster, NGINX Ingress Controller will detect and automatically load the new WAF policy.
421+
Your `VirtualServer` should now apply the generated security policy to your traffic and emit security events to NGINX Instance Manager.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.527.0

0 commit comments

Comments
 (0)