When writing applications based on Datomic and Clojure, peers seem to have unlimited data access. How to create a multi-user system where user A cannot access data that is private to user B?
I know that I can write queries in Clojure so that only the user's personal data is returned ... but what prevents the attacker from hacking binary files to see the personal data of user B?
UPDATE
It seems that the state of the Clojure / Datomic application is actually not safe, based on a response from @Thumbnail and a link to John P Hackworth's blog.
Let me state more clearly the problem that I see, because I do not see any solution for this and is the original problem that caused this question. I have to miss something and express my ignorance, so please, with me! Thanks: -)
Datomic has data warehouse, transaction and peer nodes. Access points are located on the computer and run data requests from the data warehouse. My question is how to restrict access to data in the data warehouse. Since the data store is dumb and actually just stores data, I'm not sure how to provide access control.
When AWS S3 is used as a data warehouse, the client (peer) must authenticate before accessing S3, but once it is authenticated, the partner does not have access to all the data !? Limited only by the requests that it runs, if the user wants to get other user data, they can change the code, binary, on the client so that the requests are executed with a different username, right? To be clear ... isn't access control just a condition for the request? Or is there a user connection that the data warehouse recognizes and the data warehouse limits which data is visible?
What am I missing?
In a traditional web environment such as Rails, server-side code restricts all data access and user authentication and authorization. The user can change the URLs or code on the client side, but the server does not allow access to the data, except the user provided the correct credentials.
Since the datastore in Datomic is dumb, it seems that it lacks the ability to restrict access for each user, and the application (peer-to-peer connection) should do this. I do not want to trust the user to behave and not try to acquire other users information.
A simple example is the banking system. Of course, the user will be authenticated ... but after that, what prevents them from modifying the side code / binary client to change data requests in order to get other users' account information from the data warehouse?
UPDATE - MODELS
Here are two possible models that I have, how Datomic and Clojure work ... the first is my current model (in my head).
- the user computer starts the client / peer, which has requests and full access to the data store, where the user was authenticated before the client began thereby restricting users to those who have credentials.
- The user computer has an interface (webapp) that communicates with the peer that is on the server. Requests are located on the server and cannot be changed by the user, therefore access control tools are under access control by the security of the server on which the peer is running.
If the second model is correct, then they will answer my question: the user cannot change the server code, and the server code contains access controls ... therefore the "peers" that, as I thought, remained on the user's computer are actually on the server applications.