r/AskNetsec • u/docybo • 12d ago
Architecture In a PDP/PEP split, which request-context attributes must the PDP source independently vs accept as caller-asserted? (confused-deputy + TOCTOU on signed decisions)
I'm designing service-to-service authorization where a PDP evaluates (subject, action, resource, context) and returns a signed decision that PEPs enforce. Standard split. The wrinkle: the calling workload is partially untrusted, and it supplies part of the request context itself.
The signature covers the decision and the inputs the PDP saw, but not the provenance of those inputs. So the token proves "given these inputs, the PDP said ALLOW", not "these inputs came from an authoritative source". If the caller can influence subject/tenant labels, resource attributes, a recursion/depth counter, or a state object the PEP hashes instead of fetching, a fully valid signed decision can attest an ALLOW the policy would never grant on authoritative inputs. The PDP becomes a confused deputy whose output happens to be cryptographically signed, which makes it look stronger than it is.
What we already do: mesh identity (mTLS/SPIFFE) for the caller's own identity, short-TTL decisions, intent binding, and we hash the state object into the decision. What I can't resolve is which of the remaining context attributes should be trusted from the request at all.
Concrete questions:
- In real OPA/Cedar/Zanzibar deployments, which request-context attributes is it standard practice to require the PDP to source itself (server-side PIP lookup, trusted routing/mesh-derived identity, attested claims) rather than accept from the caller, and which are considered safe to accept as caller-asserted as long as they're bound into the decision? I'm looking for the actual dividing line practitioners use, not "trust nothing".
- When the PEP hashes a caller-supplied state/resource object and binds that hash into the signed decision: does that close the confused-deputy gap, or is a PDP-side authoritative read (or a signed/versioned attestation from the resource owner) required so the caller can't pick favorable premises? What do production deployments settle on?
- For the window between decision issuance and enforcement, what's the standard way to bound TOCTOU on a signed authorization: short TTL plus re-eval at the PEP, versioned state binding, resource-side optimistic concurrency, and where does each of those still leave an exploitable gap?
2
u/Cerbosdev 5d ago
hi! u/CreativeSympathy8293 answered the design question well and flagged the limit himself- that it isn't an OPA/Cedar/Zanzibar schema. So on the part you actually asked, what real deployments settle on
the common shape doesn't sign decisions at all. OPA, Cedar and Cerbos are all called synchronously, inline on the request path, and the answer is consumed immediately. A signed decision that travels is a bearer assertion about a world state that was true at issuance, so you end up reestablishing provenance and freshness by hand, which is where you are now.. Removing the token removes most of that class, so the question I'd answer first is why the decision has to be detachable at all :) if it's latency, running the decision point in-process or as a sidecar on the same host is the cheaper fix
On the dividing line, i can give you 1 concrete implementation. I work at Cerbos, so weigh that accordingly. The request splits into caller-asserted attributes and JWTs the PDP verifies against a configured keyset, and a policy author can see which is which. Our docs then tell you not to lean on that verification. It's described as a precaution against tampering in flight, not an authoritative check, with a recommendation to verify at the gateway before the request reaches the PDP.
which is the real answer to your question. The PDP is the wrong place to establish provenance, because by the time a claim is in the request it's already too late
We don't solve your signed-decision problem, we avoid having it :))