Giter VIP home page Giter VIP logo

capsicum-linux's Introduction

Capsicum Object-Capabilities on Linux

This repository is used for the development of Capsicum object capabilities in the Linux kernel.

This functionality is based on:

  • the original Capsicum implementation in FreeBSD 9.x, written by Robert Watson and Jonathan Anderson.
  • the Linux kernel implementation written by Meredydd Luff in 2012.

The current functionality is based on the 3.11.1 upstream kernel.

Functionality Overview

Capsicum introduces a new kind of file descriptor, a capability, which has a limited set of rights associated with it. Operations on a capability that are not allowed by the associated rights are rejected (with ENOTCAPABLE). New capabilities can only have a subset of the rights of an existing file descriptor/capability.

Capsicum also introduces capability mode, which disables (with ECAPMODE) all syscalls that access any kind of global namespace.

Taken together, these features allow userspace code to effectively sandbox itself, by:

  • creating capabilities (with limited rights) to files and sockets that are definitely needed by the process
  • closing all other file descriptors
  • entering capability mode (which means that new, non-capability, file descriptors can't be opened.

As process management normally involves a global namespace (that of pid_t values), Capsicum also introduces a process descriptor and related syscalls, which allows processes to be manipulated as another kind of file descriptor.

Building

Capsicum support is currently included for x86_64 and user-mode Linux. The configuration parameters that need to be enabled are:

  • CONFIG_64BIT: Capsicum support is currently only implemented for 64 bit mode.
  • CONFIG_SECURITY: enable Linux Security Module (LSM) support.
  • CONFIG_SECURITY_PATH: enable LSM hooks for path operations
  • CONFIG_SECURITY_CAPSICUM: enable the Capsicum LSM.
  • CONFIG_PROCDESC: enable Capsicum process-descriptor functionality.

User-mode Linux is used for Capsicum testing, and requires the following additional configuration parameters:

  • CONFIG_DEBUG_FS: enable debug filesystem.

Testing

The capsicum-linux currently includes tests and test scripts in the tools/testing/capsicum_tests/ directory (although the tests themselves are being migrated to the separate capsicum-test repository).

These test scripts currently expect specific build configurations (replacing the -j 5 flag with an appropriate parallelization factor for the local machine):

  • For user-mode Linux, the kernel should be built with make -j 5 ARCH=um O=`pwd`/build/ linux (i.e. the old-style linux target is required, and the output tree is expect to be under the build/ subdirectory).

  • For native Linux (including VMs), the kernel should be built with make -j 5 O=`pwd`/build-native

capsicum-linux's People

Contributors

acmel avatar adrianbunk avatar arndb avatar avikivity avatar axellin avatar broonie avatar bzolnier avatar davem330 avatar dhowells avatar ebiederm avatar gregkh avatar heicarst avatar herbertx avatar htejun avatar hverkuil avatar ickle avatar jmberg avatar jmberg-intel avatar joeperches avatar kaber avatar neilbrown avatar olofj avatar ozbenh avatar pmundt avatar ralfbaechle avatar rddunlap avatar rjwysocki avatar skeggsb avatar tiwai avatar torvalds avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.