-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Entitlement Policy Deployment Model
Context and Problem Statement
The Entitlement Policy (rules, logic, etc.) defines the provisioning of Entitlements to an Entity. The process of determining what entitlements an Entity may have include the processing of Subject Sets against and Entity, the lookup of an Entity from an authoritative source, the inclusion of customer/deployment specific policy as well as interfacing with external federated Entitlement Services.
There is also a need to support the injection and verification of an Entitlement Policy from an external source or configuration.
Decision Drivers
- We don't want to have a high deployment and configuration burden
- We want to reduce friction for Entitlement Policy Authors
- We don't want to re-invent a policy injection, verification and distribution framework
- We want to decouple the platform from Entitlement specific logic and integrations
- We want to support the inclusion of policy and associated integrations dynamically and not known in advance the core platform
Considered Options
- Custom + Configuration Driven
- OPA Configuration Driven
- OPA Bundle with Custom Built-In Functions
Decision Outcome
OPA Bundle with Custom Built-In Functions
This option allows for encapsulation of core capabilities as standard Go code while at the same time leveraging an open standard to allow for extensibility, deployment and verification.
Custom + Configuration Driven
This option includes the custom development of an extensible, shareable policy framework.
Pros/Cons:
- 🔴 Re-Invent policy language, infrastructure
- 🔴 Re-Invent a verifiable, shareable policy mechanism.
OPA Configuration Driven
This option uses OPA and Platform configuration to wire up and initialize an OPA runtime; this is current state. This solution includes Rego implementation of Subject to Entity Mapping interpretation. OPA plugins are known prior to deployment.
Pros/Cons:
- 🟢 Leverages an existing and widely used standard (OPA)
- 🔴 Extensibility friction
- 🔴 Coupling to Policy implementation
- 🔴 OPA/Rego learning curve
OPA Bundle with Custom Built-In Functions
This option uses an OPA Bundle as the deployment unit and consumption into the Entitlement Service. Core platform OPA built-in functions are used to support common core platform functions. Standard OPA external data fetching flows (e.g. Rest Endpoint) are used to support deploy time specific customizations. This allows for decoupling of entitlement logic; both core and extensions; from the platform as well as supports future requirements of distributed, federating and verifying policy artifacts.
This option includes the creation and enforcement of the following design guidelines:
- Custom OPA Build-In Functions are to be used for encapsulating complexity in standard Go modules and thereby reducing Rego complexity and friction.
- IDP specific entity resolution implemented as Services following OPA's
Pull Data During Evaluationpattern and integrated through standard OPA http requests.
The implications of this approach:
- The creation of a function to support Subject Set / Entity Representation processing as an OPA Built-In Function.
- A Keycloak Entity Resolution Service reference implementation.
- Reference implementation Rego policy using subject set and http based entity resolution call-out
Pros/Cons:
- 🟢 Leverages an existing and widely used standard (OPA)
- 🟢 Leverages a standard packaging, deployment and distribution flow (including verification)
- 🟢 Extensible and supports decoupling = Support dynamic injection of Policy
- 🟡 OPA/Rego learning curve - mitigated by the use of custom build-in functions to encapsulate complexity in standard Go
