docs: Document the NGF AccessPolicy API - #2336
Open
promptless[bot] wants to merge 5 commits into
Open
promptless[bot] wants to merge 5 commits into
promptless[bot] wants to merge 5 commits into
Conversation
Add a how-to guide for the NGINX Gateway Fabric AccessPolicy API, which defines IP address allowlists and denylists for a Gateway, HTTPRoute, or GRPCRoute. The guide covers the spec fields, validation, status conditions, and troubleshooting. Also add AccessPolicy to the custom policies table. Documents nginx/nginx-gateway-fabric#5987 for the next NGF release.
✅ Deploy Preview will be available once build job completes!
|
3 of 6 tasks
kkyle-f5
reviewed
Sep 28, 2026
Format only the resource kinds and field names in the CRD validation messages as code, instead of each whole message, as requested in review.
kkyle-f5
reviewed
Sep 28, 2026
kkyle-f5
approved these changes
Sep 28, 2026
kkyle-f5
left a comment
Contributor
There was a problem hiding this comment.
Approved by see my two comments.
Format the "must be a valid IPv4/IPv6 address or CIDR range" message in the Invalid status troubleshooting entry as quoted plain text instead of code, to match the CRD error messages above it. The field path keeps code formatting, and "field" stays because it names an API field rather than a UI input box.
Contributor
Author
|
In reply to this discussion Thanks for the review. Both comments are addressed on #2336:
The details are in each comment thread. |
The merged version of nginx/nginx-gateway-fabric#5987 adds the AccessPolicyAffected condition to a Gateway or route only when the AccessPolicy is valid. Say so in the Gateway status step and in the Invalid troubleshooting entry.
JTorreG
approved these changes
Sep 30, 2026
Contributor
|
looks good from a TW pov. Waiting for a SME approval cc @sjberman |
Add a section to the AccessPolicy guide that explains how NGINX enforces the rules. It covers the default for requests that match no rule, the 403 response, how Gateway and route policies combine (Deny rules add up, route Allow rules replace Gateway Allow rules), and the rewriteClientIP setting for traffic behind a proxy. Documents nginx/nginx-gateway-fabric#6013.
5 of 6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes
Documents the AccessPolicy API from nginx/nginx-gateway-fabric#5987, merged into the
feat/access-policyfeature branch. It ships with the next NGINX Gateway Fabric release. The feature is unreleased, so this PR targetsngf-release-next.AccessPolicy (
gateway.nginx.org/v1alpha1) is a new inherited policy for IP address allowlists and denylists on a Gateway, HTTPRoute, or GRPCRoute. #5987 adds the controller that watches AccessPolicies, their validation, and their status reporting. Changes in this PR:content/ngf/traffic-security/access-policy.md, a how-to guide. It covers creating an AccessPolicy for a Gateway and for an HTTPRoute, checking the policyAcceptedcondition and theAccessPolicyAffectedcondition on the target, the spec fields and their limits, and two troubleshooting entries: CRD admission errors, andAccepted=Falsewith reasonInvalidfor a bad IP address or CIDR range.content/ngf/overview/custom-policies.md. The row marks the policy as mergeable, because NGINX Gateway Fabric never reports an AccessPolicy asConflicted.Update for nginx/nginx-gateway-fabric#6013 (NGINX configuration generation for AccessPolicy, open against the
feat/access-policyfeature branch, next NGINX Gateway Fabric release): Adds a "How NGINX applies the access rules" section to the guide. It covers:AllowandDenydo for requests that match no rule, the403 Forbiddenresponse, and a rule withoutsource./coffeefrom the two example policies in the guide.rewriteClientIPsetting in NginxProxy for traffic behind a load balancer or proxy, with a link to the existing data plane configuration section.#6013 isn't merged yet, so this section reflects its head commit
07a7a48. Recheck it if #6013 changes before merge. The AccessPolicy functional tests (nginx/nginx-gateway-fabric#5937) are still open.content/ngf/reference/api.mdis generated from the CRDs, so this PR doesn't edit it.Update for the merged version of #5987: The final version of #5987 sets the
AccessPolicyAffectedcondition on a Gateway or route only when the AccessPolicy is valid. The Gateway step now says that the condition shows a valid AccessPolicy targets the Gateway. The "The AccessPolicy status is Invalid" entry now says that an invalid AccessPolicy doesn't add the condition to its target. The merged version also changes how the controller parses addresses, but the condition message still starts with "must be a valid IPv4/IPv6 address or CIDR range", so the troubleshooting text is unchanged.#5987 also adds a controller check that the
apPolicyRefandapLogConfRefnames in a WAFPolicy are valid DNS subdomain names. An invalid name setsAccepted=Falsewith the reasonInvalid. The existingAcceptedrow in the WAFPolicy troubleshooting page already covers spec validation failures, so this PR doesn't change the WAF pages.Review feedback: Per review, the CRD error messages in the "Kubernetes rejects the AccessPolicy" troubleshooting entry are no longer formatted as whole-line code. Only the resource kinds and field names in each message (such as
AccessRule,targetRefs, andIPAddress) keep code formatting. The message text is unchanged.Review feedback (line 271): Declined the suggestion to replace "field" with "box" in the "The AccessPolicy status is Invalid" entry. The style guide's UI terms topic (
terminology/ui-terms.md) calls for "box" only for UI input areas. Here "field" means the AccessPolicy spec field named in the condition message, such asspec.rules[0].source.ipAddress.address, which matches the Kubernetes API term used in the "AccessPolicy fields" section. On the same line, the condition message text is no longer formatted as code. It's now quoted as a literal string, matching the treatment of the CRD error messages, and the field path keeps code formatting.Checklist
Before sharing this pull request, I completed the following checklist:
Footnotes
Potentially sensitive information includes personally identify information (PII), authentication credentials, and live URLs. Refer to the style guide for guidance about placeholder content. ↩