-
Notifications
You must be signed in to change notification settings - Fork 2k
WAF v5 docs update #5719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
WAF v5 docs update #5719
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
fecb959
WIP - WAFv5 docs
jjngx 1b1f293
Update make targets
jjngx 44393ac
Update troubleshooting doc, re-ordering pages
jjngx 1249c75
Bump redhat/ubi8 from `2a5d234` to `143123d` in /build (#5715)
dependabot[bot] cde8d24
[pre-commit.ci] pre-commit autoupdate (#5724)
pre-commit-ci[bot] 6b98b56
Bump docker/build-push-action from 5.3.0 to 5.4.0 in the actions grou…
dependabot[bot] 678e85e
Docs - pulling NIC WAF images
jjngx 26052a1
Docs - pulling NIC WAF images
jjngx 36012e0
Building NIC - make targets
jjngx dd7df3a
Update installation doc
jjngx ceaf8f4
Update installation docs for WAF v5
jjngx deed446
Fix merge conflict
jjngx 0b794a6
Remove ref to json policies from WAFv5 doc, update waf docker image tags
jjngx 74127b9
Merge branch 'main' into docs/waf5
jjngx f191e5f
Merge branch 'main' into docs/waf5
jjngx 100c38b
Merge branch 'main' into docs/waf5
jjngx f95acbd
Merge branch 'main' into docs/waf5
jjngx 3312260
Merge branch 'main' into docs/waf5
jjngx 9dc5a70
Fix hugo build
jjngx 9ae8176
Merge branch 'main' into docs/waf5
jjngx d6acfbc
Merge branch 'main' into docs/waf5
jjngx 0de914b
Merge branch 'main' into docs/waf5
shaun-nx 8aabfc6
Add waf5 bundle example
jjngx ae88c06
Merge branch 'main' into docs/waf5
jjngx ca2ba78
Merge branch 'main' into docs/waf5
shaun-nx 3ff5e9b
Merge branch 'main' into docs/waf5
shaun-nx 130bb8b
Remove examples
shaun-nx 3460ce7
Merge branch 'main' into docs/waf5
shaun-nx 70fcfd9
Update waf v5 configuration guide
shaun-nx 48a34ac
Merge branch 'main' into docs/waf5
shaun-nx 56e06b7
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
jjngx d33274f
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
jjngx 4c66949
Update docs/content/installation/integrations/app-protect-waf-v5/inst…
jjngx 8682239
Update docs/content/installation/integrations/app-protect-waf-v5/_ind…
jjngx 33b1cca
Merge branch 'main' into docs/waf5
jjngx d60b72c
Fix a link
jjngx 31aa89d
Fix rendering issue
jjngx f5fa9e7
Remove ref to WAF from WAFv5 section
jjngx 5b072b7
Merge branch 'main' into docs/waf5
ADubhlaoich 331888c
Merge branch 'main' into docs/waf5
ADubhlaoich 0d8facb
Merge branch 'main' into docs/waf5
ADubhlaoich 7124f5a
Remove references to WAF from WAF v5 docs
jjngx 7a53380
Merge branch 'main' into docs/waf5
oseoin c659899
Merge branch 'main' into docs/waf5
jjngx da351e8
Update config steps for policy bundle
jjngx 5db5f53
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
jjngx f0b73cb
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
jjngx 9741530
Update docs/content/installation/integrations/app-protect-waf-v5/inst…
jjngx c8b276a
Use hugo native syntax for notes
jjngx 3f7b2ce
Don't use explicit anchors
jjngx 5a7d560
Update notes
jjngx 683cb03
Add helm install and configuration stage for waf v5
shaun-nx bab716b
Update helm deployment example
shaun-nx 3e5c90c
Merge branch 'main' into docs/waf5
shaun-nx 9f1ed0b
Corret typo and add note regarding default volunes with emptyDir
shaun-nx 17d6dd6
Merge branch 'main' into docs/waf5
shaun-nx 9c1858b
Correct typo
shaun-nx 76fcc90
Merge branch 'main' into docs/waf5
shaun-nx 119a45f
Merge branch 'main' into docs/waf5
shaun-nx 1c46455
Merge branch 'main' into docs/waf5
shaun-nx 499c38a
Merge branch 'main' into docs/waf5
shaun-nx 6cefd48
Merge branch 'main' into docs/waf5
shaun-nx d73c743
Move the RBAC section into the Install With Manifests section + remov…
shaun-nx 0b3a82a
Merge branch 'main' into docs/waf5
shaun-nx f9ebec1
Merge branch 'main' into docs/waf5
ADubhlaoich ca3bd9f
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx 618ef32
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx b838e21
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx 0e2032f
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx 6932cc2
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx d076fd6
Update docs/content/installation/integrations/app-protect-waf-v5/conf…
shaun-nx b0579dc
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 5443259
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx a6bec22
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 560e77c
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 30405ba
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx bde1152
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 2a874be
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 1ffaf2b
Update docs/content/installation/integrations/app-protect-waf-v5/trou…
shaun-nx 13902f7
Merge branch 'main' into docs/waf5
shaun-nx 43bb219
Remove troubleshooting guide
shaun-nx 40f4412
Undo changes in Dockerfile
jjngx 9b0ca60
Merge branch 'main' into docs/waf5
vepatel f8d0640
Newline in dockerfile
shaun-nx 355ea01
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1577611
Update NIC version
jjngx 31dce9c
Re-add troubleshooting guide for v4
shaun-nx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/content/installation/integrations/app-protect-dos/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
docs/content/installation/integrations/app-protect-waf-v5/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: NGINX App Protect WAF v5 | ||
description: Learn how to use NGINX Ingress Controller for Kubernetes with NGINX App Protect version 5. | ||
weight: 200 | ||
menu: | ||
docs: | ||
parent: NGINX Ingress Controller | ||
--- |
184 changes: 184 additions & 0 deletions
184
docs/content/installation/integrations/app-protect-waf-v5/configuration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
--- | ||
docs: DOCS-000 | ||
title: Configuration | ||
toc: true | ||
weight: 200 | ||
--- | ||
|
||
|
||
## Overview | ||
|
||
This document explains how to use F5 NGINX Ingress Controller to configure [NGINX App Protect WAF v5](https://docs.nginx.com/nginx-app-protect-waf/v5/). | ||
|
||
{{< note >}} Check out the complete NGINX Ingress Controller with NGINX App Protect WAF example resources on GitHub [for VirtualServer resources](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/custom-resources/app-protect-waf-v5) and [for Ingress resources](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/ingress-resources/app-protect-waf-v5).{{< /note >}} | ||
|
||
|
||
## Global Configuration | ||
|
||
NGINX Ingress Controller has global configuration parameters that match those in NGINX App Protect WAF. They are found in the [ConfigMap resource]({{< relref "configuration/global-configuration/configmap-resource.md#modules" >}}): the NGINX App Protect WAF parameters are prefixed with `app-protect*`. | ||
|
||
## Enable NGINX App Protect WAF v5 | ||
|
||
NGINX App Protect WAF can be enabled and configured for custom resources (VirtualServer, VirtualServerRoute) or Ingress resources. | ||
|
||
- For custom resources, you need to create a Policy Custom Resource referencing a policy bundle, then add it to the VirtualServer definition. Additional detail can be found in the [Policy Resource documentation]({{< relref "configuration/policy-resource.md#waf" >}}). | ||
- For Ingress resources, apply the [`app-protect` annotations]({{< relref "configuration/ingress-resources/advanced-configuration-with-annotations.md#app-protect" >}}) to each desired resource. | ||
|
||
|
||
|
||
## NGINX App Protect WAF Bundles {#waf-bundles} | ||
|
||
You define App Protect WAF bundles for VirtualServer custom resources by creating policy bundles and putting them on a mounted volume accessible from NGINX Ingress Controller. | ||
|
||
Before applying a policy, a WAF policy bundle must be created, then copied to a volume mounted to `/etc/app_protect/bundles`. | ||
|
||
{{< note >}} NGINX Ingress Controller supports `securityLogs` for policy bundles. Log bundles must also be copied to a volume mounted to `/etc/app_protect/bundles`. {{< /note >}} | ||
|
||
This example shows how a policy is configured by referencing a generated WAF Policy Bundle: | ||
|
||
|
||
```yaml | ||
apiVersion: k8s.nginx.org/v1 | ||
kind: Policy | ||
metadata: | ||
name: <policy_name> | ||
spec: | ||
waf: | ||
enable: true | ||
apBundle: "<policy_bundle_name>.tgz" | ||
``` | ||
|
||
This example shows the same policy as above but with a log bundle used for security log configuration: | ||
|
||
|
||
```yaml | ||
apiVersion: k8s.nginx.org/v1 | ||
kind: Policy | ||
metadata: | ||
name: <policy_name> | ||
spec: | ||
waf: | ||
enable: true | ||
apBundle: "<policy_bundle_name>.tgz" | ||
securityLogs: | ||
- enable: true | ||
apLogBundle: "<log_bundle_name>.tgz" | ||
logDest: "syslog:server=syslog-svc.default:514" | ||
``` | ||
|
||
## Configuration in NGINX Plus Ingress Controller using Virtual Server Resource | ||
|
||
This example shows how to deploy NGINX Ingress Controller with NGINX Plus and NGINX App Protect WAF v5, deploy a simple web application, and then configure load balancing and WAF protection for that application using the VirtualServer resource. | ||
|
||
{{< note >}} You can find the files for this example on [GitHub](https://github.com/nginxinc/kubernetes-ingress/tree/v3.6.0/examples/custom-resources/app-protect-waf/app-protect-waf-v5).{{< /note >}} | ||
|
||
## Prerequisites | ||
|
||
1. Follow the installation [instructions]({{< relref "installation/integrations/app-protect-waf-v5/installation.md" >}}) to deploy NGINX Ingress Controller with NGINX Plus and NGINX App Protect WAF version 5. | ||
|
||
2. Save the public IP address of NGINX Ingress Controller into a shell variable: | ||
|
||
```shell | ||
IC_IP=XXX.YYY.ZZZ.III | ||
``` | ||
|
||
3. Save the HTTP port of NGINX Ingress Controller into a shell variable: | ||
|
||
```shell | ||
IC_HTTP_PORT=<port number> | ||
``` | ||
|
||
### Step 1. Deploy a Web Application | ||
|
||
Create the application deployment and service: | ||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/webapp.yaml | ||
``` | ||
|
||
### Step 2. Create the Syslog Service | ||
|
||
Create the syslog service and pod for the NGINX App Protect WAF security logs: | ||
|
||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/syslog.yaml | ||
``` | ||
|
||
### Step 3 - Deploy the WAF Policy | ||
|
||
|
||
{{< note >}} Configuration settings in the Policy resource enable WAF protection by configuring NGINX App Protect WAF with the log configuration created in the previous step. The policy bundle referenced as `your_policy_bundle_name.tgz` need to be created and placed in the `/etc/app_protect/bundles` volume first.{{</ note >}} | ||
|
||
Create and deploy the WAF policy. | ||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/waf.yaml | ||
``` | ||
|
||
|
||
### Step 4 - Configure Load Balancing | ||
|
||
|
||
{{< note >}} VirtualServer references the `waf-policy` created in Step 3.{{</ note >}} | ||
|
||
1. Create the VirtualServer Resource: | ||
|
||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/virtual-server.yaml | ||
``` | ||
|
||
|
||
### Step 5 - Test the Application | ||
|
||
To access the application, curl the coffee and the tea services. We'll use the `--resolve` option to set the Host header of a request with `webapp.example.com` | ||
|
||
1. Send a request to the application: | ||
|
||
```shell | ||
curl --resolve webapp.example.com:$IC_HTTP_PORT:$IC_IP http://webapp.example.com:$IC_HTTP_PORT/ | ||
``` | ||
|
||
```shell | ||
Server address: 10.12.0.18:80 | ||
Server name: webapp-7586895968-r26zn | ||
``` | ||
|
||
1. Try to send a request with a suspicious URL: | ||
|
||
```shell | ||
curl --resolve webapp.example.com:$IC_HTTP_PORT:$IC_IP "http://webapp.example.com:$IC_HTTP_PORT/<script>" | ||
``` | ||
|
||
```shell | ||
<html><head><title>Request Rejected</title></head><body> | ||
``` | ||
|
||
1. Check the security logs in the syslog pod: | ||
|
||
```shell | ||
kubectl exec -it <SYSLOG_POD> -- cat /var/log/messages | ||
``` | ||
|
||
### Example VirtualServer configuration | ||
|
||
The GitHub repository has a full [VirtualServer example](https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v3.6.0/examples/custom-resources/app-protect-waf-v5/webapp.yaml). | ||
|
||
```yaml | ||
apiVersion: k8s.nginx.org/v1 | ||
kind: VirtualServer | ||
metadata: | ||
name: webapp | ||
spec: | ||
host: webapp.example.com | ||
policies: | ||
- name: waf-policy | ||
upstreams: | ||
- name: webapp | ||
service: webapp-svc | ||
port: 80 | ||
routes: | ||
- path: / | ||
action: | ||
pass: webapp | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.