Forgot your password?
typodupeerror
This discussion has been archived. No new comments can be posted.

Google Ports Capsicum To Linux, and Other End-of-Year Capsicum News

Comments Filter:
  • Re:OMG! (Score:5, Informative)

    by Allan Jude (3433497) on Wednesday January 08, 2014 @02:31PM (#45899925)
    The video explains it, but it allows programs to 'drop' capabilities they no longer need. For example, tcpdump needs root access to open the network interface, but after that it can give up those capabilities, so if there is a bug in tcpdump and it gets compromised by a maliciously crafted packet, the attacker does not have an excess privileges to exploit.
  • Re:OMG! (Score:5, Informative)

    by Anonymous Coward on Wednesday January 08, 2014 @02:31PM (#45899941)

    http://www.cl.cam.ac.uk/research/security/capsicum/ [cam.ac.uk]

    Capsicum is a lightweight OS capability and sandbox framework developed at the University of Cambridge Computer Laboratory, supported by a grant from Google. Capsicum extends the POSIX API, providing several new OS primitives to support object-capability security on UNIX-like operating systems

    More at the link...

  • Re:Capsi . . . what? (Score:0, Informative)

    by Anonymous Coward on Wednesday January 08, 2014 @03:54PM (#45900747)

    Ever heard of a "bell pepper"?

    Yeesh, Americans are as ignorant as a pile of bricks.

  • by TheRaven64 (641858) on Thursday January 09, 2014 @06:20AM (#45905217) Journal
    Hi Sits,

    How does this compare to existing (coarse grained) Linux capabilities?

    Linux capabilities are not capabilities in the classical sense of unforgeable tokens of authority. They are just permissions. Linux capabilities allow a non-root process to do some things as if they were root. Capsicum implements a traditional capability model, where there is no ambient authority and a sandboxed process can not do anything unless it holds the relevant capability.

    How does this compare to SELinux?

    They address different goals and do so in different ways. The goal of SELinux (and the FreeBSD MAC framework's type enforcement mode) is to allow a system administrator to restrict access of a particular program or user (or program-user pair) to some subset of system resources. It is very bad for application compartmentalisation, because you can't fork() a process and have different permissions for the different children and it's difficult to update the permissions on the fly (although Apple does this with their port of the FreeBSD MAC framework, to implement sandboxing on OS X and iOS, allowing powerboxes to grant permission to specific files or directories).

    Capsicum is intended for application sandboxing. It is assumed that the user trusts the binary to be non-malicious, but the program author does not trust his code to be free of exploitable bugs. A sandboxed process should call cap_enter() early on, at which point it can't create any new file descriptors. In some simple cases, that's enough. For example, a sandboxed version of man opens the file containing the mdoc sources and then calls cap_enter(). Even if it's run as root, and is reading a malicious source file that exploits the troff parser and allows arbitrary code execution, it can't do anything other than write text to the terminal. More complex applications will keep open a UNIX domain socket to a (more) privileged process that can pass in new file descriptors as they're needed, after doing some application-specific policy checking.

    Does this complement things like Linux's seccomp?

    Seccomp is far more restrictive than Capscium and prevents even harmless system calls (e.g. getpid(), gettimeofday() - although not on platforms where these use VDSO, I believe, but others of equal utility and harmlessness are blocked). Capsicum allows a whitelisted set of calls. Additionally, Capsicum adds finer-grained permissions on file handles (for example, you can be able to read, but not mmap, or append but not seek) and a set of at-suffixed system calls that work on directory descriptors, such as openat that allows a sandboxed process to open files in a directory that it holds the relevant capability for. This means that, for example, you can give a sandboxed browser tab process a directory descriptor to a cache directory and it can write cache data there without needing any interposition from a more privileged process. It talks directly to the kernel.

    Seccomp-bpf extends seccomp by allowing system calls to be blocked or allowed based on the execution of a BPF filter. This is more expressive than Capsicum (Google's first port of Capsicum implemented it in terms of seccomp-bpf, although it was slow and not complete), but it doesn't allow the policies to easily associate permissions data with file descriptors and requires you to implement a complex BPF policy.

    What's the overhead compared to the above?

    There is basically no overhead for capsicum. It's one extra bitmask check on each system call that interacts with a file descriptor, which is in the noise for most workloads[1].

    In terms of programmer overhead, there's a summary table for the number of lines of code changed to implement sandboxing with various mechanisms in Chrome in the original Capsicum paper. Here's the short version:

    • Windows ACLs: 22,350
    • Chroot: 605
    • OS X Seatbelt (built atop the FreeBSD MAC frame

Mirrors should reflect a little before throwing back images. -- Jean Cocteau

Working...