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
Copy file name to clipboardExpand all lines: docs/proposals/nap-waf.md
+60-85Lines changed: 60 additions & 85 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,6 @@ NGINX App Protect WAF v5 imposes specific architectural requirements that fundam
36
36
-**Multi-container deployment**: Requires separate `waf-enforcer` and `waf-config-mgr` containers alongside the main NGINX container
37
37
-**Pre-compiled policies**: WAF policies must be compiled externally using NAP tooling before deployment (cannot be defined inline in Kubernetes resources)
38
38
-**Shared volume architecture**: Containers communicate through shared filesystem volumes rather than direct API calls
39
-
-**External storage requirement**: Compiled policy bundles must be distributed via external storage systems (S3, HTTP, MinIO)
40
39
41
40
### Design Philosophy
42
41
@@ -205,7 +204,7 @@ The architecture demonstrates separation of concerns: external policy compilatio
205
204
206
205
### Network Access Requirements
207
206
208
-
NGF requires outbound network access to fetch WAF policies from remote locations:
207
+
NGF requires outbound network access to fetch WAF policies from _remote_ locations:
@@ -221,6 +220,20 @@ NGF requires outbound network access to fetch WAF policies from remote locations
221
220
222
221
**Note**: Network access configuration is environment-specific and handled through standard Kubernetes networking patterns rather than NGF-specific configuration options.
223
222
223
+
#### Air-Gapped Environments
224
+
225
+
-**In-cluster policy storage**: Deploy MinIO or HTTP server within cluster boundaries
226
+
-**Offline compilation**: Use NAP v5 tools in secure environments & upload bundles manually, or do this step within cluster boundaries
227
+
-**No external dependencies**: Complete WAF functionality without internet access
According to the [Policy and Metaresources GEP](https://gateway-api.sigs.k8s.io/geps/gep-713/), the `WafPolicy` CRD must have the `gateway.networking.k8s.io/policy: inherited` label to specify that it is an inherited policy.
660
+
This label will help with discoverability and will be used by the planned Gateway API Policy [kubectl plugin](https://gateway-api.sigs.k8s.io/geps/gep-713/#kubectl-plugin-or-command-line-tool).
661
661
662
-
```yaml
663
-
# Provides base WAF protection for all routes
664
-
apiVersion: gateway.nginx.org/v1alpha1
665
-
kind: WafPolicy
666
-
metadata:
667
-
name: gateway-base-protection
668
-
namespace: applications
669
-
spec:
670
-
targetRefs:
671
-
- group: gateway.networking.k8s.io
672
-
kind: Gateway
673
-
name: main-gateway
674
-
policySource:
675
-
fileLocation: "s3://policies/base-protection.tgz"
676
-
```
662
+
#### Conditions
677
663
678
-
**Result**: All HTTPRoutes and GRPCRoutes attached to `main-gateway` automatically inherit WAF protection.
664
+
According to the [Policy and Metaresources GEP](https://gateway-api.sigs.k8s.io/geps/gep-713/), the `WafPolicy` CRD must include a `status` stanza with a slice of Conditions.
679
665
680
-
#### Route-Level Override
666
+
The `Accepted` Condition must be populated on the `WafPolicy` CRD using the reasons defined in the [PolicyCondition API](https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1alpha2/policy_types.go). If these reasons are not sufficient, we can add implementation-specific reasons.
#### Setting Status on Objects Affected by a Policy
697
669
698
-
**Result**: Admin routes get stricter protection while other routes continue using base protection.
670
+
In the Policy and Metaresources GEP, there's a [provisional status described here](https://gateway-api.sigs.k8s.io/geps/gep-713/#standard-status-condition-on-policy-affected-objects) that involves adding a Condition or annotation to all objects affected by a Policy.
699
671
700
-
### Enterprise Security Operations
672
+
This solution gives the object owners some knowledge that their object is affected by a policy but minimizes status updates by limiting them to when the affected object starts or stops being affected by a policy.
673
+
Even though this status is provisional, implementing it now will help with discoverability and allow us to give feedback on the solution.
701
674
702
-
- **SecOps teams** compile and manage WAF policies using existing NAP v5 tooling
703
-
- **CI/CD pipelines** automate policy compilation, testing, and distribution
704
-
- **Platform teams** deploy WAF-enabled gateways with inherited protection for all applications
705
-
- **Development teams** can override Gateway policies for specific routes when needed
706
-
- **Operations teams** benefit from simplified policy management with automatic inheritance
675
+
Implementing this involves defining a new Condition type and reason:
707
676
708
-
### Multi-Environment Deployment
677
+
```go
678
+
package conditions
709
679
710
-
- **Development**: Gateway-level monitoring mode with detailed logging for policy tuning
711
-
- **Staging**: WAF-enabled Gateway for comprehensive policy testing with route-specific overrides
712
-
- **Production**: Full enforcement with performance-optimized policy bundles and granular route policies
0 commit comments