When a PEP submits a PORC expression for evaluation, the PolicyEngine needs to understand the resource's metadata—its group membership, classification, ownership, and annotations. There are three approaches to providing this information, and they can be used individually or in combination.
| Approach | Availability | How It Works |
|---|---|---|
| MRN String with Selector Resolution | All editions | PEP sends MRN string; PolicyEngine resolves metadata via regex patterns in PolicyDomain config |
| MRN String with External Resolution | PEP sends MRN string; PolicyEngine resolves metadata via your custom resolver integration | |
| Fully-Qualified Descriptor | All editions | PEP sends complete resource metadata; no resolution needed |
:::info Combining Approaches These approaches are not mutually exclusive. A single deployment can use all three:
When an MRN string is provided, resolution follows this order:
resources sectionAll approaches use Manetu Resource Notation (MRN) to identify resources:
mrn:<type>:<namespace>:<resource-class>:<instance>
Examples:
mrn:vault:acme.com:secret:api-keymrn:iam:role:adminmrn:app:myservice:user:12345mrn:data:analytics:report:monthlyThe simplest approach: provide only the resource's MRN string and let the PolicyEngine resolve metadata using pattern matching.
{
"resource": "mrn:app:myservice:document:12345"
}
The PolicyEngine matches the MRN against regex patterns (selectors) defined in your PolicyDomain configuration:
apiVersion: iamlite.manetu.io/v1beta1
kind: PolicyDomain
metadata:
name: my-domain
spec:
resources:
- name: user-documents
selector:
- "mrn:app:.*:document:.*"
group: "mrn:iam:resource-group:documents"
annotations:
- name: classification
value: "\"MODERATE\""
- name: admin-resources
selector:
- "mrn:admin:.*"
group: "mrn:iam:resource-group:admin"
annotations:
- name: classification
value: "\"HIGH\""
When a PEP sends mrn:app:myservice:document:12345, the PolicyEngine:
mrn:app:.*:document:.* matchesmrn:iam:resource-group:documentsclassification: "MODERATE" annotationIf no selector matches, the resource is assigned to the default resource group.
Extends selector resolution by dynamically resolving metadata from external systems. This approach maintains the same simple PEP interface—just send an MRN string—while enabling per-resource granularity.
{
"resource": "mrn:app:myservice:document:12345"
}
The Premium Edition allows you to integrate custom resolvers that fetch metadata at decision time. When an MRN doesn't match any PolicyDomain selector, the external resolver is consulted before falling back to the default resource group.
Custom resolvers can:
The PEP still sends just an MRN string, but the PolicyEngine can resolve rich, per-resource metadata dynamically.
:::tip Combining with Selectors External resolution works alongside PolicyDomain selectors, not instead of them. You can define selectors for resources that fit patterns and rely on external resolution for everything else. This hybrid approach lets you handle common cases efficiently while maintaining flexibility for exceptions. :::
The PEP provides complete resource metadata directly, bypassing all resolution.
{
"resource": {
"id": "mrn:app:myservice:document:12345",
"owner": "user@example.com",
"group": "mrn:iam:resource-group:documents",
"classification": "MODERATE",
"annotations": {
"department": "engineering",
"sensitive": true
}
}
}
| Field | Required | Description |
|---|---|---|
id | Yes | Unique resource identifier (MRN) — has first-class representation in AccessRecord |
owner | No | MRN or identifier of the resource owner |
group | Yes | MRN of the resource group — used to select the Phase 3 resource policy |
classification | No | Security classification level |
annotations | No | Custom key-value metadata |
:::note
When using the MRN string format, the PolicyEngine automatically populates resource.id and resource.group from resolution before processing. With Fully-Qualified Descriptors, the PEP must provide these fields directly:
id — Required for complete audit records (first-class field in AccessRecord)group — Required for policy evaluation (Phase 3 is mandatory; omitting this field will result in a DENY)
:::| Level | Value | Description |
|---|---|---|
LOW | 1 | Public data |
MODERATE | 2 | Internal data |
HIGH | 3 | Confidential data |
MAXIMUM | 4 | Top secret data |
UNASSIGNED | 5 | Not yet classified |
The PolicyEngine uses the provided metadata exactly as-is. No selectors are consulted, no external resolvers are called.
// Application knows the document details from its database
doc := getDocumentFromDB(documentID)
porc := map[string]interface{}{
"principal": principal,
"operation": "api:documents:read",
"resource": map[string]interface{}{
"id": fmt.Sprintf("mrn:app:docs:document:%s", doc.ID),
"owner": doc.OwnerEmail,
"group": doc.ResourceGroup,
"classification": doc.Classification,
"annotations": map[string]interface{}{
"department": doc.Department,
"created": doc.CreatedAt.Format(time.RFC3339),
},
},
"context": context,
}
| Consideration | Selector Resolution | External Resolution | Fully-Qualified |
|---|---|---|---|
| Availability | All editions | All editions | |
| PEP complexity | Minimal | Minimal | Higher |
| Metadata granularity | Pattern-based | Per-resource | Per-resource |
| Metadata source | PolicyDomain config | Your external systems | Application |
| Owner tracking | Not available | Available | Available |
| Update workflow | Edit PolicyDomain | Update external system | Update PEP code |
| Resolution latency | Fast (in-memory) | Variable (external call) | None |
Choose Selector Resolution when:
Add External Resolution (Premium) when:
Choose Fully-Qualified Descriptors when:
For the Community Edition, configure resource resolution in the PolicyDomain's resources section (v1alpha4+):
apiVersion: iamlite.manetu.io/v1beta1
kind: PolicyDomain
metadata:
name: my-domain
spec:
resources:
- name: internal-docs
description: "Internal documentation"
selector:
- "mrn:docs:internal:.*"
- "mrn:wiki:company:.*"
group: "mrn:iam:resource-group:internal"
annotations:
- name: classification
value: "\"MODERATE\""
- name: audit_required
value: "false"
- name: secrets
description: "Secret and credential resources"
selector:
- "mrn:secret:.*"
- "mrn:vault:.*:credential:.*"
group: "mrn:iam:resource-group:restricted"
annotations:
- name: classification
value: "\"MAXIMUM\""
- name: audit_required
value: "true"
See Resources Schema Reference for complete documentation.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |