aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-03-24 08:36:09 -0400
committerLibravatar netblue30 <netblue30@protonmail.com>2022-03-24 08:36:09 -0400
commitb8c41ea8fdbfd48977cf9370e0656bbdd133be83 (patch)
tree3397e7e13b838cfb45de0e00f6a659e7e4883d42
parentmerges (diff)
parentMerge pull request #5061 from glitsj16/ping-fixes (diff)
downloadfirejail-b8c41ea8fdbfd48977cf9370e0656bbdd133be83.tar.gz
firejail-b8c41ea8fdbfd48977cf9370e0656bbdd133be83.tar.zst
firejail-b8c41ea8fdbfd48977cf9370e0656bbdd133be83.zip
Merge branch 'master' of ssh://github.com/netblue30/firejail
-rw-r--r--etc/inc/allow-nodejs.inc2
-rw-r--r--etc/profile-a-l/curl.profile4
-rw-r--r--etc/profile-m-z/node-gyp.profile (renamed from etc/profile-m-z/nvm.profile)8
-rw-r--r--etc/profile-m-z/nodejs-common.profile12
-rw-r--r--etc/profile-m-z/npx.profile11
-rw-r--r--etc/profile-m-z/ping-hardened.inc.profile11
-rw-r--r--etc/profile-m-z/ping.profile21
-rw-r--r--etc/profile-m-z/semver.profile11
-rw-r--r--etc/profile-m-z/sha256sum.profile3
-rw-r--r--etc/profile-m-z/tar.profile3
-rw-r--r--etc/profile-m-z/webstorm.profile2
-rw-r--r--etc/profile-m-z/webui-aria2.profile1
-rw-r--r--etc/profile-m-z/wget.profile4
-rw-r--r--src/man/firejail-profile.txt14
-rw-r--r--src/man/firejail.txt12
15 files changed, 106 insertions, 13 deletions
diff --git a/etc/inc/allow-nodejs.inc b/etc/inc/allow-nodejs.inc
index 351c94ab8..f69d9eee2 100644
--- a/etc/inc/allow-nodejs.inc
+++ b/etc/inc/allow-nodejs.inc
@@ -2,6 +2,8 @@
2# Persistent customizations should go in a .local file. 2# Persistent customizations should go in a .local file.
3include allow-nodejs.local 3include allow-nodejs.local
4 4
5ignore read-only ${HOME}/.nvm
6noblacklist ${HOME}/.nvm
5noblacklist ${PATH}/node 7noblacklist ${PATH}/node
6noblacklist /usr/include/node 8noblacklist /usr/include/node
7 9
diff --git a/etc/profile-a-l/curl.profile b/etc/profile-a-l/curl.profile
index 448d8b655..7d7863b6a 100644
--- a/etc/profile-a-l/curl.profile
+++ b/etc/profile-a-l/curl.profile
@@ -18,6 +18,10 @@ noblacklist ${HOME}/.curlrc
18blacklist /tmp/.X11-unix 18blacklist /tmp/.X11-unix
19blacklist ${RUNUSER} 19blacklist ${RUNUSER}
20 20
21# If you use nvm, add the below lines to your curl.local
22#ignore read-only ${HOME}/.nvm
23#noblacklist ${HOME}/.nvm
24
21include disable-common.inc 25include disable-common.inc
22include disable-exec.inc 26include disable-exec.inc
23include disable-programs.inc 27include disable-programs.inc
diff --git a/etc/profile-m-z/nvm.profile b/etc/profile-m-z/node-gyp.profile
index 80da22834..015607087 100644
--- a/etc/profile-m-z/nvm.profile
+++ b/etc/profile-m-z/node-gyp.profile
@@ -1,13 +1,11 @@
1# Firejail profile for nvm 1# Firejail profile for node-gyp
2# Description: Node Version Manager - Simple bash script to manage multiple active node.js versions 2# Description: Part of the Node.js stack
3quiet 3quiet
4# This file is overwritten after every install/update 4# This file is overwritten after every install/update
5# Persistent local customizations 5# Persistent local customizations
6include nvm.local 6include node-gyp.local
7# Persistent global definitions 7# Persistent global definitions
8include globals.local 8include globals.local
9 9
10ignore noroot
11
12# Redirect 10# Redirect
13include nodejs-common.profile 11include nodejs-common.profile
diff --git a/etc/profile-m-z/nodejs-common.profile b/etc/profile-m-z/nodejs-common.profile
index ab69136f6..dd3080ad9 100644
--- a/etc/profile-m-z/nodejs-common.profile
+++ b/etc/profile-m-z/nodejs-common.profile
@@ -7,7 +7,14 @@ include nodejs-common.local
7# added by caller profile 7# added by caller profile
8#include globals.local 8#include globals.local
9 9
10blacklist /tmp/.X11-unix 10# NOTE: gulp, node-gyp, npm, npx, semver and yarn are all node scripts
11# using the `#!/usr/bin/env node` shebang. By sandboxing node the full
12# node.js stack will be firejailed. The only exception is nvm, which is implemented
13# as a sourced shell function, not an executable binary. Hence it is not
14# directly firejailable. You can work around this by sandboxing the programs
15# used by nvm: curl, sha256sum, tar and wget. We have comments in these
16# profiles on how to enable nvm support via local overrides.
17
11blacklist ${RUNUSER} 18blacklist ${RUNUSER}
12 19
13ignore read-only ${HOME}/.npm-packages 20ignore read-only ${HOME}/.npm-packages
@@ -25,13 +32,13 @@ noblacklist ${HOME}/.yarncache
25noblacklist ${HOME}/.yarnrc 32noblacklist ${HOME}/.yarnrc
26 33
27ignore noexec ${HOME} 34ignore noexec ${HOME}
28
29include allow-bin-sh.inc 35include allow-bin-sh.inc
30 36
31include disable-common.inc 37include disable-common.inc
32include disable-exec.inc 38include disable-exec.inc
33include disable-programs.inc 39include disable-programs.inc
34include disable-shell.inc 40include disable-shell.inc
41include disable-X11.inc
35include disable-xdg.inc 42include disable-xdg.inc
36 43
37# If you want whitelisting, change ${HOME}/Projects below to your node projects directory 44# If you want whitelisting, change ${HOME}/Projects below to your node projects directory
@@ -73,6 +80,7 @@ nodvd
73nogroups 80nogroups
74noinput 81noinput
75nonewprivs 82nonewprivs
83noprinters
76noroot 84noroot
77nosound 85nosound
78notv 86notv
diff --git a/etc/profile-m-z/npx.profile b/etc/profile-m-z/npx.profile
new file mode 100644
index 000000000..6d5602c88
--- /dev/null
+++ b/etc/profile-m-z/npx.profile
@@ -0,0 +1,11 @@
1# Firejail profile for npx
2# Description: Part of the Node.js stack
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include npx.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include nodejs-common.profile
diff --git a/etc/profile-m-z/ping-hardened.inc.profile b/etc/profile-m-z/ping-hardened.inc.profile
new file mode 100644
index 000000000..eda53654a
--- /dev/null
+++ b/etc/profile-m-z/ping-hardened.inc.profile
@@ -0,0 +1,11 @@
1# This file is overwritten during software install.
2# Persistent customizations should go in a .local file.
3include ping-hardened.inc.local
4
5caps.drop all
6nonewprivs
7noroot
8protocol unix,inet,inet6
9seccomp
10
11memory-deny-write-execute
diff --git a/etc/profile-m-z/ping.profile b/etc/profile-m-z/ping.profile
index b4923c38a..ed21bd1ce 100644
--- a/etc/profile-m-z/ping.profile
+++ b/etc/profile-m-z/ping.profile
@@ -7,23 +7,30 @@ include ping.local
7# Persistent global definitions 7# Persistent global definitions
8include globals.local 8include globals.local
9 9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER} 10blacklist ${RUNUSER}
12 11
13include disable-common.inc 12include disable-common.inc
14include disable-devel.inc 13include disable-devel.inc
15include disable-exec.inc 14include disable-exec.inc
16include disable-interpreters.inc 15include disable-interpreters.inc
16include disable-proc.inc
17include disable-programs.inc 17include disable-programs.inc
18include disable-X11.inc
18include disable-xdg.inc 19include disable-xdg.inc
19 20
20include whitelist-common.inc 21include whitelist-common.inc
22include whitelist-run-common.inc
23include whitelist-runuser-common.inc
21include whitelist-usr-share-common.inc 24include whitelist-usr-share-common.inc
22include whitelist-var-common.inc 25include whitelist-var-common.inc
23 26
27# Add the next line to your ping.local if your kernel allows unprivileged userns clone.
28#include ping-hardened.inc.profile
29
24apparmor 30apparmor
25caps.keep net_raw 31caps.keep net_raw
26ipc-namespace 32ipc-namespace
33machine-id
27#net tun0 34#net tun0
28#netfilter /etc/firejail/ping.net 35#netfilter /etc/firejail/ping.net
29netfilter 36netfilter
@@ -31,8 +38,9 @@ no3d
31nodvd 38nodvd
32nogroups 39nogroups
33noinput 40noinput
34# ping needs to rise privileges, noroot and nonewprivs will kill it 41# ping needs to raise privileges, nonewprivs and noroot will kill it
35#nonewprivs 42#nonewprivs
43noprinters
36#noroot 44#noroot
37nosound 45nosound
38notv 46notv
@@ -40,15 +48,18 @@ nou2f
40novideo 48novideo
41# protocol command is built using seccomp; nonewprivs will kill it 49# protocol command is built using seccomp; nonewprivs will kill it
42#protocol unix,inet,inet6,netlink,packet 50#protocol unix,inet,inet6,netlink,packet
43# killed by no-new-privs
44#seccomp 51#seccomp
52shell none
53tracelog
45 54
46disable-mnt 55disable-mnt
47private 56private
48#private-bin has mammoth problems with execvp: "No such file or directory" 57#private-bin ping - has mammoth problems with execvp: "No such file or directory"
58private-cache
49private-dev 59private-dev
50# /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem! 60# /etc/hosts is required in private-etc; however, just adding it to the list doesn't solve the problem!
51#private-etc ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl 61#private-etc ca-certificates,crypto-policies,hosts,pki,resolv.conf,ssl
62private-lib
52private-tmp 63private-tmp
53 64
54# memory-deny-write-execute is built using seccomp; nonewprivs will kill it 65# memory-deny-write-execute is built using seccomp; nonewprivs will kill it
@@ -56,3 +67,5 @@ private-tmp
56 67
57dbus-user none 68dbus-user none
58dbus-system none 69dbus-system none
70
71read-only ${HOME}
diff --git a/etc/profile-m-z/semver.profile b/etc/profile-m-z/semver.profile
new file mode 100644
index 000000000..3e0c19b8b
--- /dev/null
+++ b/etc/profile-m-z/semver.profile
@@ -0,0 +1,11 @@
1# Firejail profile for semver
2# Description: Part of the Node.js stack
3quiet
4# This file is overwritten after every install/update
5# Persistent local customizations
6include semver.local
7# Persistent global definitions
8include globals.local
9
10# Redirect
11include nodejs-common.profile
diff --git a/etc/profile-m-z/sha256sum.profile b/etc/profile-m-z/sha256sum.profile
index 48944ebea..45ddecd2d 100644
--- a/etc/profile-m-z/sha256sum.profile
+++ b/etc/profile-m-z/sha256sum.profile
@@ -7,6 +7,9 @@ include sha256sum.local
7# Persistent global definitions 7# Persistent global definitions
8include globals.local 8include globals.local
9 9
10# If you use nvm, add the below lines to your sha256sum.local
11#noblacklist ${HOME}/.nvm
12
10private-bin sha256sum 13private-bin sha256sum
11 14
12# Redirect 15# Redirect
diff --git a/etc/profile-m-z/tar.profile b/etc/profile-m-z/tar.profile
index 0817adda8..a9d0a60d1 100644
--- a/etc/profile-m-z/tar.profile
+++ b/etc/profile-m-z/tar.profile
@@ -7,6 +7,9 @@ include tar.local
7# Persistent global definitions 7# Persistent global definitions
8include globals.local 8include globals.local
9 9
10# If you use nvm, add the below lines to your tar.local
11#noblacklist ${HOME}/.nvm
12
10# Included in archiver-common.profile 13# Included in archiver-common.profile
11ignore include disable-shell.inc 14ignore include disable-shell.inc
12 15
diff --git a/etc/profile-m-z/webstorm.profile b/etc/profile-m-z/webstorm.profile
index 4d849c582..52d2091fe 100644
--- a/etc/profile-m-z/webstorm.profile
+++ b/etc/profile-m-z/webstorm.profile
@@ -18,8 +18,8 @@ include allow-common-devel.inc
18# Allow ssh (blacklisted by disable-common.inc) 18# Allow ssh (blacklisted by disable-common.inc)
19include allow-ssh.inc 19include allow-ssh.inc
20 20
21noblacklist ${PATH}/node
22noblacklist ${HOME}/.nvm 21noblacklist ${HOME}/.nvm
22noblacklist ${PATH}/node
23 23
24include disable-common.inc 24include disable-common.inc
25include disable-devel.inc 25include disable-devel.inc
diff --git a/etc/profile-m-z/webui-aria2.profile b/etc/profile-m-z/webui-aria2.profile
index 2fe727b9c..1aa546a29 100644
--- a/etc/profile-m-z/webui-aria2.profile
+++ b/etc/profile-m-z/webui-aria2.profile
@@ -6,6 +6,7 @@ include webui-aria2.local
6# Persistent global definitions 6# Persistent global definitions
7include globals.local 7include globals.local
8 8
9noblacklist ${HOME}/.nvm
9noblacklist ${PATH}/node 10noblacklist ${PATH}/node
10 11
11include disable-common.inc 12include disable-common.inc
diff --git a/etc/profile-m-z/wget.profile b/etc/profile-m-z/wget.profile
index 4c21d6965..82af30d2a 100644
--- a/etc/profile-m-z/wget.profile
+++ b/etc/profile-m-z/wget.profile
@@ -11,6 +11,10 @@ noblacklist ${HOME}/.netrc
11noblacklist ${HOME}/.wget-hsts 11noblacklist ${HOME}/.wget-hsts
12noblacklist ${HOME}/.wgetrc 12noblacklist ${HOME}/.wgetrc
13 13
14# If you use nvm, add the below lines to your wget.local
15#ignore read-only ${HOME}/.nvm
16#noblacklist ${HOME}/.nvm
17
14blacklist /tmp/.X11-unix 18blacklist /tmp/.X11-unix
15blacklist ${RUNUSER} 19blacklist ${RUNUSER}
16 20
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt
index e962e18da..3dd339d94 100644
--- a/src/man/firejail-profile.txt
+++ b/src/man/firejail-profile.txt
@@ -343,6 +343,18 @@ closed.
343.TP 343.TP
344\fBprivate directory 344\fBprivate directory
345Use directory as user home. 345Use directory as user home.
346--private and --private=directory cannot be used together.
347.br
348
349.br
350Bug: Even with this enabled, some commands (such as mkdir, mkfile and
351private-cache) will still operate on the original home directory.
352Workaround: Disable the incompatible commands, such as by using "ignore mkdir"
353and "ignore mkfile".
354For details, see
355.UR https://github.com/netblue30/firejail/issues/903
356#903
357.UE
346.TP 358.TP
347\fBprivate-bin file,file 359\fBprivate-bin file,file
348Build a new /bin in a temporary filesystem, and copy the programs in the list. 360Build a new /bin in a temporary filesystem, and copy the programs in the list.
@@ -505,7 +517,7 @@ There is no root account (uid 0) defined in the namespace.
505Enable protocol filter. The filter is based on seccomp and checks the 517Enable protocol filter. The filter is based on seccomp and checks the
506first argument to socket system call. Recognized values: \fBunix\fR, 518first argument to socket system call. Recognized values: \fBunix\fR,
507\fBinet\fR, \fBinet6\fR, \fBnetlink\fR, \fBpacket\fR, and \fBbluetooth\fR. 519\fBinet\fR, \fBinet6\fR, \fBnetlink\fR, \fBpacket\fR, and \fBbluetooth\fR.
508Multiple protocol commands are allowed. 520Multiple protocol commands are allowed and they accumulate.
509.TP 521.TP
510\fBseccomp 522\fBseccomp
511Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details. 523Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details.
diff --git a/src/man/firejail.txt b/src/man/firejail.txt
index feb9e4e81..41171a4e7 100644
--- a/src/man/firejail.txt
+++ b/src/man/firejail.txt
@@ -1905,6 +1905,17 @@ Use directory as user home.
1905Example: 1905Example:
1906.br 1906.br
1907$ firejail \-\-private=/home/netblue/firefox-home firefox 1907$ firejail \-\-private=/home/netblue/firefox-home firefox
1908.br
1909
1910.br
1911Bug: Even with this enabled, some commands (such as mkdir, mkfile and
1912private-cache) will still operate on the original home directory.
1913Workaround: Disable the incompatible commands, such as by using "ignore mkdir"
1914and "ignore mkfile".
1915For details, see
1916.UR https://github.com/netblue30/firejail/issues/903
1917#903
1918.UE
1908 1919
1909.TP 1920.TP
1910\fB\-\-private-bin=file,file 1921\fB\-\-private-bin=file,file
@@ -2171,6 +2182,7 @@ $ firejail \-\-profile.print=browser
2171\fB\-\-protocol=protocol,protocol,protocol 2182\fB\-\-protocol=protocol,protocol,protocol
2172Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call. 2183Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call.
2173Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. This option is not supported for i386 architecture. 2184Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. This option is not supported for i386 architecture.
2185Multiple protocol commands are allowed and they accumulate.
2174.br 2186.br
2175 2187
2176.br 2188.br