Skip to content

fix: grant status RBAC for Envoy Gateway policies - #324

Merged
ecv merged 1 commit into
mainfrom
fix/322-envoy-policy-status-rbac
Jul 29, 2026
Merged

fix: grant status RBAC for Envoy Gateway policies#324
ecv merged 1 commit into
mainfrom
fix/322-envoy-policy-status-rbac

Conversation

@ecv

@ecv ecv commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

The manager's role grants no status subresource on any gateway.envoyproxy.io type, so every upstream status write the gateway resource replicator attempts is denied — logging an error on every reconcile, indefinitely.

Two symptoms for tenants:

  • A tenant whose OIDC SecurityPolicy references a missing secret gets no reason back. The operator correctly holds the broken policy off the shared gateway but cannot write Accepted=False, reason=PendingSecret onto the tenant's resource, so login silently fails with nothing to act on.
  • SecurityPolicy, BackendTrafficPolicy, Backend, and HTTPRouteFilter never reflect edge status, and stale status is never cleared.

Three write paths were denied: the held-policy condition (gateway_resource_replicator_securitypolicy_guard.go:176), the downstream→upstream sync (gateway_resource_replicator_controller.go:487), and the status clear (:526). The last two run for every replicated GVK without skipUpstreamStatusSync, so the gap was never limited to held SecurityPolicies. BackendTLSPolicy was unaffected — gateway.networking.k8s.io/*/status is already granted.

This adds the missing marker and regenerates the role. It also names httproutefilters in the replicator's own marker, which previously relied on an unrelated HTTPProxy controller marker for access; the generated role is unchanged by that.

Note

Unit tests cannot catch this: the replicator tests use a fake client that does not enforce RBAC. The real gate is #312.

Test plan

  • make manifests regenerates config/rbac/role.yaml with the four /status rules; no CRD churn
  • go build ./...
  • make test
  • On a real cluster: a held SecurityPolicy reports Accepted=False, reason=PendingSecret
  • On a real cluster: edge status for a replicated BackendTrafficPolicy appears upstream
  • No failed to record held status or failed to update upstream status in manager logs
  • test: gate OIDC missing-secret gateway isolation #312 (oidc-missing-secret-isolation) reaches Arm 2 and passes

Related to #322

The manager's role granted no status subresource on any
gateway.envoyproxy.io type, so every upstream status write the gateway
resource replicator attempted was denied. Tenants saw no status on their
SecurityPolicy, BackendTrafficPolicy, Backend, or HTTPRouteFilter
resources, and a policy held back for a missing secret reported no
reason at all.

Three write paths were affected: the held-policy condition write in the
SecurityPolicy guard, the downstream-to-upstream status sync, and the
upstream status clear. The latter two run for every replicated GVK that
does not set skipUpstreamStatusSync, so the gap was never limited to the
held-SecurityPolicy case.

Also name httproutefilters in the replicator's own resource marker. It
previously had access only through an unrelated marker on the HTTPProxy
controller, which would silently revoke the replicator's access if that
marker ever changed. The generated role is unchanged by this, since the
verb set already matched.

Key changes:
- Add a status marker covering backends/status,
  backendtrafficpolicies/status, httproutefilters/status, and
  securitypolicies/status with get, update, patch
- Add httproutefilters to the replicator's resource marker
- Regenerate config/rbac/role.yaml from the markers
@ecv
ecv requested review from JoseSzycho and kevwilliams July 28, 2026 17:27
@ecv
ecv merged commit 11e2798 into main Jul 29, 2026
11 checks passed
@ecv
ecv deleted the fix/322-envoy-policy-status-rbac branch July 29, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants