WorkflowAccessPolicy spec

The basic spec for a Dapr WorkflowAccessPolicy resource

The WorkflowAccessPolicy is a Dapr resource that controls which applications can schedule workflows and activities cross-app on a target application. Policies are a pure allow-list: a call is permitted if any loaded rule matches.

Format

apiVersion: dapr.io/v1alpha1
kind: WorkflowAccessPolicy
metadata:
  name: <REPLACE-WITH-NAME>
  namespace: <NAMESPACE>
scopes:
  - <TARGET-APP-ID>
spec:
  rules:
    - callers:
        - appID: <CALLER-APP-ID>
      workflows:
        - name: <WORKFLOW-NAME-OR-GLOB-PATTERN>
          operations: [schedule]
      activities:
        - name: <ACTIVITY-NAME-OR-GLOB-PATTERN>

Spec fields

Fields are listed in the order they appear in the YAML document.

FieldRequiredTypeDescriptionExample
scopesNlistTarget App IDs that this policy applies to. If omitted or empty, the policy applies to all applications. The policy is enforced on the callee (target) side.["order-service"]
rulesNlistAllow-list of rules. A call is permitted if any rule matches. If rules is omitted or empty while policies are loaded, all cross-app calls are denied.See below
rules[].callersYlistList of caller objects that this rule applies to. Must contain at least one entry.See below
rules[].callers[].appIDYstringThe Dapr App ID of the calling application. The caller must be in the same namespace as the target; cross-namespace workflow calls are always denied and are not supported.frontend-app
rules[].workflowsN*listWorkflow rules granted to the matched callers.See below
rules[].workflows[].nameYstringExact name or glob pattern of the workflow. Supports *, ?, and [abc] character classes.OrderWF, Report*
rules[].workflows[].operationsYlistSet to [schedule]. The CRD also accepts terminate, raise, pause, resume, purge, get, rerun for forward compatibility; these have no effect today because the matching public workflow APIs do not route cross-app.[schedule]
rules[].activitiesN*listActivity rules granted to the matched callers. Activities only support scheduling, so there is no operations field.See below
rules[].activities[].nameYstringExact name or glob pattern of the activity.ChargePayment, Refund*

* At least one of workflows or activities must be present in each rule.

Example

The policy below applies to the order-service application. It grants frontend-app and api-gateway permission to schedule OrderWF, CheckoutWF, and the ProcessPayment activity. A second rule grants admin-app permission to schedule any workflow or activity on order-service.

apiVersion: dapr.io/v1alpha1
kind: WorkflowAccessPolicy
metadata:
  name: order-processing-policy
  namespace: production
scopes:
  - order-service
spec:
  rules:
    - callers:
        - appID: frontend-app
        - appID: api-gateway
      workflows:
        - name: OrderWF
          operations: [schedule]
        - name: CheckoutWF
          operations: [schedule]
      activities:
        - name: ProcessPayment
    - callers:
        - appID: admin-app
      workflows:
        - name: "*"
          operations: [schedule]
      activities:
        - name: "*"