Great to see spaces coming along, we’ve been building a few prototypes it already!
I’ve been meaning to get into the protocol for a long time, but not getting there, and there’s so much to read here too, but I have a concern that seems rather orthogonal to everything else, so here goes, and it begins with a possibly provocative statement:
Using CRUD for access control is really a historical accident, it is suitable for understanding resource lifecycle, but it is a good time to take a broader view.
It is suitable for dividing resource lifecycle operations into four distinct phases, but that is exactly what makes it so badly suited for access control, as it inevitably leads users to overpermission. For example, an update operation typically also require a preceding read, so that the application can determine how the resource can be modified. For some data types, this is not necessary. You can add to a list without reading it, you can append to a CSV without reading it, etc. If you knew what resources had this property, you could do with narrower grants. Following the principle of least privilege, we should do better.
There are two examples in the spec that is similar: One is that writes are lumped as a group, create, update, delete. The other is read_self which is a narrower grant than read. There’s also potential for a list grant, which is also a narrower read. I suggest doing this more comprehensively. I also took this up in a recent Fediforum, and I also discussed this in the Solid Project (where I edited the protocol spec), but I expect the needs of atproto to be quite different.
So, if we start with more operations than CRUD, I think we can agree that Create, Update and Delete are all Write operations, they change the state of the resource. Then, Update as currently defined, is also a Read operation. Following the discussion above, we could have a Modify operation, that is a Write operation, but that will not need Read. A type of a Modify operation can be Add.
Then, my thinking is that to arrive at actual grants, these operations need to be applied to various types of resources. There’s a read_self grant in the spec, which is basically a Read operation on the user’s own records. Such subsetting should be easy to formalize, the grant should follow logically to be narrower, not just from reading the spec, but from formal logic. And given that Write entails Create, Update and Delete, those are also examples of where the application of operations should result in a formal logic of grants.
The benefit of doing this job would be twofold:
- There would be rigorous formal model behind the access control, which would aid formal proofs, which again is important in a high-stakes situation.
- It would make it possible to help with the implementation of the principle of least privilege.
I acknowledge that this is partly at odds with good security usability: We are now asking any user to review OAuth screens, and I’m not sure that gives them sufficient understanding to make good decisions, and adding more grants could make the situation worse. I believe, however, that the solution to this problem is not to have a less sophisticated system, but instead to enable people help each other set policies.
I will also need to admit that setting things in formal logic never was my strongest side, but I hope the idea will resonate with someone who knows how to do it.