fix(gatewayapi): grant WAF filter licensekey access for both API groups#4808
Merged
electricjesus merged 1 commit intoMay 14, 2026
Merged
Conversation
When clusters are installed in no-api-server mode (only projectcalico.org/v3 CRDs, no crd.projectcalico.org/v1 CRDs), libcalico-go's clientv3 auto-discovers the projectcalico.org/v3 API group and queries it directly. The WAF HTTP filter sidecar's license monitor was denied access because the ClusterRole only granted crd.projectcalico.org. Without license, the filter fails open and does not block WAF attacks. Grant the same get/watch verbs on both API groups so the filter can read the license key regardless of which CRD set the cluster installed. EV-6590
jaderhs
approved these changes
May 14, 2026
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.
Description
In clusters installed in "no API server" mode (
USE_API_SERVER=falsein banzai; onlyprojectcalico.org/v3direct CRDs installed, nocrd.projectcalico.org/v1CRDs), libcalico-go'sclientv3auto-discovers the v3 API group and queries it directly. The WAF HTTP filter sidecar's license monitor was denied access because thewaf-http-filterClusterRole only granted thecrd.projectcalico.orggroup.The denial caused license init to fail, leaving the filter's
ingressGatewayEnabledat its zero value (false), which routes all requests through the unlicensed handler — bypassing WAF rule processing. The result is a silent fail-open: attacks like SQLi/XSS go through unblocked.This change extends the ClusterRole's APIGroups to include both groups so the filter can read the LicenseKey regardless of which CRD set the cluster installed.
Verification
Reproduced end-to-end on a kubeadm cluster installed with v3 CRDs only (mirroring banzai's
USE_API_SERVER=falseflow):Before fix (only
crd.projectcalico.orggranted):After fix (both groups granted):
Test in
pkg/render/gatewayapi/gateway_api_test.goupdated to assert both groups.EV-6590