Control plane
Two Konnect hybrid control planes are created and configured through API/decK. Local Kong data planes establish mTLS uplinks through an Nginx alias proxy and cache configuration for disconnected operation.
A cross-module technical model of the running lab (the phase 5 compose stack plus the phase 6 audit spine): processes and ports, trust boundaries, token paths, request sequences, persistence, failure behavior, audit joins, and the precise delta to the upcoming MCP specification.
The lab as implemented: client populations, the Keycloak issuer, two Kong tiers, first-party MCP servers, governed vendor egress, and the audit spine.
Workforce PKCE client
DPoP-bound workforce client
Patient PKCE client
mTLS loop agent
Test clients
Keycloak hub
Kong internal DP
Kong external DP
cnf · dpop · DLP · vendor-token plugins
FHIR MCP → HAPI
Scheduling MCP → Postgres
Broker → OpenBao
Vendor MCP
Two Konnect hybrid control planes are created and configured through API/decK. Local Kong data planes establish mTLS uplinks through an Nginx alias proxy and cache configuration for disconnected operation.
Requests stay on local Docker/k3d paths except real Konnect control traffic and optional real Auth0/GitHub integrations. HAPI data is synthetic. Kong first-party routes forward to container ports; egress routes forward only to registered vendor service URLs.
MCP transport sessions are disabled. FHIR calls are request-local. Scheduling continuity is a UUID handle in Postgres. Broker grants are versioned OpenBao entries, while consent transactions and single-flight locks are process-local memory.
Services emit JSON audit lines. Alloy ships Docker logs to Loki. Kong exports OTel logs/traces through Collector to Loki/Tempo. Grafana queries by token ID or hub JTI.
| Host port | Component | Purpose | Security posture in lab |
|---|---|---|---|
| 3000 | Grafana | dashboards | local admin credential |
| 3100 / 3200 | Loki / Tempo | logs / traces APIs | no auth, local lab |
| 4317 / 4318 | OTel Collector | OTLP gRPC / HTTP | compose-network and host exposed |
| 7001 | homegrown issuer | legacy token issuer | HTTP, static lab client |
| 8080 | Keycloak | public lab issuer and browser flows | HTTP development mode |
| 8081 | HAPI FHIR | synthetic R4 backend | direct host access for tests |
| 8100 | Kong internal | workforce/internal MCP and egress | HTTP bearer path |
| 8143 | Kong internal TLS | certificate-bound agent path | lab-CA TLS + client cert inspection |
| 8200 | Kong external | curated patient/partner surface | HTTP bearer path |
| 8210 | OpenBao | dev Vault API | dev root token; broker uses scoped token |
| 8300 | broker | consent and grant API | HTTP; hub JWT on protected routes |
| 8310 | mockhub | mock OAuth AS and vendor MCP | HTTP test service |
| 8443 | Keycloak TLS | mTLS client credentials | lab-CA TLS; requests client cert |
{
"iss": "hub issuer",
"sub": "effective principal",
"aud": ["one tier audience", "one or more server resources"],
"azp": "calling client or agent",
"exp": 0, "iat": 0, "jti": "opaque join key",
"mcp_contract": "1.0",
"mcp_tier": "internal | external",
"idp_origin": "ping | athenz | homegrown | keycloak | auth0",
"scope": "space-delimited scopes",
"act": {"sub": "acting workload"},
"cnf": {"x5t#S256 | jkt": "certificate or DPoP key thumbprint"},
"fhir_patient": "conditional patient ID",
"groups": ["normalized roles"]
}
| Validation | Kong tier wall / OIDC | MCP servers | Broker |
|---|---|---|---|
| JWT signature | OIDC only on selected routes; pre-function itself parses unverified | yes, remote JWKS | yes, remote JWKS |
| Algorithm | OIDC configuration-dependent | PS256 / ES256 | PS256 / ES256 |
| Issuer / expiration | OIDC routes | yes | yes + 30s leeway |
| Tier audience | internal/external wall | exactly one tier-shaped audience, but no tier-claim match | internal audience + one tier-shaped audience |
| Server resource audience | first-party routes defer to server | configured audience | not applicable |
| Mandatory contract claims | route-specific | requires sub/azp/exp/iat/jti plus contract/tier checks (since 2026-09-30) | requires exp/iat/sub/jti plus contract/tier checks |
| Certificate binding | cnf-check at internal DP | not rechecked | lab substitution; hub bearer revalidation |
| DPoP sender-constraint | dpop-check early rejection at internal DP; proof-replay cache fails closed (503) if the shared dict is missing or an insert errors | re-checked via requireDpop against cnf.jkt | not applicable |
| Tool scope | coarse route policy | HTTP-layer challenge plus a re-check in every tool handler; JSON-RPC batches refused | vendor scope ceiling and grant coverage |
MFA (amr) | not checked | mfa required for MCP_MFA_SCOPES (FHIR step-up); 401 insufficient_user_authentication | not applicable |
| Patient compartment | deferred | enforced; Auth0-origin tokens without a non-empty claim are rejected | not applicable |
mcp://tier/internal. The claim-driven sender-constraint plugins (cnf-check, dpop-check) pass plain bearer tokens untouched and enforce only when the token carries a binding. Rate limit applies. First-party route forwards to FHIR server.MCP_RATE_LIMIT_PER_MIN, default 600) run before any token work. A DPoP scheme shim then normalizes any DPoP auth header before bearer middleware verifies signature/issuer/expiry/resource audience; when the token carries cnf.jkt, requireDpop re-validates the proof. JSON-RPC batch arrays are refused. For tools/call, required scope (and amr∋mfa for MFA-gated scopes) is checked at the HTTP layer and again inside the tool handler. Tool list is group-shaped.cnf-check compares leaf SHA-256 thumbprint to token claim before forwarding.slot_hold_id carries continuity between calls/replicas.OpenBao custody, single-flight refresh, DLP verdicts, and vendor-token isolation.
| State | Owner | Durability | Failure behavior |
|---|---|---|---|
| Keycloak users, clients, grants | Postgres | Compose volume | identity unavailable if Keycloak/Postgres down |
| FHIR synthetic records | HAPI/Postgres | Compose volume | tool returns upstream error; audit deny |
| Scheduling holds | Postgres | Compose volume, cross-replica | DB error becomes tool error; schema startup blocks listener |
| Vendor grants | OpenBao KV v2 | dev-mode memory in lab | Vault failure returns 503; no vendor call |
| Broker token cache | broker process | 60-second memory cache | cache loss rereads Vault |
| Consent transaction/state | broker process | 10-minute memory only | restart invalidates active browser flows |
| Refresh lock | broker process | memory only | 10-second timeout then reread; multiple replicas can duplicate refresh requests |
| Gateway configuration | Konnect DP cache | DP local cache | DP continues serving during CP uplink loss |
| Audit logs/traces | Loki/Tempo filesystem | Compose volumes | lab-only single-node retention |
McpServer per request via createMcpHandler._meta; server/discover answers with supported versions.MCP-Protocol-Version / Mcp-Method / Mcp-Name headers against the body.server/discover and advertise supported versions/capabilities/serverInfo._meta.MCP-Protocol-Version, Mcp-Method, and conditional Mcp-Name against the body.Modern HTTP exposes POST only; GET and DELETE on /mcp answer 405 after authentication (no server-initiated stream, no session teardown). Request-scoped SSE remains optional. Client disconnect should cancel work: the FHIR fetch has a timeout signal but is still not wired to the client disconnect signal.
If legacy support is required, v2 auto-negotiation should probe modern discovery and fall back to initialize-era behavior. The server must distinguish modern protocol errors from legacy endpoint absence.
| Area | Present | Required remediation |
|---|---|---|
| PKCE | Public clients and broker use S256; mockhub enforces verifier | Broker must verify discovered AS metadata advertises S256 before starting authorization |
| Protected Resource Metadata | path-inserted and root routes; authorization server list; header method; DPoP signing algorithms; empty scope lists omitted | Use canonical HTTPS MCP endpoint as resource (the mcp:// form is a documented deviation, issue #13); match retrieval/request URL exactly |
| Resource indicators | server audience is checked | Replace mcp://srv/* PRM resource with HTTPS endpoint resource; retain tier audience separately if desired |
| Authorization server discovery | Keycloak OIDC discovery; vendor RFC 8414 fetch | Validate metadata issuer and HTTPS endpoints; implement MCP-prescribed discovery behavior in clients |
| Issuer identification | broker validates RFC 9207 issuer when advertised | Ensure every operated OAuth client validates issuer, including errors; production issuer must be HTTPS |
| Redirect URIs | PKCE clients register exact localhost /callback URIs (RFC 9700 exact match; issue #15 closed) | Done in the lab; production keeps exact registration (native loopback port variance per RFC 8252 where a client requires it) |
| Transport security | mTLS workload leg; otherwise HTTP lab | Production TLS everywhere with consistent public issuer/resource URLs |
| Refresh protection | mock rotation/replay burn; broker CAS/single-flight | Distributed lock for multi-replica broker; sender constrain or rotate public-client refresh tokens at AS |
| Sender-constrained tokens | DPoP enforced at the internal DP and re-checked at the servers for workforce-dpop; mTLS cnf binding for workloads | Extend to claude-code when the client ships proof support; production should enforce DPoP at the AS for all public interactive clients |
| Token passthrough | vendor route replaces hub token; the FHIR server never forwards the caller’s token (optional server-owned UPSTREAM_API_KEY only) | Done — the dormant passthrough branch was deleted in the 2026-09-30 server rewrite |
token_id / hub_jti → principal → acting_agent → client
→ origin_idp → tier → patient_compartment
→ server / route → tool → decision / reason → timestamp
FHIR and scheduling audit the final tool outcome. FHIR distinguishes compartment, upstream exception, and upstream HTTP denial. Scope middleware audits insufficient scope.
cnf-check logs certificate-binding denials. dpop-check logs proof rejections and degraded-cache events. DLP logs both clean passes and blocks. vendor-token logs broker decisions and DPoP-scheme refusals. OpenTelemetry adds request traces.
Consent, resolve path, refresh generation, stale transition, mass-stale page, revoke, security callback failures, and admin denial are JSON events.
The lab is not an immutable SIEM, has no production retention policy, and uses unauthenticated local Loki/Tempo. Audit completeness still depends on every rejection path emitting a record.
All eight phase gates were green on the last full run (2026-10-01 on main 0638fdf: 159 of 159 tests, nothing skipped, the real-GitHub egress and Auth0 legs included — phase 1: 72, 2: 11, 3: 12, 4: 9, 5: 17, 6: 6, 7: 32, plus phase 0’s 4 smoke checks). Every phase also starts from a clean clone. The offline suite (make test, no accounts) holds 248 tests: servers 89, broker 97, DB-less Kong plugins 47, kit claim vectors 15 (plus 4 skipped). The npm workspace build (shared core and both servers) is clean. On 2026-09-30, npm audit and pip-audit reported zero known vulnerabilities, and CI now fails on any high-severity advisory.
GitHub Actions runs lint, types, the offline suites, image builds, decK/compose/realm validation, link and shell checks, and blocking npm audit / pip-audit; CodeQL and Dependabot run alongside. CI also brings up the phase 0 and phase 1 quickstarts from a clean checkout and runs gates 0–1. Konnect/Auth0/GitHub/k3d acceptance (phases 2–7) remains manual.
Run builds, dependency audits, new unit tests, modern MCP conformance, Origin negatives, OAuth discovery/PKCE/redirect tests, phases 0–7, race tests, and a fresh token-in-log scan. Record exact versions and the deployed configuration commit.