惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
博客园 - 【当耐特】
H
Help Net Security
腾讯CDC
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
Last Week in AI
Last Week in AI
Jina AI
Jina AI
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
Y
Y Combinator Blog
C
Check Point Blog
博客园 - 司徒正美
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Cerbos - All Posts

Authentik vs Keycloak: Self-hosted IdP comparison Mapping business requirements to authorization policy for automotive Fine-grained authorization for AI gateways EIC 2026: Stop counting agents, protect what they can touch Agent skill for writing authorization policies in Claude Desktop Identity security in 2026 EIC 2026 takeaways: the identity stack built for humans will not hold up for AI agents Already have authentication? Here's the authorization layer you still need. Tokens are authorization decisions: a guide to policy-driven token issuance What is a Runtime Authorization Platform It's a dimmer switch, not a kill switch. How CISOs are rethinking AI agent governance From maps to bitmaps (and from bitmaps to bitmaps) AuthZEN, Shared Signals, SCIM Events, IPSIE: Notes from the OpenID Enterprise Panel How do you update authorization policies without redeploying your application? IIW42 recap: Where agent authorization got real Cerbos PDP v0.52.0/v0.53.0: Engine performance, security hardening, and CEL path functions Authorization Management Platforms: what they do, how they work, and where they fit PocketOS AI coding agent deleted a production database in 9 seconds Non-Human Identity management still has a blind spot Supabase alternative in 2026: Best open source auth options Benefits of on-premise authorization: Why enterprises are moving toward self-hosted Authorization policies: How to write, test, and validate them (faster with AI) Agent skill for writing authorization policies How much does it cost to build authorization in-house? Why centralized authorization governance reduces incident response time OPA alternative Why AI agents make authorization a right now problem Modernizing legacy application authorization: why it’s your biggest security blind spot How to add authorization to legacy applications without code changes 5 authorization blind spots auditors find, and how to fix them
Lenient scope search in Cerbos policies
Aldin Kiselica · 2023-08-03 · via Cerbos - All Posts

Cerbos introduced the concept of Scoped Policies back in v0.13 to address the common use case of modeling hierarchical relationships. Scoped policies enable you to define a dot-separated string describing a position of resource or a principal in the hierarchy. It is an optional feature, only evaluated if passed in a request. The scope field can be used to indicate that a resource or a principal are part of a set of policies that must be evaluated together.

The default behavior of the Cerbos engine when using scoped policies is to expect that a policy file exists for the requested scope. Meaning that if the API request defines a.b.c as the scope, there must be a policy file in the policy repository with the a.b.c scope defined. Release of Cerbos v0.29 brings something new - a lenient scope search.

Lenient Scope Search means that if a policy with passed scope does not exist in the store, Cerbos will attempt to find a partial match by searching the policy within scopes that are part of the same hierarchy as the passed scope.

This feature is available since Cerbos v0.29 so that is the lowest you should aim for in order to be able to use it. See installation instructions for more information.

How to use lenient scope search in Cerbos Policies?

Look at the following organizational hierarchy shown below. We can think of it as a tree-like structure. With each of the nodes representing a scope. The top-level node is labeled Inc, which represents the entire organization. Underneath Inc, there is a child node labeled Sales, representing the corporation's sales department. Within the Sales department, there is a further child node labeled EMEA, which specifically represents the sales operations in the EMEA region. Looking at our tree schema, EMEA (along with the NAM, LATAM and APAC nodes), the Core and Enterprise nodes, as well as the Support and Marketing are all bottom or leaf-level nodes.

image

In this tree structure, each node corresponds to a scope that can be used in Cerbos policies. For example, the scope Inc.Sales.EMEA in the Cerbos request corresponds to the path from the root to the EMEA leaf node in the organizational tree (equivalent to a.b.c for simplicity in this explanation). Check to learn more about scoped policies.

When evaluating policies, Cerbos will first look for a policy that exactly matches the requested scope a.b.c (or Inc.Sales.EMEA). If it doesn't find a policy with that specific scope in the policy store, it will apply a lenient scope search behavior. In this search, Cerbos will attempt to find policies with broader scopes, such as a.b (or Inc.Sales) and even more general scope a (or Inc). The search will continue until it finds a matching policy, or it reaches the root of the organizational tree (empty scope).

In order to use lenient scope search, you need to set lenientScopeSearchfield to_true_in your Cerbos engine configuration:

engine:
  lenientScopeSearch: true

The key requirement for policies in the policy store is that they must have unbroken scope chains, which means policies must be defined for all parent scopes leading up to a specific leaf scope. With lenientScopeSearch enabled, Cerbos allows missing policies only at the leaf level (e.g., EMEA in the Sales department). All parent scopes (e.g., Sales and Inc) must have defined policies in the store for the lenient scope search to be effective.

Conclusion

With the introduction of lenient scope search in Cerbos v0.29, managing Cerbos policies gains more flexibility. By setting the configuration field lenientScopeSearchto _true_, Cerbos no longer expects to have every single leaf-level policy file in order to evaluate requests concerning those.