aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorLibravatar glitsj16 <glitsj16@users.noreply.github.com>2021-01-11 17:32:31 +0000
committerLibravatar GitHub <noreply@github.com>2021-01-11 17:32:31 +0000
commit37452ef1a71473b87431c3c708d3b31ca1b7a25f (patch)
treecbd95f66f264c2c049052f4434757db9ebf99c1e /etc
parentfix ordering in ssh.profile (#3882) (diff)
downloadfirejail-37452ef1a71473b87431c3c708d3b31ca1b7a25f.tar.gz
firejail-37452ef1a71473b87431c3c708d3b31ca1b7a25f.tar.zst
firejail-37452ef1a71473b87431c3c708d3b31ca1b7a25f.zip
refactor nodejs applications (npm & yarn) (#3876)
* add yarn & reorder * add node-gyp & yarn files * Create nodejs-common.profile * Create yarn.profile * refactor npm.profile * add new profile: yarn * read-only's for npm/yarn Thanks to the [suggestion](https://github.com/netblue30/firejail/pull/3876#pullrequestreview-564682989) from @kmk3. * ignore read-only's for npm As [suggested](https://github.com/netblue30/firejail/pull/3876#pullrequestreview-564682989) by @kmk3. * ignore read-only for yarn As suggested in https://github.com/netblue30/firejail/pull/3876#pullrequestreview-564682989 by @kmk3. * remove quiet from nodejs-common.profile quiet should go into the caller profiles instead * add quiet to npm.profile Thanks @rusty-snake for the review. * re-ordering some options * re-ordering
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/allow-common-devel.inc13
-rw-r--r--etc/inc/disable-common.inc2
-rw-r--r--etc/inc/disable-programs.inc5
-rw-r--r--etc/profile-m-z/nodejs-common.profile54
-rw-r--r--etc/profile-m-z/npm.profile53
-rw-r--r--etc/profile-m-z/yarn.profile29
6 files changed, 108 insertions, 48 deletions
diff --git a/etc/inc/allow-common-devel.inc b/etc/inc/allow-common-devel.inc
index 68e91a09b..41643657d 100644
--- a/etc/inc/allow-common-devel.inc
+++ b/etc/inc/allow-common-devel.inc
@@ -11,6 +11,15 @@ noblacklist ${HOME}/.git-credentials
11noblacklist ${HOME}/.gradle 11noblacklist ${HOME}/.gradle
12noblacklist ${HOME}/.java 12noblacklist ${HOME}/.java
13 13
14# Node.js
15noblacklist ${HOME}/.node-gyp
16noblacklist ${HOME}/.npm
17noblacklist ${HOME}/.npmrc
18noblacklist ${HOME}/.yarn
19noblacklist ${HOME}/.yarn-config
20noblacklist ${HOME}/.yarncache
21noblacklist ${HOME}/.yarnrc
22
14# Python 23# Python
15noblacklist ${HOME}/.pylint.d 24noblacklist ${HOME}/.pylint.d
16noblacklist ${HOME}/.python-history 25noblacklist ${HOME}/.python-history
@@ -25,7 +34,3 @@ noblacklist ${HOME}/.cargo/registry
25noblacklist ${HOME}/.cargo/.crates.toml 34noblacklist ${HOME}/.cargo/.crates.toml
26noblacklist ${HOME}/.cargo/.crates2.json 35noblacklist ${HOME}/.cargo/.crates2.json
27noblacklist ${HOME}/.cargo/.package-cache 36noblacklist ${HOME}/.cargo/.package-cache
28
29# npm
30noblacklist ${HOME}/.npm
31noblacklist ${HOME}/.npmrc
diff --git a/etc/inc/disable-common.inc b/etc/inc/disable-common.inc
index d88506d90..0de539d57 100644
--- a/etc/inc/disable-common.inc
+++ b/etc/inc/disable-common.inc
@@ -310,6 +310,7 @@ read-only ${HOME}/.msmtprc
310read-only ${HOME}/.mutt/muttrc 310read-only ${HOME}/.mutt/muttrc
311read-only ${HOME}/.muttrc 311read-only ${HOME}/.muttrc
312read-only ${HOME}/.nano 312read-only ${HOME}/.nano
313read-only ${HOME}/.npmrc
313read-only ${HOME}/.pythonrc.py 314read-only ${HOME}/.pythonrc.py
314read-only ${HOME}/.reportbugrc 315read-only ${HOME}/.reportbugrc
315read-only ${HOME}/.tmux.conf 316read-only ${HOME}/.tmux.conf
@@ -318,6 +319,7 @@ read-only ${HOME}/.viminfo
318read-only ${HOME}/.vimrc 319read-only ${HOME}/.vimrc
319read-only ${HOME}/.xmonad 320read-only ${HOME}/.xmonad
320read-only ${HOME}/.xscreensaver 321read-only ${HOME}/.xscreensaver
322read-only ${HOME}/.yarnrc
321read-only ${HOME}/_exrc 323read-only ${HOME}/_exrc
322read-only ${HOME}/_gvimrc 324read-only ${HOME}/_gvimrc
323read-only ${HOME}/_vimrc 325read-only ${HOME}/_vimrc
diff --git a/etc/inc/disable-programs.inc b/etc/inc/disable-programs.inc
index f5bce4ba4..74cbfbcbe 100644
--- a/etc/inc/disable-programs.inc
+++ b/etc/inc/disable-programs.inc
@@ -761,6 +761,7 @@ blacklist ${HOME}/.neverball
761blacklist ${HOME}/.newsbeuter 761blacklist ${HOME}/.newsbeuter
762blacklist ${HOME}/.newsboat 762blacklist ${HOME}/.newsboat
763blacklist ${HOME}/.nicotine 763blacklist ${HOME}/.nicotine
764blacklist ${HOME}/.node-gyp
764blacklist ${HOME}/.npm 765blacklist ${HOME}/.npm
765blacklist ${HOME}/.npmrc 766blacklist ${HOME}/.npmrc
766blacklist ${HOME}/.nv 767blacklist ${HOME}/.nv
@@ -849,6 +850,10 @@ blacklist ${HOME}/.xmr-stak
849blacklist ${HOME}/.xonotic 850blacklist ${HOME}/.xonotic
850blacklist ${HOME}/.xournalpp 851blacklist ${HOME}/.xournalpp
851blacklist ${HOME}/.xpdfrc 852blacklist ${HOME}/.xpdfrc
853blacklist ${HOME}/.yarn
854blacklist ${HOME}/.yarn-config
855blacklist ${HOME}/.yarncache
856blacklist ${HOME}/.yarnrc
852blacklist ${HOME}/.zoom 857blacklist ${HOME}/.zoom
853blacklist /tmp/akonadi-* 858blacklist /tmp/akonadi-*
854blacklist /tmp/ssh-* 859blacklist /tmp/ssh-*
diff --git a/etc/profile-m-z/nodejs-common.profile b/etc/profile-m-z/nodejs-common.profile
new file mode 100644
index 000000000..acef622c2
--- /dev/null
+++ b/etc/profile-m-z/nodejs-common.profile
@@ -0,0 +1,54 @@
1# Firejail profile for Node.js
2# Description: Common profile for npm/yarn
3# This file is overwritten after every install/update
4# Persistent local customizations
5include nodejs-common.local
6# Persistent global definitions
7# added by caller profile
8#include globals.local
9
10blacklist /tmp/.X11-unix
11blacklist ${RUNUSER}
12
13ignore noexec ${HOME}
14
15noblacklist ${PATH}/bash
16noblacklist ${PATH}/dash
17noblacklist ${PATH}/sh
18
19include disable-common.inc
20include disable-exec.inc
21include disable-passwdmgr.inc
22include disable-programs.inc
23include disable-shell.inc
24include disable-xdg.inc
25
26include whitelist-runuser-common.inc
27include whitelist-usr-share-common.inc
28include whitelist-var-common.inc
29
30caps.drop all
31ipc-namespace
32machine-id
33netfilter
34no3d
35nodvd
36nogroups
37nonewprivs
38noroot
39nosound
40notv
41nou2f
42novideo
43protocol unix,inet,inet6,netlink
44seccomp
45seccomp.block-secondary
46shell none
47
48disable-mnt
49private-dev
50private-etc alternatives,ca-certificates,crypto-policies,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,login.defs,mime.types,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl,xdg
51private-tmp
52
53dbus-user none
54dbus-system none
diff --git a/etc/profile-m-z/npm.profile b/etc/profile-m-z/npm.profile
index 2136fb443..e95e875be 100644
--- a/etc/profile-m-z/npm.profile
+++ b/etc/profile-m-z/npm.profile
@@ -1,64 +1,29 @@
1# Firejail profile for npm 1# Firejail profile for npm
2# Description: The Node.js Package Manager 2# Description: The Node.js Package Manager
3quiet
3# This file is overwritten after every install/update 4# This file is overwritten after every install/update
4# Persistent local customizations 5# Persistent local customizations
5include npm.local 6include npm.local
6# Persistent global definitions 7# Persistent global definitions
7include globals.local 8include globals.local
8 9
9blacklist /tmp/.X11-unix 10ignore read-only ${HOME}/.npm-packages
10blacklist ${RUNUSER} 11ignore read-only ${HOME}/.npmrc
11 12
13noblacklist ${HOME}/.node-gyp
12noblacklist ${HOME}/.npm 14noblacklist ${HOME}/.npm
13noblacklist ${HOME}/.npmrc 15noblacklist ${HOME}/.npmrc
14 16
15noblacklist ${PATH}/bash 17# If you want whitelisting, change ${HOME}/Projects below to your npm projects directory
16noblacklist ${PATH}/dash
17noblacklist ${PATH}/sh
18
19ignore noexec ${HOME}
20
21include disable-common.inc
22include disable-exec.inc
23include disable-passwdmgr.inc
24include disable-programs.inc
25include disable-shell.inc
26include disable-xdg.inc
27
28# If you want whitelisting, change the line below to your npm projects directory
29# and uncomment the lines below. 18# and uncomment the lines below.
19#mkdir ${HOME}/.node-gyp
30#mkdir ${HOME}/.npm 20#mkdir ${HOME}/.npm
31#mkfile ${HOME}/.npmrc 21#mkfile ${HOME}/.npmrc
22#whitelist ${HOME}/.node-gyp
32#whitelist ${HOME}/.npm 23#whitelist ${HOME}/.npm
33#whitelist ${HOME}/.npmrc 24#whitelist ${HOME}/.npmrc
34#whitelist ${HOME}/Projects 25#whitelist ${HOME}/Projects
35#include whitelist-common.inc 26#include whitelist-common.inc
36include whitelist-runuser-common.inc
37include whitelist-usr-share-common.inc
38include whitelist-var-common.inc
39
40caps.drop all
41ipc-namespace
42machine-id
43netfilter
44no3d
45nodvd
46nogroups
47nonewprivs
48noroot
49nosound
50notv
51nou2f
52novideo
53protocol unix,inet,inet6,netlink
54seccomp
55seccomp.block-secondary
56shell none
57
58disable-mnt
59private-dev
60private-etc alternatives,ca-certificates,crypto-policies,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,login.defs,mime.types,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl,xdg
61private-tmp
62 27
63dbus-user none 28# Redirect
64dbus-system none 29include nodejs-common.profile
diff --git a/etc/profile-m-z/yarn.profile b/etc/profile-m-z/yarn.profile
new file mode 100644
index 000000000..f20225050
--- /dev/null
+++ b/etc/profile-m-z/yarn.profile
@@ -0,0 +1,29 @@
1# Firejail profile for yarn
2# Description: Fast, reliable, and secure dependency management
3quiet
4# Persistent local customizations
5include yarn.local
6# Persistent global definitions
7include globals.local
8
9ignore read-only ${HOME}/.yarnrc
10
11noblacklist ${HOME}/.yarn
12noblacklist ${HOME}/.yarn-config
13noblacklist ${HOME}/.yarncache
14noblacklist ${HOME}/.yarnrc
15
16# If you want whitelisting, change ${HOME}/Projects below to your yarn projects directory and uncomment the lines below.
17#mkdir ${HOME}/.yarn
18#mkdir ${HOME}/.yarn-config
19#mkdir ${HOME}/.yarncache
20#mkfile ${HOME}/.yarnrc
21#whitelist ${HOME}/.yarn
22#whitelist ${HOME}/.yarn-config
23#whitelist ${HOME}/.yarncache
24#whitelist ${HOME}/.yarnrc
25#whitelist ${HOME}/Projects
26#include whitelist-common.inc
27
28# Redirect
29include nodejs-common.profile