Ambitwin · source-available, not open source · © 2026 Nicolò Ghignatti
| Word | Meaning | Example |
|---|---|---|
| Service mesh | A layer that secures traffic between services, outside their code | Istio |
| mTLS | Encryption where both sides prove who they are | Between any two pods |
| Workload identity | The mesh’s proof of which service is calling | chat’s account |
| ztunnel | Istio’s per-node proxy, carries all traffic | One per node |
| Claims header | Who the person is, set by the edge | x-gateway-claims |
| Forge | Send a made-up header to pose as someone | A fake admin claim |
Who is trusted, by whom, and where that stops.
| Layer | Question | Where |
|---|---|---|
| Edge | Is this a real signed-in person? | Istio gateway, once |
| Mesh | Is every hop encrypted, and from a real workload? | ztunnel, PeerAuthentication: STRICT |
| Service | May this person, in this organization, do this? | Cedar, inside the service |
flowchart LR
K["Keycloak"] --> G["claims-gateway: makes the internal JWT"]
G --> B["Browser"]
B --> E["Edge: checks JWT once"]
E -- "x-gateway-claims" --> S["Service: reads header, runs Cedar"]
S -- "same header, mTLS" --> S2["Next service"]Why once: services hold no signing keys, and no request pays for checking twice.
A workload already inside the cluster can call a service directly and send a forged header. mTLS proves the connection, not the content.
agent: gets extra care, since it runs an LLM on untrusted text. Only the gateway and chat may reach it (k8s/istio-agent-authz.yml).This holds while one cluster serves one customer. With several tenants in one hosted cluster, one broken workload becomes a cross-tenant leak. Then each service needs its own ServiceAccount and an AuthorizationPolicy listing its callers, as agent has.
| Path | Why open | What guards it |
|---|---|---|
/gateway | client has no token before signing in | Keycloak |
/telemetry/ingest, /collector, /observations | Devices have no person | HMAC with the building’s key, in telemetry |
/agent | The eval runner has its own token | The edge removes any x-gateway-claims, and the policy above |
/grafana | It has its own login | Only that password |
/ | The app itself | Nothing needed |
Why /agent strips the header: the door is open, so nobody checked that header. agent would believe a forged one.
| Between | Key | Note |
|---|---|---|
Keycloak and claims-gateway | OIDC | Only claims-gateway talks to Keycloak |
claims-gateway and the edge | RS256, public keys at JWKS | Only claims-gateway signs |
| Control plane services | Shared HMAC secret | One implementation, in auth-contracts |
Devices and telemetry | HMAC, derived per building | Revoke by bumping an epoch. Separate key: this one leaves for customer sites |
ztunnel only does L4, so nothing parses bulk traffic. Parsing stays at the edge, where decisions are made.Measured on a single dev node: Redis p50 stays under 5 ms inside the mesh.
istiod is outside the mesh, so ztunnel refuses its plain request. jwksUri goes through the gateway’s own route instead.
fromHeaders or fromCookies on a jwtRule turns off Authorization: Bearer. List both: browsers use the cookie, others the header.
Istio’s /twin/* does not match /twin, but the route does. Every protected service is listed in both forms.
--import-realm skips a realm that exists. After changing keycloak/realm-export.json, delete the keycloak_postgres_data volume and let it import again.
Same gated paths. Local only:
/*-db-gui.Simulators are never deployed to the cluster. They post to /telemetry/ingest like any device.
The manifests give a working cluster. These inputs cannot live in the repository:
| Needed | Today |
|---|---|
| HTTPS | The gateway listens on plain :80 |
| Keycloak | Not in these manifests |
| Image access | :latest with IfNotPresent. Use fixed tags |
| Real secrets | scripts/k8s/k8s-secrets.sh makes dev ones |
| Model key | agent starts without OPENROUTER_API_KEY, then fails each request |
| Strong Grafana password | It is the only guard there |