TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Policy-as-Code or Policy-as-Data? Why Choose?

17 pointsby tcsfabout 3 years ago

4 comments

jzelinskieabout 3 years ago
As someone working on the most popular Zanzibar implementation[0], I think this article is a pretty good introduction to the idea that both policy engines and ReBAC databases have their use cases, but it doesn&#x27;t offer great recommendations for what those use cases are. The article recommends policy engines where you&#x27;d want to apply global roles, but this is actually a commonly expressed pattern for schemas in SpiceDB and not something that requires a policy-forward approach.<p>I use the following as my &quot;rule of thumb&quot;: ReBAC databases want to have deterministic computation for your permissions. In the default case, this should be your ideal as well as it is the most understandable&#x2F;scalable&#x2F;testable&#x2F;auditable&#x2F;debuggable. But reality is that there will be places where you&#x27;ll want _some_ non-determinism and in those scenarios it makes sense to leverage policy engines.<p>The SpiceDB community is exploring what it might take to support adding lightweight policies to the Zanzibar-like model to have the best of both worlds. If that sounds interesting, you can participate in the proposal[1].<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb</a><p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb&#x2F;issues&#x2F;386" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;authzed&#x2F;spicedb&#x2F;issues&#x2F;386</a>
评论 #30948234 未加载
stefanba3about 3 years ago
This resonates to me. In my last job we didn&#x27;t plan our authZ story very well (or at all!). As our company experienced explosive growth, we ended up implementing something that I suspect is pretty common: AuthZ policy as data because we ended up representing it in a postgres db, and policy as code because we then had to write an &quot;engine&quot; to interpret that data. There were none of these emerging cloud authZ solutions, having one might have saved us a lot of time and grief!
评论 #30947742 未加载
emrebabout 3 years ago
Disclaimer: I work on Cerbos [0] (an alternative to OPA based authorization systems focusing on RBAC&#x2F;ABAC) to deliver enterprise-grade access management for any application.<p>There is another alternative approach to policy-as-code: policy-as-configuration. At Cerbos we believe that for most use cases, using a full programming language is too much work and creates problems such as being hard to comprehend and work with (because it&#x27;s a completely different language with its own idiosyncrasies) and being too open-ended (thus making it easy to write lots of very complicated code with surprising side effects and performance issues). The rules for your authorization policies can be human readable for those developers who cannot spend lots of time learning a whole new programming language, and is independent of any particular language, architecture or tech stack.<p>We’ve built and open sourced Cerbos trying to make the deployment and management of an authorization service as simple as possible while configuration rules as flexible as possible. While doing so, we also achieved response times that are faster than OPA.<p>[0] <a href="https:&#x2F;&#x2F;cerbos.dev" rel="nofollow">https:&#x2F;&#x2F;cerbos.dev</a>
ogazittabout 3 years ago
In the &quot;Zanzibar [0] vs OPA [1]&quot; debate, the pragmatic answer is &quot;both&quot;.<p>[0] <a href="https:&#x2F;&#x2F;research.google&#x2F;pubs&#x2F;pub48190&#x2F;" rel="nofollow">https:&#x2F;&#x2F;research.google&#x2F;pubs&#x2F;pub48190&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;www.openpolicyagent.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.openpolicyagent.org&#x2F;</a>