Re:Policy as Code vs. Policy as Graph Comparison
by rsstack on Friday June 30, 2023 @02:39PM
(#36540046)
That's what Oso do: https://docs.osohq.com/guides/policies.html
Re:Policy as Code vs. Policy as Graph Comparison
by refset on Friday June 30, 2023 @01:55PM
(#36539336)
Likely of interest: https://neilmadden.blog/2022/02/19/is-datalog-a-good-languag... (Feb 2022 discussion: https://news.ycombinator.com/item?id=30400886)
Re:Policy as Code vs. Policy as Graph Comparison
by tommiegannert on Friday June 30, 2023 @02:06PM
(#36539517)
SecPAL (~2007) was essentially Datalog for policy (the paper included a transform to Datalog.) I'd be interested to know if anyone implemented it.
Re:Policy as Code vs. Policy as Graph Comparison
by cryptonector on Friday June 30, 2023 @02:07PM
(#36539536)
> If authorizations can be described as a policy graph, what about logic programming languages such as Prolog or Datalog?
Or why not SQL?
Which will be more optimized -or is easier to optimize- for the logic in question?
Re:Policy as Code vs. Policy as Graph Comparison
by hirundo on Friday June 30, 2023 @02:17PM
(#36539684)
Seems like the lisps are already both as written, and any language that can be rendered as an s-expression is either.
Re:Policy as Code vs. Policy as Graph Comparison
by jzelinskie on Friday June 30, 2023 @04:08PM
(#36541466)
Many of the optimizations used when traversing the graph for SpiceDB are inspired by research in the various dialects of Datalog. At the end of the day, there are very few operations that authorization systems need and it makes more sense to optimized those for folks than give them direct access to Datalog or general purpose graph languages like Gremlin.
Re:Policy as Code vs. Policy as Graph Comparison
by jeffchao on Friday June 30, 2023 @05:01PM
(#36542215)
That's a great observation. There's prior art in authorization (and also in the Kubernetes domain) with folks using Open Policy Agent -- specifically, Rego [0], a derivative of Datalog.
I've used it with success in authorization, but the developer experience could be better. I've found the experience to be better when paired with some constraint framework.
The other trade-off as mentioned in another comment is that it's stateless. The pro is that it's stateless, but the con is that someone needs to figure out a way to get input and data into your evaluation runtime so that you can write meaningful policies.
[0] https://www.openpolicyagent.org/docs/latest/policy-language/
Would Datalog be performant enough at scale?
I think one neat thing about logic programming languages is that you can ask for the reasoning chain to get to the conclusion it did, or do reverse queries. (Such as, give me all the actions that a person is authorized for this time)