Giter Site home page Giter Site logo

capsicumizer's Introduction

unlicense

The Super Capsicumizer 9000

capsicumizer is a sandbox launcher that imposes Capsicum capability mode onto an unsuspecting program, allowing "sysadmin style" or "oblivious" sandboxing (i.e. no source code modifications, all restrictions added externally).

You just write AppArmor-esque "profiles" and capsicumizer takes care of sandboxing the applications.

capsicumizer is capable of launching some GUI applications (like gedit) on both Wayland and X11.

(GTK 3.24 required because of this patch)

Note: applications that use syscalls directly (instead of going through libc) โ€” namely, anything compiled with Golang's official compiler โ€” won't be able to actually access files under the allowed paths. This is because we rely on LD_PRELOADing a library (libpreopen) that overrides libc functions like open to make them use openat style functions with pre-opened directory descriptors.

gedit demo: refusing to open /etc

Requirements

  • a recent version of FreeBSD
  • Meson build system
  • libucl >=0.8.1 (pkg: #233383)
  • libpreopen (that linked fork, at least for now) (pkg: someday)

Usage

Capsicumizer profiles are written in UCL syntax (which is pretty common on FreeBSD), and can be used as directly runnable scripts (#!):

#!/usr/bin/env capsicumizer

run = "/usr/local/bin/gedit";

access_path = [
	"$HOME",
	"/usr/local",
	"/var/db/fontconfig",
	"/tmp",
];

library_path = [
	"/lib",
	"/usr/lib",
	"/usr/local/lib",
	"/usr/local/lib/gvfs",
	"/usr/local/lib/gio/modules",
	"/usr/local/lib/gedit",
];

# gedit does not need any extra preloads
# this is just an example
ld_preload = [
	"libgobject-2.0.so"
];

Environment variables and program arguments ($0 etc.) are exposed as UCL variables.

Contributing

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.

capsicumizer's People

Contributors

boraozarslan avatar emaste avatar valpackett avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

capsicumizer's Issues

Browser?

This looks really cool. Could this work for say firefox or surf? Or wouldn't capsicum deny new sockets?

Does it prevent anything like keyboard capture or screen watching with X? I imagine not.

I guess if network access is limited, then X capture doesn't matter unless say a hacked application spun up a terminal and typed out some netcat command to send screenshots or the like.

FreeBSD port

Hi,

will this program be part of the FreeBSD portstree?

Or do you know similar programs that are already part of the portstree.

Kind regards,
abelbabel

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.