Skip to content

Cedar Policies

JITSudo uses the Cedar policy language for fine-grained, tenant-isolated authorization. Policies determine whether access requests are auto-approved, require manual review, or are denied.

  • Fail-closed — requests are denied by default unless a policy explicitly permits them
  • Priority-based — rules are grouped by priority (higher priority evaluated first); lower priorities cannot override higher priority decisions
  • Tenant-isolated — policies are scoped to a tenant via tenant_id

Policies are stored in a decomposed format in the database, then assembled into Cedar text for evaluation. The key fields are:

FieldDescription
effectpermit or forbid
principal_scope_typeany, eq, in, is, is_in
principal_entity_type / principal_entity_idWho the policy applies to
action_scope_typeany, eq, in
action_idsArray of action names
resource_scope_typeany, eq, in, is, is_in
resource_entity_type / resource_entity_idWhat resource the policy applies to
conditionsRaw Cedar when / unless clauses
approval_modeauto (skip review), require (needs approval), break_glass
approval_timeoutDuration after which unapproved requests expire
EntityTypeDescription
PrincipalUserThe user making the request
ActionActionThe action being requested
ResourceAwsAccountAWS account
ResourceAwsPermissionSetIAM Identity Center permission set
ResourceAwsS3BucketS3 bucket
ResourceAwsRdsInstanceRDS database instance
ResourceAwsEc2InstanceEC2 compute instance
Terminal window
# Create a policy rule
curl -X POST https://jitsudo.example.com/v1/policy-rules \
-H "X-API-Key: <api-key>" \
-H "X-Tenant-ID: <tenant-uuid>" \
-H "Content-Type: application/json" \
-d '{
"name": "auto-approve-dev",
"description": "Auto-approve dev account access for engineering",
"effect": "permit",
"principal_scope_type": "in",
"principal_entity_type": "User",
"principal_entity_id": "group:engineering",
"action_scope_type": "eq",
"action_ids": ["request_access"],
"resource_scope_type": "eq",
"resource_entity_type": "AwsAccount",
"resource_entity_id": "123456789012",
"conditions": "context.duration_seconds <= 14400",
"approval_mode": "auto",
"priority": 100
}'
# Get the assembled Cedar text
curl https://jitsudo.example.com/v1/policy-rules/<id>/raw \
-H "X-API-Key: <api-key>" \
-H "X-Tenant-ID: <tenant-uuid>"

When a request is submitted, the policy engine:

  1. Loads all policy rules for the tenant, ordered by priority (highest first)
  2. Evaluates Cedar policies against the request context
  3. Returns a decision with: permitted (bool), matching_policies (UUIDs), reason, and approval_mode
  4. Short-circuits at the first matching priority group — lower priority rules don’t override