The following is an extremely simple set of primitive functions that could be added to Arc, on top of which any sort of trusted execution system could be built via macros -- anything from Perl-style taint checking to a Java-style security model or even the Decentralized Label Model. 1. All code executes as a given real and effective user. An object of any type can serve to represent a user. At the start of execution, the real and effective users are both `nil'. Nil acts as a superuser. 2. All potentially-dangerous primitive functions, such as I/O and networking, throw security exceptions unless they are called as effective user nil. 3. There are primitive functions `getuid' and `geteuid' that returns the current real and effective user ids respectively. 4. There is a primitive function `suid' that takes a function as an argument, and returns a new function identical to the input, that when called, executes its dynamic scope with the effective user as the real user who passed it through `suid'. 5. There is a primitive function `sudo' that takes a userid and a thunk, and executes the dynamic scope of the thunk as the supplied real userid. `sudo' requires that it either be invoked as effective user nil, or that the real user requested is equal to the current effective user. And that's all there is to it. You can implement any security system you want on top of these primitives. (EDIT: added the distinction between real and effective user so that a suid function can tell who called it) |