Repository navigation
docs: authenticate to the Kubernetes Proxy with a service-account key or a PAT - #940
Draft
slayerjain wants to merge 7 commits into
Draft
slayerjain wants to merge 7 commits into
slayerjain wants to merge 7 commits into
Conversation
… or a PAT The Kubernetes Proxy REST API page told callers, CI included, to trade a personal access token for the cluster shared token and send that token on every call. The shared token is the credential the proxy's own in-cluster components use, and the proxy now accepts it only on the routes those components call. - Authentication now sends a service-account key (CI and automation) or a PAT (a person) straight in the Bearer header. It explains what a key can call (per-route permissions, enforce vs. the default audit mode), how to set up a service account for CI (ITG_RUNNER / ATG_RUNNER, key expiry and rotation), the failure modes, and how long the proxy caches a validation. - The PAT -> shared-token exchange and the Console's Get Shared Token button are documented as deprecated, with the 403 the shared token now gets and how to migrate a script. - The quick start, the endpoint reference and the static-deduplication example use the key directly. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
…on for keys Signed-off-by: slayerjain <shubhamkjain@outlook.com>
… the shared-token cut is hard The Kubernetes Proxy page told a CI job that starts and stops recordings to borrow a cluster admin's key under enforce. CI does not start or stop recordings: `keploy cloud replay` runs on a service-account key bound to ITG_RUNNER and `keploy test-suite --cloud` on one bound to ATG_RUNNER, and neither calls /record/start, /record/stop, /test/start or /test/stop. Starting or stopping a recording or an in-cluster replay through the proxy API is a person's action, done with their own PAT, which needs the record or replay permissions on the cluster under enforce. The deprecated shared-token section now says plainly that the restriction is a hard cut: no grace period and no log-only release, so a script still sending the shared token gets 403 on those routes from the upgrade on, in every RBAC mode. Scripts can switch first, since the proxy already accepts keys and PATs on every route. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
smart-set-agent.md, k8s-proxy-llm-workflow.md and cloud-replay.md still sent readers to Settings → API Keys. The Console lists API Keys under its Account menu, with a Generate new token button; say so, in the words k8s-proxy-api.md already uses. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
…Token The deprecated-exchange note named a "Get Shared Token" button. The Console labels that button "Get Agent Token", so a reader looking for it found nothing. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
… code The proxy's refusal of the cluster shared token now carries "code": "MACHINE_CREDENTIAL_REFUSED" and a message that names the route class. Quote that body, say a script can branch on the code instead of the message, and say that /kms/decrypt is the one key-material route the token may still call, and only over the proxy's own loopback listener. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
… OWNER_REPLICA_UNVERIFIED The endpoint reference now says that POST /agent/execute-request needs testgen:run, refuses the shared token, and sends a request only to an app Service the proxy manages, by its full in-cluster name, with TLS verified and redirects not followed; any other target is a 403 that says why. The failure table adds the multi-replica 503: a replica that cannot verify the replica owning a recording or replay does not forward the request, and answers OWNER_REPLICA_UNVERIFIED with a Retry-After header. Signed-off-by: slayerjain <shubhamkjain@outlook.com>
slayerjain
force-pushed
the
docs/k8s-proxy-auth-service-accounts
branch
from
October 25, 2026 05:34
442b5fa to
0b92b92
Compare
This branch has not been deployed
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.
What
The Kubernetes Proxy REST API page told every caller, CI pipelines included, to exchange a personal access token for the cluster's shared token (
POST /get-shared-token, or the Console's Get Agent Token button) and to send that token on every call.That token is the credential the proxy's own in-cluster components (the node agents and the replay runner) authenticate with. It names no user, so a copy held by a CI system carries cluster-wide authority with no owner and no per-consumer revocation. keploy/k8s-proxy#1126 makes the proxy accept the shared token only on the routes those components call, in every RBAC mode, and answer 403 everywhere else. That is a hard cut: there is no grace period and no release that only logs, so a script still sending the shared token gets the 403 from the upgrade on.
This PR moves the docs to what replaces it, which the proxy already accepts today.
Authorization: Bearer <key>: a service-account key for CI and automation, or a PAT for a person. The section covers:enforceagainst the defaultauditmode);ITG_RUNNERforkeploy cloud replay, orATG_RUNNERforkeploy test-suite --cloud, with key expiry and rotation;/record/start,/record/stop,/test/start,/test/stop) is a person's action, done with their own PAT. Underenforcethat person needs the record or replay permissions on the cluster.MACHINE_CREDENTIAL_REFUSEDcode and its message, and explains how to migrate a script: send the key itself, and drop the exchange and anytokenIdcaching.POST /agent/execute-requestreaches. It needstestgen:runand refuses the shared token. It sends a request only to an app Service the proxy manages, by its full in-cluster name, on one of the Service's ports, with TLS verified and redirects not followed. Any other target is a 403 that says why.503: a replica that cannot verify which replica owns a recording or replay forwards nothing. It answersOWNER_REPLICA_UNVERIFIEDwith aRetry-Afterheader, and the fix is to let the proxy's service account get and list pods.smart-set-agent.md,k8s-proxy-llm-workflow.mdandcloud-replay.md.Ordering
Sending a PAT or a service-account key directly already works on current proxy releases, so the new instructions are safe to publish before the proxy change. The statements that the shared token gets 403 become true with the k8s-proxy release that carries keploy/k8s-proxy#1126. This PR should merge with that change or before it.