Skip to content

docs: document per-caller Kubernetes authorization for the MCP server - #631

Merged
shano merged 5 commits into
mainfrom
docs/mcp-per-caller-rbac
Sep 15, 2026
Merged

shano merged 5 commits into
mainfrom
docs/mcp-per-caller-rbac

Conversation

@shano

@shano shano commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the obsolete shared-token and X-User-Identity customer setup with the current OAuth 2.1 deployment and browser-login flow.
  • Documents the required OIDC token audience, scopes, group claim and identity mapping.
  • Explains how to enable per-caller Kubernetes authorisation through either the Helm chart or the release manifests, including the group impersonation allowlist and customer-authored RoleBindings.
  • Separates human and machine identities and describes the local-only MCP_AUTH_TOKEN mode.
  • Adds a concise explanation and light/dark diagram of the caller → identity provider → MCP server → Kubernetes RBAC flow.
  • Corresponds to ske-mcp-server PR https://github.com/syntasso/ske-mcp-server/pull/11 and Helm chart PR feat(ske-mcp-server): support per-caller Kubernetes authorization helm-charts#238.

Review feedback addressed

  • Reworked the page into short configuration steps and scannable sections.
  • Made the Helm opt-in behaviour and release-manifest behaviour explicit.
  • Clarified that the server uses its own ServiceAccount credentials with impersonation headers; it never receives or forwards user Kubernetes credentials.
  • Explained effective prefixed identities, complete group allowlisting, identity-provider group-claim filtering and machine-caller configuration.
  • Added a separate caveats section, including system:authenticated, privileged catalogue and Event operations, and the distinction between Events and Kubernetes Audit logging.
  • Updated the diagram to show the effective prefixed groups used by Kubernetes RBAC and remain readable in dark mode.

Test plan

  • Updated the branch with current main without conflicts.
  • yarn install --immutable
  • yarn build
  • Validated the SVG as XML.
  • Rendered and visually checked the SVG in both light and dark palettes.

Five review passes against the actual ske-mcp-server implementation
(one cold-reader pass for clarity, four Codex passes for technical
accuracy) found and fixed:

- The mechanism was explained too abruptly and used RBAC, RoleBinding,
  and Kubernetes Events undefined; added a numbered sequence and defined
  each inline.
- "Nothing bespoke" and "no configuration required" overstated things
  given the doc didn't mention prerequisites; added them.
- The diagram only showed the RBAC-lookup half of the flow; redrawn to
  show identity provider through to the granted/denied result.
- The new section contradicted the page's older shared-token/
  X-User-Identity description with no explanation; added a note
  reconciling the two.
- "Each tool call runs as the caller" overstated scope: only
  per-namespace request reads/writes are impersonated, not catalog
  browsing or audit Event writes. Scoped the whole section accordingly.
- The RBAC allowlist and identity-prefix prerequisites were understated
  to the point of being misleading: Kubernetes denies the whole
  impersonated request if a caller's token carries even one group outside
  the ServiceAccount's allowlist, not just that group; and an existing
  RoleBinding on a caller's literal username or group won't match without
  the configured prefix. Both are now stated directly, since they're the
  most likely real-world stumbling blocks for a customer setting this up.
- Those two prerequisites only apply to human OIDC callers; a
  client-credentials (machine) caller uses a completely separate, fixed
  identity mapping and was initially described as if it needed the same
  configuration. Scoped and documented separately.
- Minor: a claimed subject-claim name was overclaimed as "username", a
  comma splice, RoleBinding-only wording where a ClusterRoleBinding also
  applies, and a diagram arrow label missing Impersonate-User alongside
  Impersonate-Group.

Corresponds to ske-mcp-server PR #11: five rounds of adversarial review
led to real security fixes there too (static-token identity spoofing,
streaming buffer leaks, cache-key collisions, actor misclassification,
and more) - this section's claims were re-verified against that PR's
final state, not an earlier snapshot of it.

`yarn build` passes clean.
@shano
shano force-pushed the docs/mcp-per-caller-rbac branch from 1e60959 to fc6e30d Compare August 28, 2026 16:42
@SaphMB
SaphMB requested a review from jeduardo September 1, 2026 08:52
@jeduardo

jeduardo commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: fc6e30d1d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated
Comment thread docs/ske/10-integrations/30-mcp.mdx Outdated

@jeduardo jeduardo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prose is very hard to read and looks written as a first pass with the agent. I'm also missing the configuration bits required for this to work, is there anything new needed to make this work?

Also left some comments in the code, but I'd ask the agent to simplify these docs: they look a lot like raw initial agent output and are hard to parse.

@shano

shano commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@jeduardo I have reworked this in 0bbca8d and brought the branch up to current main.

The old shared-token customer instructions are now replaced by the production OAuth flow. The deployment section covers the required OIDC claims and scopes, Helm opt-in, release manifests, effective prefixed identities, group allowlisting and customer-authored RoleBindings. Human and machine callers are separate sections, and caveats now has its own heading.

One detail from the suggestions is deliberately phrased differently: the server impersonates a caller using its own ServiceAccount credential plus impersonation headers. It never uses the caller's Kubernetes credentials.

The page and updated diagram pass yarn build, and the diagram was rendered and visually checked. Ready for another review when you are.

@shano
shano requested a review from jeduardo September 15, 2026 10:13
Comment thread docs/ske/10-integrations/30-mcp.mdx
Comment thread static/img/ske/mcp/per-caller-rbac.svg Outdated

@jeduardo jeduardo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question and a suggestion, but none are blockers!

@shano
shano merged commit 11fbbde into main Sep 15, 2026
6 checks passed
@shano
shano deleted the docs/mcp-per-caller-rbac branch September 15, 2026 14:44
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.

3 participants