FreeBSD Capsicum Integration Project Completion reddit / BSD ---------------------------------------------------------------------- zmyrgel · 2013-12-18 11:28 Capsicum seems pretty promising project. At least I like it way more than something like SELinux. Sane defaults and on by default with nothing to do from user standpoint. Lets see if this will end up in OpenBSD at some point. ---------------------------------------------------------------------- thisisseriousaccount · 2013-12-18 16:49 I read that the chromium browser was ported to use the features from capsicum. I understand the use of a sandbox (which is apparent in browsers), but I'm struggling to find other uses. Should it be used to prevent binaries/executable code from interacting with other processes, files, network sockets, memory regions? I can't find good information that I as a dumb end user can understand... ---------------------------------------------------------------------- crest_ · 2013-12-18 18:16 Take some application which has to perform error prone function e.g. decoding random crap from net network like tcpdump. In this case the application should limit the impact of bugs. The classic unix way to achieve this is to start as root, setup pipes, fork, chroot into a (possibly empty) working dir, and become an unprivileged user inside the chroot environment. Tons of OpenBSD daemons improved this with [imsg](http://www.openbsd.org/cgi-bin/man.cgi?query=imsg_init) making the live of the application developer easier. Now your application consists of a privileged parent process and any number of less privileged / unprivileged worker processes. This works reasonably well for a daemon offering a specific network service e.g. a BGP routing daemon can be split into the parent, a child to keep connections with peers and a child to calculate the routes. Those three processes have to communicate with each other over IPC (in this case they chose pipes). In this model you have extra users for your child processes. They may use their left over permissions however they like. This protects the rest of the system but not the resources those users should interface with. As a side-effect application development becomes cumbersome because your worker processes lose access to operating system interfaces you take for granted like name resolution, random number generation, etc. Capsicum is an alternative approach more suited to deskop applications. It preserves a more functional execution environment for your processes by delegating the OS services into a security aware daemon allowing for more fine grained access control in userspace. From the point of the application developer you just define what you want left in and than ask Capsicum to take everything but your white list away from you. The most prominent example application is Chromium. If i remember correctly the patch to leverage Capsicum in Chromium was less than 2000 lines. Their are a few papers and slides from previous developer summits with smaller examples in the FreeBSD Wiki. ---------------------------------------------------------------------- [deleted] · 2013-12-19 22:04 I don't see it as a replacement for MAC (like SELinux/SEBSD/mac_bsdextended) but as an excellent complement to a good MAC policy. As someone who likes the idea behind SELinux but who hates the DSL for specifying rules I've been fairly pleased with my preliminary experiments with the [mac_bsdextended module](https://www.freebsd.org/doc/handbook/mac-bsdextended.html).