From 760f50f78ad13664d7a32b4577381c0341ab2d4a Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Fri, 17 Nov 2023 19:57:29 -0300 Subject: landlock: move commands into profile and add landlock.enforce Changes: * Move commands from --landlock and --landlock.proc= into etc/inc/landlock-common.inc * Remove --landlock and --landlock.proc= * Add --landlock.enforce Instead of hard-coding the default commands (and having a separate command just for /proc), move them into a dedicated profile to make it easier for users to interact with the entries (view, copy, add ignore entries, etc). Only enforce the Landlock commands if --landlock.enforce is supplied. This allows safely adding Landlock commands to (upstream) profiles while keeping their enforcement opt-in. It also makes it simpler to effectively disable all Landlock commands, by using `--ignore=landlock.enforce`. Relates to #6078. --- etc/inc/landlock-common.inc | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 etc/inc/landlock-common.inc (limited to 'etc/inc/landlock-common.inc') diff --git a/etc/inc/landlock-common.inc b/etc/inc/landlock-common.inc new file mode 100644 index 000000000..ebe9f98dc --- /dev/null +++ b/etc/inc/landlock-common.inc @@ -0,0 +1,39 @@ +# This file is overwritten during software install. +# Persistent customizations should go in a .local file. +include landlock-common.local + +landlock.read / # whole system read +landlock.read /proc +landlock.special / # sockets etc. + +# write access +landlock.write ${HOME} +landlock.write ${RUNUSER} +landlock.write /dev +landlock.write /proc +landlock.write /run/shm +landlock.write /tmp + +# exec access +## misc +landlock.execute /opt +landlock.execute /run/firejail # appimage and various firejail features +## bin +landlock.execute /bin +landlock.execute /sbin +landlock.execute /usr/bin +landlock.execute /usr/sbin +landlock.execute /usr/games +landlock.execute /usr/local/bin +landlock.execute /usr/local/sbin +landlock.execute /usr/local/games +## lib +landlock.execute /lib +landlock.execute /lib32 +landlock.execute /libx32 +landlock.execute /lib64 +landlock.execute /usr/lib +landlock.execute /usr/lib32 +landlock.execute /usr/libx32 +landlock.execute /usr/lib64 +landlock.execute /usr/local/lib -- cgit v1.2.3-70-g09d2