Coder Social home page Coder Social logo

gnunicorn / firejail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from netblue30/firejail

0.0 1.0 0.0 1.37 MB

Linux namespaces and seccomp-bpf sandbox

Home Page: https://firejail.wordpress.com

License: GNU General Public License v2.0

Makefile 2.20% C++ 0.52% Pascal 0.09% POV-Ray SDL 0.05% PHP 0.19% Shell 5.58% C 91.25% Perl 0.11%

firejail's Introduction

Firejail

Firejail is a SUID sandbox program that reduces the risk of security breaches by restricting the running environment of untrusted applications using Linux namespaces, seccomp-bpf and Linux capabilities. It allows a process and all its descendants to have their own private view of the globally shared kernel resources, such as the network stack, process table, mount table. Firejail can work in a SELinux or AppArmor environment, and it is integrated with Linux Control Groups.

Written in C with virtually no dependencies, the software runs on any Linux computer with a 3.x kernel version or newer. It can sandbox any type of processes: servers, graphical applications, and even user login sessions. The software includes sandbox profiles for a number of more common Linux programs, such as Mozilla Firefox, Chromium, VLC, Transmission etc.

The sandbox is lightweight, the overhead is low. There are no complicated configuration files to edit, no socket connections open, no daemons running in the background. All security features are implemented directly in Linux kernel and available on any Linux computer. To start the sandbox, prefix your command with “firejail”:

$ firejail firefox            # starting Mozilla Firefox
$ firejail transmission-gtk   # starting Transmission BitTorrent 
$ firejail vlc                # starting VideoLAN Client
$ sudo firejail /etc/init.d/nginx start

Project webpage: https://firejail.wordpress.com/

Download and Installation: https://firejail.wordpress.com/download-2/

Features: https://firejail.wordpress.com/features-3/

Documentation: https://firejail.wordpress.com/documentation-2/

FAQ: https://firejail.wordpress.com/support/frequently-asked-questions/


Current development version: 0.9.39


X11 sandboxing support

X11 support is built around Xpra (http://xpra.org/). So far I've seen it working on Debian 7 and 8, and Ubuntu 14.04. If you manage to run it on another distribution, please let me know. Example:

$ firejail --x11 --net=eth0 firefox

--x11 starts the server, --net is required in order to remove the main X11 server socket from the sandbox. More information here: https://firejail.wordpress.com/documentation-2/x11-guide/

Default seccomp filter update

Currently 50 syscalls are blacklisted by default, out of a total of 318 calls (AMD64, Debian Jessie).

STUN/WebRTC disabled in default netfilter configuration

The current netfilter configuration (--netfilter option) looks like this:

             *filter
              :INPUT DROP [0:0]
              :FORWARD DROP [0:0]
              :OUTPUT ACCEPT [0:0]
              -A INPUT -i lo -j ACCEPT
              -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
              # allow ping
              -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
              -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
              -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
              # drop STUN (WebRTC) requests
              -A OUTPUT -p udp --dport 3478 -j DROP
              -A OUTPUT -p udp --dport 3479 -j DROP
              -A OUTPUT -p tcp --dport 3478 -j DROP
              -A OUTPUT -p tcp --dport 3479 -j DROP
              COMMIT

The filter is loaded by default for Firefox if a network namespace is configured:

$ firejail --net=eth0 firefox

Set sandbox nice value

      --nice=value
              Set nice value for all processes running inside the sandbox.

              Example:
              $ firejail --nice=-5 firefox

mkdir

$ man firejail-profile
[...]
       mkdir directory
              Create   a   directory  in  user  home.  Use  this  command  for
              whitelisted directories you need to preserve when the sandbox is
              closed.  Subdirectories  also  need  to  be created using mkdir.
              Example from firefox profile:

              mkdir ~/.mozilla
              whitelist ~/.mozilla
              mkdir ~/.cache
              mkdir ~/.cache/mozilla
              mkdir ~/.cache/mozilla/firefox
              whitelist ~/.cache/mozilla/firefox

[...]

New security profiles

lxterminal, Epiphany, cherrytree, Battle for Wesnoth, Hedgewars

firejail's People

Contributors

avoidr avatar mahdi1234 avatar jgriffiths avatar sarneaud avatar reinerh avatar mhaas avatar manevich avatar dewbasaur avatar pyther avatar mcarpenter avatar fred-barclay avatar duncaen avatar sinkuu avatar rahiel avatar pszxzsd avatar andrew160 avatar yumkam avatar pigmonkey avatar genodeftest avatar brunonova avatar al42and avatar beslayed avatar seriousbug avatar creideiki avatar dzamlo avatar wader avatar veeti avatar greigdp avatar mjudtmann avatar

Watchers

James Cloos 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.