Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ func (api *APIServer) ListenAndServe(ctx context.Context) error {

errors := make(chan error)
go func() {
// Plaintext HTTP (not ListenAndServeTLS) is intentional here, risk-accepted
// By-Design - see the authn/authz rationale in NewRouter (routers.go).
// This server is only reachable from the AKS RP control plane over the
// cluster-internal network; TLS termination/authentication is handled at
// the network boundary, not in this process.
errors <- svr.ListenAndServe()
}()

Expand Down
21 changes: 21 additions & 0 deletions apiserver/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,27 @@ func (api *APIServer) NewRouter() *mux.Router {
router.Methods("GET").Path("/healthz").Name("healthz").HandlerFunc(healthz)

// global timeout and panic handlers.
//
// No authentication middleware (JWT/mTLS/API-key) is intentionally added here;
// this is a risk-accepted By-Design decision, not an oversight.
//
// Rationale:
// - This APIServer is an internal sidecar invoked only by the AKS RP control
// plane over the cluster-internal network; it is not exposed to the public
// internet.
// - The enforced security boundary is network isolation (pod/cluster network
// policy), configured outside this repo in the RP deployment, not app-layer
// auth.
// - The handlers registered above are stateless template generators: they
// render node bootstrap data / image config from request input and do not
// read tenant secrets from a backend store.
// - Adding real authentication (mTLS or token-based) would require a
// cert/token issuance and rotation mechanism plus a coordinated change on
// the RP caller side (a different repo/system) - out of scope for a
// point fix here.
//
// If this router is ever exposed beyond the trusted RP-only network boundary,
// authentication middleware must be added here.
router.Use(timeoutHandler(), recoveryHandler())

return router
Expand Down
Loading