diff options
-rw-r--r-- | .github/workflows/codeql-analysis.yml | 6 | ||||
-rw-r--r-- | etc/inc/allow-nodejs.inc | 2 | ||||
-rw-r--r-- | etc/profile-a-l/curl.profile | 4 | ||||
-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.profile | 12 | ||||
-rw-r--r-- | etc/profile-m-z/npx.profile | 11 | ||||
-rw-r--r-- | etc/profile-m-z/semver.profile | 11 | ||||
-rw-r--r-- | etc/profile-m-z/sha256sum.profile | 3 | ||||
-rw-r--r-- | etc/profile-m-z/tar.profile | 3 | ||||
-rw-r--r-- | etc/profile-m-z/webstorm.profile | 2 | ||||
-rw-r--r-- | etc/profile-m-z/webui-aria2.profile | 1 | ||||
-rw-r--r-- | etc/profile-m-z/wget.profile | 4 | ||||
-rw-r--r-- | src/man/firejail-profile.txt | 14 | ||||
-rw-r--r-- | src/man/firejail.txt | 12 |
14 files changed, 81 insertions, 12 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 98b713e9e..e1d972d04 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml | |||
@@ -47,7 +47,7 @@ jobs: | |||
47 | 47 | ||
48 | # Initializes the CodeQL tools for scanning. | 48 | # Initializes the CodeQL tools for scanning. |
49 | - name: Initialize CodeQL | 49 | - name: Initialize CodeQL |
50 | uses: github/codeql-action/init@f5d822707ee6e8fb81b04a5c0040b736da22e587 | 50 | uses: github/codeql-action/init@883476649888a9e8e219d5b2e6b789dc024f690c |
51 | with: | 51 | with: |
52 | languages: ${{ matrix.language }} | 52 | languages: ${{ matrix.language }} |
53 | # If you wish to specify custom queries, you can do so here or in a config file. | 53 | # If you wish to specify custom queries, you can do so here or in a config file. |
@@ -58,7 +58,7 @@ jobs: | |||
58 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | 58 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
59 | # If this step fails, then you should remove it and run the build manually (see below) | 59 | # If this step fails, then you should remove it and run the build manually (see below) |
60 | - name: Autobuild | 60 | - name: Autobuild |
61 | uses: github/codeql-action/autobuild@f5d822707ee6e8fb81b04a5c0040b736da22e587 | 61 | uses: github/codeql-action/autobuild@883476649888a9e8e219d5b2e6b789dc024f690c |
62 | 62 | ||
63 | # âšī¸ Command-line programs to run using the OS shell. | 63 | # âšī¸ Command-line programs to run using the OS shell. |
64 | # đ https://git.io/JvXDl | 64 | # đ https://git.io/JvXDl |
@@ -72,4 +72,4 @@ jobs: | |||
72 | # make release | 72 | # make release |
73 | 73 | ||
74 | - name: Perform CodeQL Analysis | 74 | - name: Perform CodeQL Analysis |
75 | uses: github/codeql-action/analyze@f5d822707ee6e8fb81b04a5c0040b736da22e587 | 75 | uses: github/codeql-action/analyze@883476649888a9e8e219d5b2e6b789dc024f690c |
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. |
3 | include allow-nodejs.local | 3 | include allow-nodejs.local |
4 | 4 | ||
5 | ignore read-only ${HOME}/.nvm | ||
6 | noblacklist ${HOME}/.nvm | ||
5 | noblacklist ${PATH}/node | 7 | noblacklist ${PATH}/node |
6 | noblacklist /usr/include/node | 8 | noblacklist /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 | |||
18 | blacklist /tmp/.X11-unix | 18 | blacklist /tmp/.X11-unix |
19 | blacklist ${RUNUSER} | 19 | blacklist ${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 | |||
21 | include disable-common.inc | 25 | include disable-common.inc |
22 | include disable-exec.inc | 26 | include disable-exec.inc |
23 | include disable-programs.inc | 27 | include 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 |
3 | quiet | 3 | quiet |
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 |
6 | include nvm.local | 6 | include node-gyp.local |
7 | # Persistent global definitions | 7 | # Persistent global definitions |
8 | include globals.local | 8 | include globals.local |
9 | 9 | ||
10 | ignore noroot | ||
11 | |||
12 | # Redirect | 10 | # Redirect |
13 | include nodejs-common.profile | 11 | include 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 | ||
10 | blacklist /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 | |||
11 | blacklist ${RUNUSER} | 18 | blacklist ${RUNUSER} |
12 | 19 | ||
13 | ignore read-only ${HOME}/.npm-packages | 20 | ignore read-only ${HOME}/.npm-packages |
@@ -25,13 +32,13 @@ noblacklist ${HOME}/.yarncache | |||
25 | noblacklist ${HOME}/.yarnrc | 32 | noblacklist ${HOME}/.yarnrc |
26 | 33 | ||
27 | ignore noexec ${HOME} | 34 | ignore noexec ${HOME} |
28 | |||
29 | include allow-bin-sh.inc | 35 | include allow-bin-sh.inc |
30 | 36 | ||
31 | include disable-common.inc | 37 | include disable-common.inc |
32 | include disable-exec.inc | 38 | include disable-exec.inc |
33 | include disable-programs.inc | 39 | include disable-programs.inc |
34 | include disable-shell.inc | 40 | include disable-shell.inc |
41 | include disable-X11.inc | ||
35 | include disable-xdg.inc | 42 | include 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 | |||
73 | nogroups | 80 | nogroups |
74 | noinput | 81 | noinput |
75 | nonewprivs | 82 | nonewprivs |
83 | noprinters | ||
76 | noroot | 84 | noroot |
77 | nosound | 85 | nosound |
78 | notv | 86 | notv |
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 | ||
3 | quiet | ||
4 | # This file is overwritten after every install/update | ||
5 | # Persistent local customizations | ||
6 | include npx.local | ||
7 | # Persistent global definitions | ||
8 | include globals.local | ||
9 | |||
10 | # Redirect | ||
11 | include nodejs-common.profile | ||
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 | ||
3 | quiet | ||
4 | # This file is overwritten after every install/update | ||
5 | # Persistent local customizations | ||
6 | include semver.local | ||
7 | # Persistent global definitions | ||
8 | include globals.local | ||
9 | |||
10 | # Redirect | ||
11 | include 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 |
8 | include globals.local | 8 | include globals.local |
9 | 9 | ||
10 | # If you use nvm, add the below lines to your sha256sum.local | ||
11 | #noblacklist ${HOME}/.nvm | ||
12 | |||
10 | private-bin sha256sum | 13 | private-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 |
8 | include globals.local | 8 | include 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 |
11 | ignore include disable-shell.inc | 14 | ignore 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) |
19 | include allow-ssh.inc | 19 | include allow-ssh.inc |
20 | 20 | ||
21 | noblacklist ${PATH}/node | ||
22 | noblacklist ${HOME}/.nvm | 21 | noblacklist ${HOME}/.nvm |
22 | noblacklist ${PATH}/node | ||
23 | 23 | ||
24 | include disable-common.inc | 24 | include disable-common.inc |
25 | include disable-devel.inc | 25 | include 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 |
7 | include globals.local | 7 | include globals.local |
8 | 8 | ||
9 | noblacklist ${HOME}/.nvm | ||
9 | noblacklist ${PATH}/node | 10 | noblacklist ${PATH}/node |
10 | 11 | ||
11 | include disable-common.inc | 12 | include 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 | |||
11 | noblacklist ${HOME}/.wget-hsts | 11 | noblacklist ${HOME}/.wget-hsts |
12 | noblacklist ${HOME}/.wgetrc | 12 | noblacklist ${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 | |||
14 | blacklist /tmp/.X11-unix | 18 | blacklist /tmp/.X11-unix |
15 | blacklist ${RUNUSER} | 19 | blacklist ${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 |
345 | Use directory as user home. | 345 | Use directory as user home. |
346 | --private and --private=directory cannot be used together. | ||
347 | .br | ||
348 | |||
349 | .br | ||
350 | Bug: Even with this enabled, some commands (such as mkdir, mkfile and | ||
351 | private-cache) will still operate on the original home directory. | ||
352 | Workaround: Disable the incompatible commands, such as by using "ignore mkdir" | ||
353 | and "ignore mkfile". | ||
354 | For 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 |
348 | Build a new /bin in a temporary filesystem, and copy the programs in the list. | 360 | Build 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. | |||
505 | Enable protocol filter. The filter is based on seccomp and checks the | 517 | Enable protocol filter. The filter is based on seccomp and checks the |
506 | first argument to socket system call. Recognized values: \fBunix\fR, | 518 | first 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. |
508 | Multiple protocol commands are allowed. | 520 | Multiple protocol commands are allowed and they accumulate. |
509 | .TP | 521 | .TP |
510 | \fBseccomp | 522 | \fBseccomp |
511 | Enable seccomp filter and blacklist the syscalls in the default list. See man 1 firejail for more details. | 523 | Enable 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. | |||
1905 | Example: | 1905 | Example: |
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 | ||
1911 | Bug: Even with this enabled, some commands (such as mkdir, mkfile and | ||
1912 | private-cache) will still operate on the original home directory. | ||
1913 | Workaround: Disable the incompatible commands, such as by using "ignore mkdir" | ||
1914 | and "ignore mkfile". | ||
1915 | For 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 |
2172 | Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call. | 2183 | Enable protocol filter. The filter is based on seccomp and checks the first argument to socket system call. |
2173 | Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. This option is not supported for i386 architecture. | 2184 | Recognized values: unix, inet, inet6, netlink, packet, and bluetooth. This option is not supported for i386 architecture. |
2185 | Multiple protocol commands are allowed and they accumulate. | ||
2174 | .br | 2186 | .br |
2175 | 2187 | ||
2176 | .br | 2188 | .br |