Giter Club home page Giter Club logo

landlockjail's Introduction

This is a tool for playing with Linux 5.13's new Landlock feature.

Landlock lets processes lock themselves into a subset of their file access permissions.

It's a fork of the samples/landlock/sandboxer.c tool by Mickaël Salaün, which ships with the kernel source, changing environment variable parsing to flag parsing, and making it easier to compile standalone and play with the feature. It's not meant as a serious sandboxing tool.

Example:

root(302)@virtual:~# ./lljail -r /usr -r /bin -rw /tmp -r /etc -r /root -- /bin/bash
root(681)@virtual:~# echo lol > cat  # fails (read-only directory)
bash: cat: Permission denied
root(681)@virtual:~# cd /tmp
root(681)@virtual:/tmp# echo lol > cat  # succeeds (read-write directory)
root(681)@virtual:/tmp#

Remark: Landlock's support will keep the proces from opening files for reading and writing, but some syscalls can currently not be restricted yet, such as stat().

You can see this for example when using the file utility: It will still detect that the file is there, using stat(), but it only recognizes its content once it has the read permissions.

root(207)@virtual:~# ./lljail -r /usr -r file /etc/magic -- /bin/file text.txt
text.txt: writable, regular file, no read permission
root(207)@virtual:~# ./lljail -r /usr -r file /etc/magic -r file text.txt -- /bin/file text.txt
text.txt: ASCII text

landlockjail's People

Contributors

gnoack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

landlockjail's Issues

Linux version

Landlock is in Linux next, so it should be part of Linux 5.13, not the almost ready 5.12 (cf. readme and repo description). 😉

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.