News for hackers. Stuff that matters.
Re:Policy as Code vs. Policy as Graph Comparison by hosh on Friday June 30, 2023 @01:44PM (#36539140)
If authorizations can be described as a policy graph, what about logic programming languages such as Prolog or Datalog?

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)

Re:Policy as Code vs. Policy as Graph Comparison by rsstack on Friday June 30, 2023 @02:39PM (#36540046)
Re:Policy as Code vs. Policy as Graph Comparison by refset on Friday June 30, 2023 @01:55PM (#36539336)
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.

https://en.wikipedia.org/wiki/SecPAL

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/

Re:Policy as Code vs. Policy as Graph Comparison by orweis on Sunday July 02, 2023 @09:11AM (#36561169)
That's exactly what OPA does (Datalog), and what OSO do (Prolog)