Hacker News new | ask | show | jobs
by sieve 20 days ago
I have been exploring something on the lines of capsicum for my language+runtime and you want to balance usability and security. Too much friction and people WILL use --all like I do with Deno.

My current thinking is to freeze all caps on startup. pid-0 within the runtime has the max caps the application will ever have and it can parcel out subsets to other processes that need it.

This can show up on the ux side as a single permission request listing all the caps the application claims it needs with a default negative response.

1 comments

This is what I do by setting caps at compile time, they aren’t a runtime feature. You either compile out code without a grant or it errors.
How will you allow permissions for a `ls` style tool? I want to be able to do `ls /etc`.
The tool parses its command line, claims the capabilities it needs, drops everything else, then runs.

Or the language it’s written in allows writing a function that takes a recursive enumerate capability on a directory plus a write capability to stdout.

A while back I sent a brain dump email to LKML about “path capabilities”. Maybe I’ll try to implement it.

My current design idea lets the runtime collect all the requests till the application locks its set of demands. This entire set is presented to the user who can then approve/reject/approve-always

The runtime maintains state in the config directory so that approve-always works for `(hash(ls), dir_read(/etc))` without producing that question during the next `ls /etc`

Probably on a directory read basis. I’d need to give it more thought.

Thanks for the thoughtful question!