Chapter 7: The building blocks of policy
The introduction uses ACME’s real-time access decisions to show why rules are needed and introduces Cedar as a language for expressing them.
After this chapter you will be able to
- Rules behind real-time access. Explain how rules govern ACME’s real-time access decisions, using the deployment and document-sharing examples.
- Cedar across authorization models. Describe Cedar’s stated role in expressing fine-grained, real-time policies involving relationships, attributes, and contextual conditions across ReBAC and ABAC.
- Purpose and expressive reach. Explain why ACME chose a purpose-built policy language: Cedar can express fine-grained access rules based on relationships and other factors, rather than only job titles, in one policy language.
- Real-time policy performance. Explain why predictable, real-time policy evaluation mattered to ACME when authorization checks occur during requests.
- Predeployment policy analysis. Describe how Cedar’s support for static analysis addressed ACME’s concern about unintended access when policies change.
- Open deployment flexibility. Explain how Cedar’s open source implementation and embeddable engine met ACME’s need to evaluate policies in different parts of its architecture.
- Three policy elements. Describe effect, scope, and conditions as the three elements of a Cedar policy, distinguishing what a policy does, when it applies, and under what circumstances.
- Cedar policy effects. Explain that every Cedar policy begins with an explicit permit or forbid effect, which contributes a yes or no to the overall decision. Describe how a forbid overrides a permit when both apply.
- Policy scope and relevance. Explain how a Cedar policy’s principal, action, and resource scope identifies relevant access requests, using the employee-owned document example to show when a policy applies and when it does not.
- Contextual policy conditions. Explain that a policy’s conditions are optional Boolean expressions that must be true for the policy to apply, and describe how they express contextual rules separately from scope.
- Complete Cedar policy structure. Explain how the example policy combines a permit effect, a scope covering employees viewing or editing documents, and conditions requiring document ownership and a managed device.
- PARC request components. Describe the principal, action, resource, and conditions in a Cedar access request, including what each represents.
- Policy and request correspondence. Explain how a policy’s scope and conditions relate to the parts of an access request in Cedar.
- PARC Request Construction. Describe how an application constructs a Cedar access request by extracting a principal, action, resource, and context from runtime inputs and organizing them as structured data, usually JSON.
- Scope Conditions and Permit. Trace Bob’s edit request through the policy: match its principal, action, and resource against scope, then test ownership and managed-device conditions to explain the permit result and the unmanaged-device contrast.
- External Entity Data Dependencies. Explain what the application must supply alongside a Cedar request and why the ownership condition uses entity data rather than an ownership value in every request.
- Two-stage policy matching. Trace Cedar’s scope matching and condition evaluation for a request, including what happens when no scope matches and which policies contribute an effect.
- Cedar’s combined decision rules. Trace how Cedar reaches one decision from multiple evaluated policies: a matching forbid produces Deny, otherwise a matching permit produces Allow, and otherwise the result is Deny.
- PARC as Cedar’s shared language. Explain that Cedar expects every request to use PARC’s four elements, which also connect policy writing, real-world inputs, and evaluation.
- Cedar’s focused design tradeoffs. Explain why Cedar is not a general-purpose programming language and what its design prioritizes.
- Cedar types and validation. Explain how Cedar uses typed values in policy checks and validates policies against a schema before evaluation. Describe how this catches invalid comparisons and reduces unpredictable production behavior.
- Entity References and Relationships. Explain how Cedar uses first-class entity references to express relationships such as ownership or team membership, and where it gets the data to evaluate them.
- Namespace boundaries and names. Explain how Cedar namespaces distinguish entities and actions with the same name and clarify boundaries between application areas.
- Namespace aided type checks. Describe how Cedar uses namespaced entity types and their attribute definitions to reject invalid policy expressions.
- Reasons for Cedar’s omissions. Explain why Cedar omits features such as regular expressions, loops, and external calls, including the specific risks the section gives for them.
- Lean authorization operator set. Explain why Cedar uses a deliberately small set of operators and what kinds of authorization needs it can express.
- Bounded and safe policy language. Explain how Cedar’s restrictions make policy evaluation safe and policy sets easier to analyze.
- Symbolic policy analysis. Trace how Cedar analyzes a policy set beyond testing individual example requests, and describe the kinds of questions that analysis can answer.
- Consistent authorization questions. Explain how Cedar’s PARC model, policy structure, and deny-overrides behavior work together to frame access decisions consistently across ACME’s systems.
- Structure for varied access rules. Describe how Cedar provides structure for different kinds of access decisions without placing authorization logic throughout application code.
- Practical policy governance. Explain why Cedar’s structured, deterministic policies make review, change analysis, and auditing more practical without replacing governance.
What it builds on
- A hybrid approach: Policy-based access control (chapter 6) · Introduces a policy-based approach to dynamic authorization.
- Policy as Code (chapter 6) · Introduces expressing authorization logic as policy code.
- The PARC model (chapter 4) · Introduces the principal, action, and resource elements of an access request.
- How ReBAC works (chapter 6) · Relationships such as document ownership can inform access control.
Section by section
Introduction
The introduction uses ACME’s real-time access decisions to show why rules are needed and introduces Cedar as a language for expressing them.
- Rules behind real-time access: Explain how rules govern ACME’s real-time access decisions, using the deployment and document-sharing examples.
Why it matters: The examples connect a real-time access decision to the rule that governs it. - Cedar across authorization models: Describe Cedar’s stated role in expressing fine-grained, real-time policies involving relationships, attributes, and contextual conditions across ReBAC and ABAC.
Why it matters: Cedar provides a common policy language for the kinds of dynamic access rules shown in the examples.
Key terms: access policies, graph of relationships, real time, Cedar, ReBAC, ABAC, contextual conditions
7.1 Introducing Cedar
Introduces Cedar as a purpose-built access-control language and explains the four strengths that led ACME to choose it.
- Purpose and expressive reach: Explain why ACME chose a purpose-built policy language: Cedar can express fine-grained access rules based on relationships and other factors, rather than only job titles, in one policy language.
Why it matters: This explains why Cedar fit ACME’s varied access rules. - Real-time policy performance: Explain why predictable, real-time policy evaluation mattered to ACME when authorization checks occur during requests.
Why it matters: An access rule must be practical to evaluate when a user actually makes a request. - Predeployment policy analysis: Describe how Cedar’s support for static analysis addressed ACME’s concern about unintended access when policies change.
Why it matters: Reviewing the effects of a rule change before production can help prevent accidental access. - Open deployment flexibility: Explain how Cedar’s open source implementation and embeddable engine met ACME’s need to evaluate policies in different parts of its architecture.
Why it matters: Deployment flexibility lets ACME use a consistent policy model across different systems.
Key terms: Cedar, fine-grained access control, Expressive, Performant, critical path, real-time decisions, Analyzable, static analysis, Open and embeddable, open source
7.2 Policy structure: Effect, scope, and conditions
Introduces the three conceptual parts of a Cedar policy and explains why the book uses Cedar to illustrate broader authorization concepts.
- Three policy elements: Describe effect, scope, and conditions as the three elements of a Cedar policy, distinguishing what a policy does, when it applies, and under what circumstances.
Why it matters: These three questions give you a way to recognize the parts of a policy in later examples. - Cedar as a running example: Explain why the book uses Cedar without presenting this chapter as a comprehensive Cedar language guide.
Why it matters: The Cedar examples are meant to help you recognize ideas that transfer beyond Cedar.
Key terms: effect, scope, conditions, Cedar, running example
7.2.1 Effect: What the policy does
This section explains how a Cedar policy’s effect permits or forbids an action and how a forbid takes precedence over a permit.
- Cedar policy effects: Explain that every Cedar policy begins with an explicit permit or forbid effect, which contributes a yes or no to the overall decision. Describe how a forbid overrides a permit when both apply.
Why it matters: The effect tells you what each policy contributes to an access decision, including when a denial must take precedence.
Key terms: effect, permit, forbid
7.2.2 Scope: When the policy applies
Explains how a Cedar policy’s scope identifies the requests to which the policy applies.
- Policy scope and relevance: Explain how a Cedar policy’s principal, action, and resource scope identifies relevant access requests, using the employee-owned document example to show when a policy applies and when it does not.
Why it matters: Scope helps explain why Cedar evaluates a policy for one request but not another.
Key terms: scope, principal, action, resource, policy header
7.2.3 Conditions: Under what circumstances
This section explains how optional Boolean conditions make a policy depend on context without putting those rules in its scope.
- Contextual policy conditions: Explain that a policy’s conditions are optional Boolean expressions that must be true for the policy to apply, and describe how they express contextual rules separately from scope.
Why it matters: Conditions let a policy handle changing circumstances without making its scope unwieldy.
Key terms: conditions, Boolean expressions, scope, dynamic contexts
7.2.4 Putting it together
Shows how effect, scope, and conditions fit together in a complete Cedar policy for document access.
- Complete Cedar policy structure: Explain how the example policy combines a permit effect, a scope covering employees viewing or editing documents, and conditions requiring document ownership and a managed device.
Why it matters: This structure makes it clear both what access the policy allows and the circumstances that limit it.
Key terms: effect, scope, conditions, principal, resource, managed device
7.3 The PARC model in Cedar: Understanding policy evaluation
Introduces the four parts of a Cedar access request and shows how they correspond to a policy’s scope and conditions.
- PARC request components: Describe the principal, action, resource, and conditions in a Cedar access request, including what each represents.
Why it matters: PARC gives you a way to describe what an access decision is about. - Policy and request correspondence: Explain how a policy’s scope and conditions relate to the parts of an access request in Cedar.
Why it matters: This correspondence connects how a rule is written with the request it governs.
Key terms: PARC, Principal, Action, Resource, Conditions, policy structure, scope, request’s context
7.3.1 Cedar’s representation of PARC
This section shows how an application turns runtime information into a Cedar PARC request and how Cedar evaluates that request against a policy using supplied entity data.
- PARC Request Construction: Describe how an application constructs a Cedar access request by extracting a principal, action, resource, and context from runtime inputs and organizing them as structured data, usually JSON.
Why it matters: The application must translate what happens at runtime into the request Cedar can evaluate. - Scope Conditions and Permit: Trace Bob’s edit request through the policy: match its principal, action, and resource against scope, then test ownership and managed-device conditions to explain the permit result and the unmanaged-device contrast.
Why it matters: Separating scope from conditions explains why the same edit request can have a different outcome when its context changes. - External Entity Data Dependencies: Explain what the application must supply alongside a Cedar request and why the ownership condition uses entity data rather than an ownership value in every request.
Why it matters: A policy can check relationships only when the surrounding system makes the relevant entity data available to Cedar.
Key terms: PARC model, access request, principal, action, resource, context, scope, when clause, permit effect, is_managed
7.3.2 Evaluating policies
This section explains how Cedar gathers relevant policies, checks which ones apply to a request, and uses typed data and attribute-access syntax during evaluation.
- Policies from multiple sources: Explain how an authorization layer handles relevant policies supplied by different teams or systems for one request.
Why it matters: One request may need to be checked against policies maintained by different parts of an organization. - Two-stage policy matching: Trace Cedar’s scope matching and condition evaluation for a request, including what happens when no scope matches and which policies contribute an effect.
Why it matters: A policy affects a decision only if it applies to the request and its conditions hold. - Typed policy data: Explain why Cedar declares value types in a policy schema and how type checking helps avoid authorization logic errors.
Why it matters: Type checking helps catch policy mistakes before they cause surprising access decisions. - Attribute access syntax: Distinguish Cedar’s dot notation from bracket syntax for accessing data fields.
Why it matters: These forms let a policy refer clearly to the attributes it needs for evaluation.
Key terms: policy stores, policy set, decision cycle, scope matching, condition evaluation, principal, action, resource, when, strongly typed
7.3.3 Combining results from multiple policies
This section explains how Cedar combines evaluated policies into one access decision and why its deny-overrides rules are useful.
- Cedar’s combined decision rules: Trace how Cedar reaches one decision from multiple evaluated policies: a matching forbid produces Deny, otherwise a matching permit produces Allow, and otherwise the result is Deny.
Why it matters: These rules let you work out an access decision even when several policies apply. - Benefits of deny overrides: Explain how Cedar’s decision rules provide safety-first defaults, allow broad deny guardrails, and avoid dependence on policy order.
Why it matters: The same decision rules make missing permissions safer and broad restrictions predictable.
Key terms: deny-overrides model, forbid, permit, deny by default, safety-first defaults, policy guardrails, order independence
7.3.4 PARC as the bridge
This section presents PARC as the shared language connecting Cedar requests, policies, and evaluation, and as a way to compare authorization languages.
- PARC as Cedar’s shared language: Explain that Cedar expects every request to use PARC’s four elements, which also connect policy writing, real-world inputs, and evaluation.
Why it matters: A shared structure makes it easier to connect an access request to the rules that decide it. - PARC across policy languages: Describe how PARC provides a common reference point for comparing policy languages that address the same access question in different ways.
Why it matters: A common question helps you compare policy languages without assuming they express rules identically.
Key terms: PARC, Cedar, four elements, principal, action, resource, conditions
7.4 Cedar’s unique design
This section explains why Cedar is deliberately specialized for authorization rather than general-purpose programming.
- Cedar’s focused design tradeoffs: Explain why Cedar is not a general-purpose programming language and what its design prioritizes.
Why it matters: This focus explains the design choices behind Cedar’s approach to access control.
Key terms: Cedar, authorization logic, safety, ease of analysis, speed
7.4.1 Strong data types
This subsection explains how Cedar’s data types and schema-based type checking make policy conditions safer and catch errors before evaluation.
- Cedar types and validation: Explain how Cedar uses typed values in policy checks and validates policies against a schema before evaluation. Describe how this catches invalid comparisons and reduces unpredictable production behavior.
Why it matters: Type checking helps prevent invalid policy expressions from reaching production.
Key terms: strongly typed, statically validated, schema, type-checked, primitive types, composite types
7.4.2 Rich entity model
This subsection explains how Cedar’s structured entity references let policies express relationships using entity data loaded at runtime.
- Entity References and Relationships: Explain how Cedar uses first-class entity references to express relationships such as ownership or team membership, and where it gets the data to evaluate them.
Why it matters: This is how a policy can express an access relationship without carrying every link in the request. - Benefits of Structured Entities: Justify why representing real-world relationships as rich entities makes Cedar policies easier to work with.
Why it matters: A policy that reflects actual relationships is easier to read, maintain, and audit.
Key terms: first-class entity references, principal, resource.owner, entity data, rich entities, strong typing, relationships
7.4.3 Clear namespace and type safety
This subsection explains how Cedar namespaces keep policy domains distinct and help catch invalid policy expressions.
- Namespace boundaries and names: Explain how Cedar namespaces distinguish entities and actions with the same name and clarify boundaries between application areas.
Why it matters: Clear names and boundaries help prevent policy conflicts when application areas share type names. - Namespace aided type checks: Describe how Cedar uses namespaced entity types and their attribute definitions to reject invalid policy expressions.
Why it matters: Type checks catch policy mistakes before they become subtle authorization bugs.
Key terms: namespace, :: delimiter, fully qualified, entity type, attribute definitions, type error, type-safe policy logic
7.4.4 What Cedar doesn’t include
This section explains why Cedar deliberately limits its policy language and how those limits make evaluation predictable and policies easier to assess.
- Reasons for Cedar’s omissions: Explain why Cedar omits features such as regular expressions, loops, and external calls, including the specific risks the section gives for them.
Why it matters: The omissions help explain how Cedar protects predictable policy evaluation rather than merely offering fewer features. - Benefits of limited features: Describe the limited declarative features Cedar retains and the benefits the section attributes to that choice.
Why it matters: The language’s limits are also what make its policies practical to inspect and maintain at scale.
Key terms: regular expressions, loops, external calls, pure, deterministic evaluation, guaranteed performance limits, declarative feature set, Booleans, strings, sets, entity references
7.4.5 Minimal operators with maximum effect
This section shows how Cedar’s small operator set expresses practical authorization conditions for device names, time limits, and IP ranges.
- Lean authorization operator set: Explain why Cedar uses a deliberately small set of operators and what kinds of authorization needs it can express.
Why it matters: A small operator set can still support useful policies without making them unnecessarily complex. - Device name wildcard matching: Describe how Cedar uses the like operator to match a device-name pattern without regular expressions.
Why it matters: Wildcard matching lets a policy check a useful name pattern without regular expressions. - Time based access limits: Describe what the example time-based condition requires of an authorization request.
Why it matters: Time conditions allow access rules to depend on when a request occurs. - IP range policy conditions: Explain what the example IP condition checks and how ip() obtains its range.
Why it matters: IP conditions let a policy distinguish requests by network address.
Key terms: operators, authorization logic, like operator, wildcard matching, context, time-based constraints, policy condition, clientIP, ip() operator, CIDR block specification
7.4.6 Safe and analyzable by design
Explains how Cedar’s bounded design supports fast, safe evaluation and mathematical analysis of policy behavior before deployment.
- Fast policy evaluation: Explain how Cedar is designed to evaluate large policy sets quickly through scope filtering and a compact evaluation model.
Why it matters: Fast evaluation makes policy-based decisions practical even when many policies must be considered. - Bounded and safe policy language: Explain how Cedar’s restrictions make policy evaluation safe and policy sets easier to analyze.
Why it matters: Restricting what policies can do supports both reliable evaluation and reasoning about their behavior. - Symbolic policy analysis: Trace how Cedar analyzes a policy set beyond testing individual example requests, and describe the kinds of questions that analysis can answer.
Why it matters: Symbolic checks can expose policy-set problems that a few example requests might miss. - Verified analysis correspondence: Explain why the correctness of Cedar’s symbolic translation matters and what assurance the section describes for it.
Why it matters: A policy check is trustworthy only to the extent that the analysis faithfully represents the policies being run. - Predeployment policy review: Describe how Cedar’s analysis changes policy review without replacing testing, governance, or human judgment.
Why it matters: Predeployment analysis gives reviewers stronger evidence about the effects of a policy change.
Key terms: scope filtering, compact evaluation model, sub-millisecond policy evaluation, declarative, side effects, strong typing, structured entity model, deterministic evaluation semantics, symbolic reasoning, Cedar Symbolic Compiler
7.5 Cedar’s distinctive strengths
This section explains how Cedar’s design gives ACME a consistent way to express varied access rules and makes policies easier to manage over time.
- Consistent authorization questions: Explain how Cedar’s PARC model, policy structure, and deny-overrides behavior work together to frame access decisions consistently across ACME’s systems.
Why it matters: A shared way to frame decisions lets ACME discuss authorization consistently across systems. - Structure for varied access rules: Describe how Cedar provides structure for different kinds of access decisions without placing authorization logic throughout application code.
Why it matters: ACME can express different systems’ access needs while keeping authorization logic in structured policies. - Practical policy governance: Explain why Cedar’s structured, deterministic policies make review, change analysis, and auditing more practical without replacing governance.
Why it matters: A policy’s value depends not only on making decisions but also on people being able to review and manage those decisions over time.
Key terms: PARC, effect, scope, conditions, deny-overrides, entity model, type system, namespaces, limited operator set, structured
7.6 Summary
Where this is used later
- Authoring ACME’s core policies (chapter 9) · Applies Cedar to ACME’s access requirements.
- Mapping requests to Cedar evaluations (chapter 9) · Connects application requests to Cedar evaluations.
- Versioning and review (chapter 10) · Addresses review of policy changes.
- Deployment options for tenant PDPs (chapter 13) · Considers deployment options for authorization decision components.
- A XACML simple example (chapter 8) · Assumes familiarity with policy scope and conditions.
- Rego policies example (chapter 8) · Cedar policy structure, including scope and conditions.
- Permit view if on the right team (chapter 9) · Policy scope determines when a Cedar policy applies.
- Membership permissions (chapter 9) · A Cedar policy’s scope determines when it applies.
Concepts explained in this chapter
- CedarCedar is a policy language designed specifically for expressing authorization policies and evaluating access-control logic.
- PARC modelThe PARC model is an authorization framework that describes an access decision using a principal, action, resource, and conditions or context.
- scope matchingPolicy matching is the process of determining whether an authorization policy applies to a request's principal, action, and resource.
- static analysisStatic analysis is the examination of programs or policies without executing them to identify properties, errors, or behavioral consequences.
- authorization requestAn authorization request is a structured query asking whether a principal may perform an action on a resource under specified conditions.
- policy setA policy set is a collection of authorization policies considered together when analyzing or evaluating access behavior.
- policy checkPolicy evaluation is the process of determining whether a request satisfies the rules and conditions in an authorization policy.
- conditionA condition is a contextual requirement that determines whether an authorization request is permitted or denied.
- scopeA scope is the policy element that identifies the principals, actions, and resources to which a policy applies.
- formal verificationFormal verification is the use of mathematically defined models and proofs to establish that software satisfies specified properties.
- policy effectAn effect is the policy element that specifies the outcome produced when a policy applies, such as allowing or denying access.
- Cedar compilerThe Cedar compiler is software that compiles Cedar policies while checking them against Cedar's schema rules.
- analyzabilityAnalyzability is the property of a language or policy set that permits tools to reason about its behavior and verify relevant properties.
- satisfiability modulo theoriesAn SMT solver determines whether logical formulas are satisfiable under combinations of mathematical theories such as equality, sets, strings, and numbers.
- symbolic reasoningSymbolic reasoning analyzes general formulas representing sets of possible inputs and behaviors instead of checking only concrete examples.
- type safetyStrong typing is a language property in which values and operations obey enforced type rules that prevent invalid combinations.
- policyAn authorization policy is a declarative rule or set of rules that determines which subjects may perform which actions on which resources under specified conditions.
- permit policyPermit is a policy effect that allows a matching authorization request.
- deny-overridesDeny-overrides is a policy-combining rule in which any applicable deny result takes precedence over permit results.
- namespaceA namespace is a prefix or naming context that distinguishes entities, actions, policies, or types belonging to different domains or systems.
- edgeA relationship edge is a graph connection that records an association between entities or between an entity and a resource.
- policy storeA policy store is a repository that contains authorization policies for retrieval and evaluation.
- policy languageA policy language is a formal language whose syntax and semantics allow authorization policies to be represented and processed by software.
- policy-based access controlPolicy-based authorization determines access from explicitly defined rules or policies evaluated against identities, resources, actions, and conditions.
- attributeAn identity attribute is a piece of information describing an entity in a digital identity system.
- forbid policyForbid is a policy effect that denies a matching authorization request and can override a permit effect.
- entityAn entity is a person, organization, service, thing, or AI agent that can participate in relationships with a digital identity system.
- governanceA governance framework is a structured system that assigns responsibility, establishes applicable standards, and coordinates work across teams or systems.
- dynamic adaptabilityDynamic authorization is an access-control technique that evaluates whether access is permitted at request time using current context and authorization information.
- actionAn action is an operation that a principal attempts to perform on a resource.
- principalA principal is an entity, such as a person, machine, or process, that can initiate an action in an authorization system.
- Cedar Analysis CLICedar Analysis is a static analysis tool for checking Cedar policies and their properties.
- application-specific policyAn application policy is an authorization policy that defines permitted resources, actions, and authorities for a specific service or application domain.
- contextContext is the current information and attributes surrounding an access request that can affect an authorization decision.
- authorizationAuthorization is the process of determining and enforcing what an authenticated identity is permitted to access or do.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
