Repository navigation
Conversation
The listener authenticator port and its token_file kind: a listener-tokens/v1alpha1 file read at start, every line's digest compared with no early exit, an expired line never authenticating. The listener.authenticator.kind and listener.authenticator.token_file keys, refused on stdio and on the enforcement API (ADR-0090). Signed-off-by: Konrad Karauda <konrad@karauda.com>
…ncipal The pipeline takes a call's principal from one source, set when it is built: the listener's configured principal, or the principal an authenticating adapter names for the call. An unset source, or one that disagrees with whether the adapter authenticates, refuses the pipeline. Under the authenticated source a principal stop and a principal pause match the principal the MCP listener authenticated. A call that carries no authenticated principal reads an active principal stop as unknown, so it is blocked STOP_STATE_UNAVAILABLE rather than let through. Under the configured source nothing changes. Signed-off-by: Konrad Karauda <konrad@karauda.com>
listener.authenticator.kind token_file makes an MCP HTTP listener answer 401 to a request without exactly one bearer Authorization header whose token a line of the token file holds and has not expired, before any upstream is reached; the principal of that line is the call's principal. A plane whose stop list holds an active principal stop of listener.principal.id refuses to start under token_file, naming the stop and how to lift it: such a stop would match no authenticated call, so carrying it would let it lapse unseen. Doctor reports the authenticator, the principals its file names and fails on the same stop; /healthz gives the kind, the principals and the requests refused. No token or digest is printed. scripts/ports.txt lists the listener-authenticator port. The token_file kind is refused under the signed authority: the file the plane's account owns would decide which principal an operator's stop or pause matches. Signed-off-by: Konrad Karauda <konrad@karauda.com>
The exported constants' comments open with their names, the zero-width character in a test id is spelled as an escape, and the fuzz target and the listener's 401 test hand their checks to helpers to stay within the complexity bound. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…heir principal The enforcement API authenticates nobody, so its calls now carry no principal for a stop or a pause: an active principal stop of the plane's tenant reads as unknown for every call (STOP_STATE_UNAVAILABLE, INDETERMINATE) and a principal pause of anyone pauses it, as ADR-0090 says. A stop of the configured principal moves from DENY to INDETERMINATE there; both block. Under a token file, a pause entry naming listener.principal.id refuses the start and fails doctor's pause line, as a stop of it already did. /healthz and doctor judge a principal stop or pause by the calls that carry its principal: another principal's is held and covers some calls, the configured one's is unheld and covers none, with the reason, and on the enforcement API it covers every call. /healthz names the listener's principal source. Signed-off-by: Konrad Karauda <konrad@karauda.com>
A token file may no longer name listener.principal.id, and refuses a line holding the digest of the empty token. Under a token file, the health answer and doctor report a principal stop or pause as matching no call when no unexpired line names the principal, and as unknown where the file was not read. The core now ties the unauthenticated principal source to an adapter whose calls carry no caller the plane can name, which the enforcement adapter declares. Signed-off-by: Konrad Karauda <konrad@karauda.com>
…judged Signed-off-by: Konrad Karauda <konrad@karauda.com>
A how-to for the token file, ADR-0090 amended and accepted, the status row and its details, the token file's contract, the changelog entries, and the pages whose claims the authenticator and the enforcement API's missing principal change. configuration.md and the site regenerated. Signed-off-by: Konrad Karauda <konrad@karauda.com>
Signed-off-by: Konrad Karauda <konrad@karauda.com>
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
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 changed, and why
An MCP HTTP listener can now name the principal of each call from a bearer token, so a principal stop or pause matches one caller instead of every call of the plane.
listener.authenticator.kindstaysnoneby default. Withtoken_file,listener.authenticator.token_filenames alistener-tokens/v1alpha1file holding, per line, a token's SHA-256 digest, a principal id and an expiry. The authenticator is experimental.listener.principal.idare refused; for the last, the start and doctor'slistener.authenticatorline name the line and say to give that caller another principal id.401unless a request carries exactly one valid bearer token, and503when it cannot judge one.token_fileis refused on stdio, on the enforcement API and underapprovals.authority: signed.token_file, a stop or pause of the configured principal, or of a principal no unexpired line names, matches no call. A pause of the configured principal now refuses the start and fails doctor'spauseline, as a stop of it already did. Doctor and/healthzreport such a stop as unheld and such a pause as coveringnone, with the reason. A stop or pause of a principal the file names is held and coverssomecalls, neverall./healthzreportslistener.principal_source:configured,authenticatedornone(the enforcement API).Breaking, on the enforcement API (
listener.kind: enforce_api): that API authenticates no caller, so its calls carry no principal for stops and pauses. While any principal stop of the plane's tenant is active, every call is blockedINDETERMINATEwithSTOP_STATE_UNAVAILABLE. Before, a stop of the configured principal gaveDENYwithAGENT_OR_PRINCIPAL_STOPPEDand a stop of another principal let calls run. A principal pause of any principal now pauses every call. The CHANGELOG says to lift a stop or remove a pause meant for one principal.Invariant or record
Implements ADR-0090, now accepted and amended for the pause refusal, the enforcement API's principal source, the refusal under signed approvals, the refused token lines, and one limit: principal ids are compared byte for byte, not normalised. ADR-0083 gets a pointer for the enforcement API.
Invariants:
INDETERMINATEis notALLOW(an unknown stop state blocks); fail closed (an authenticator that cannot judge answers503); security behaviour has adversarial tests.Stated limits, not changed here: the token file's parent directory is not judged; no ACLs are read beyond mode bits; policy rules keyed on the configured principal id still read it under
token_file.How it was tested
token_file, a pause of the configured principal let a call reach the upstream while/healthzsaid the pause coveredall. An enforcement API call ran under a stop of another principal. A pause of a principal no token line names was reported as coveringsome. A token line naming the configured principal, and one holding the empty token's digest, were accepted.aliceblockingalice's call whilebob's call runs.internal/listenerauth(35 tests),internal/gateway(1394),adapters/enforce(463),internal/hookbridge(143) andcmd/guardana-gateway(947, 3 skipped) passed.adapters/mcp(571) passed on Linux at the final code.internal/gatewayconfig(660, 1 skipped),internal/gateway/e2e(132) andbench(16) passed in the second round and were not re-run locally after the third; CI runs them.make vet, vetting withtwoaccounts, linting on macOS and Linux, formatting,check-sizes,check-brandanddocs-checkpassed.go.mod, root or ACLs in the test container failed for that reason only, the same list as on the base. No gateway binary was run live; the listener,/healthzand doctor ran in-process. No race run and no localqualityrun. CI'squalityrun is the gate.Documentation
New guide:
docs/guides/authenticate-mcp-callers.md.docs/status.mdgains the experimentallistener-authenticatorrow, and its gateway and run-stop passages changed.Also changed: the listener token file in contracts, the generated configuration reference, the reaction, signed reaction, runs and MCP coverage references, the threat model, enforcement modes, privacy, control and supervision and where-it-fits pages, the run-the-gateway, troubleshoot, container, two-tasks and existing-setup guides, the backlog, and the site.
CHANGELOGhas an Added entry and a Breaking entry under Changed. Of the 37 pathsdocs-impactflags, 17 changed; the other 20 were read and still hold. Five pages it does not flag changed as well.