identity: one authorizer assembly for every policy enforcement point #839
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.68) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.68 · 439 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.364
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.068
Real PR Conversation Timeline
1 comments
"Review active on #839"
general
weight: 0.35
aojea
Follow-up to #838 (merged). Rebased onto
mainatc5562280. Three commits: the authorizer consolidation, the two review items on the merged ingress code (bounded ingress dial;api.HasDotSegmentas the single dot-segment check, backslash-aware), and a scrub of test identities toexample.compersonas.Summary
The node's in-mesh verifier (
verifyBiscuitTokenWithRules), the node's external ingress handler, and the control plane's/sts/tokeneach assembled their Datalog authorizer by hand: service fact, HTTP and egress facts, replay binding, target facts and check, local attenuation, baseline policies and rules, mesh rules — three copies. They matched by discipline, not by construction, and one divergence had already crept in: the ingress path took anEnforceTargetCheckknob and skippedBaselineTargetCheckwhen the node had no identity, where the in-mesh path always added it.identity.AuthorizeMeshRequest(authorizer, MeshRequest, MeshPolicy)is now the only place a mesh authorizer is assembled.MeshRequestsays what the request is:service();method()/path()only whenHasHTTP;host()/port()only whenHasEgress;connection_peer_id()+BaselineReplayCheckonly whenConnectionPeeris set;target_unrestrictedonly whenUnrestricted. Every absent field means "not present" and fails closed.MeshPolicysays what the PEP adds: its own target facts, local attenuation, synced mesh rules.BaselineTargetCheck, baseline policies/rules/HTTP rules,expiration().MeshRequest.TaskRequest()derives theTaskAuthorizationRulecontext from the same value.Callers
| PEP | Change |
|---|---|
| Node in-mesh (
internal/node/middleware.go) | ~90 lines of inline assembly andinjectIdentityFactsreplaced byMeshRequest{ConnectionPeer, Unrestricted: Local, …}+n.meshPolicy()|| Node ingress (
internal/node/ingress.go) | samen.meshPolicy();EnforceTargetCheckremoved, target check now unconditional || Router edge (
internal/router/ingress.go) |IngressEvalParamskeeps its fields and delegates to the shared assembly || Control plane
/sts/token(internal/controlplane/sts.go) |MeshRequest{egress, Unrestricted, ConnectionPeer: clientPeer};stsDestinationRulesasLocalRules|Production code is net +27 lines (
+305/−278); the rest is tests and docs.Tests
TestAuthorizeMeshRequest— 11 table cases pinning what eachMeshRequestfield contributes and that each fails closed when absent (HTTP-narrowed grant on a bare stream, node-scoped grant without provider target facts, replay from a different connection peer, border bearer without connection peer, local deny).TestIngressEvalParamsMatchMeshRequest— runs the ingress evaluator and the shared assembly on identical inputs and requires the same decision: the structural "no leak between paths" guard.Docs
external-ingress.md: new section "Ingress is for callers without a sidecar" — an agent on the mesh calls peers through its sidecar; the ingress URL is neither a second route for it nor one that accepts its node credential; same policy on both paths, no privilege by path choice.security-architecture.md: "One authorizer assembly for every PEP".Validation
On the rebased branch:
make,go vet,make lint(0 findings),-raceunit tests forapi,identity,node,router,controlplane,envoy,standalone, and the fulltests/integrationsuite serially (all pass).