Summary
The Agones extensions apiserver (agones-controller-service:443/apis/allocation.agones.dev/v1/...) serves as a Kubernetes aggregated APIService. When Kubernetes routes allocation requests through the API server aggregator, the aggregator enforces authn/authz normally. However, the same service port is directly reachable within the cluster as a standard Service endpoint.
The extensions HTTPS server (pkg/util/https/server.go) configures TLS with GetCertificate only — no ClientAuth, no RequestHeader CA verification, no bearer-token authentication, and no SubjectAccessReview before dispatching to resource handlers. pkg/util/apiserver/apiserver.go routes /apis/<groupVersion>/namespaces/ directly to CRDHandler delegates without any authorization middleware.
As a result, any in-cluster workload that can reach agones-controller-service on port 443 can POST a GameServerAllocation directly, bypassing Kubernetes RBAC for the aggregated resource.
Affected files
pkg/util/https/server.go — TLS config lacks ClientAuth / RequestHeader CA
pkg/util/apiserver/apiserver.go — no auth middleware before resource dispatch
cmd/extensions/main.go — extension server shares the webhook mux without auth
Expected fix
Implement Kubernetes aggregation layer authentication on the extension HTTPS server:
- Load
extension-apiserver-authentication ConfigMap from kube-system
- Configure
ClientAuth: VerifyClientCertIfGiven with the RequestHeader CA
- Verify the proxy client certificate CN against
requestheader-allowed-names
The controller service account already has system:auth-delegator and extension-apiserver-authentication-reader bindings, which suggests this authentication was intended but not yet implemented.
Note
This issue was first surfaced in PR #4557 (closed for code quality). This issue is to discuss the right implementation approach before a fix PR is opened.
Summary
The Agones extensions apiserver (
agones-controller-service:443/apis/allocation.agones.dev/v1/...) serves as a Kubernetes aggregated APIService. When Kubernetes routes allocation requests through the API server aggregator, the aggregator enforces authn/authz normally. However, the same service port is directly reachable within the cluster as a standard Service endpoint.The extensions HTTPS server (
pkg/util/https/server.go) configures TLS withGetCertificateonly — noClientAuth, no RequestHeader CA verification, no bearer-token authentication, and no SubjectAccessReview before dispatching to resource handlers.pkg/util/apiserver/apiserver.goroutes/apis/<groupVersion>/namespaces/directly toCRDHandlerdelegates without any authorization middleware.As a result, any in-cluster workload that can reach
agones-controller-serviceon port 443 can POST aGameServerAllocationdirectly, bypassing Kubernetes RBAC for the aggregated resource.Affected files
pkg/util/https/server.go— TLS config lacks ClientAuth / RequestHeader CApkg/util/apiserver/apiserver.go— no auth middleware before resource dispatchcmd/extensions/main.go— extension server shares the webhook mux without authExpected fix
Implement Kubernetes aggregation layer authentication on the extension HTTPS server:
extension-apiserver-authenticationConfigMap fromkube-systemClientAuth: VerifyClientCertIfGivenwith the RequestHeader CArequestheader-allowed-namesThe controller service account already has
system:auth-delegatorandextension-apiserver-authentication-readerbindings, which suggests this authentication was intended but not yet implemented.Note
This issue was first surfaced in PR #4557 (closed for code quality). This issue is to discuss the right implementation approach before a fix PR is opened.