-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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](#3876 (review)) from @kmk3. * ignore read-only's for npm As [suggested](#3876 (review)) by @kmk3. * ignore read-only for yarn As suggested in #3876 (review) 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
- Loading branch information
Showing
7 changed files
with
109 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Firejail profile for Node.js | ||
# Description: Common profile for npm/yarn | ||
# This file is overwritten after every install/update | ||
# Persistent local customizations | ||
include nodejs-common.local | ||
# Persistent global definitions | ||
# added by caller profile | ||
#include globals.local | ||
|
||
blacklist /tmp/.X11-unix | ||
blacklist ${RUNUSER} | ||
|
||
ignore noexec ${HOME} | ||
|
||
noblacklist ${PATH}/bash | ||
noblacklist ${PATH}/dash | ||
noblacklist ${PATH}/sh | ||
|
||
include disable-common.inc | ||
include disable-exec.inc | ||
include disable-passwdmgr.inc | ||
include disable-programs.inc | ||
include disable-shell.inc | ||
include disable-xdg.inc | ||
|
||
include whitelist-runuser-common.inc | ||
include whitelist-usr-share-common.inc | ||
include whitelist-var-common.inc | ||
|
||
caps.drop all | ||
ipc-namespace | ||
machine-id | ||
netfilter | ||
no3d | ||
nodvd | ||
nogroups | ||
nonewprivs | ||
noroot | ||
nosound | ||
notv | ||
nou2f | ||
novideo | ||
protocol unix,inet,inet6,netlink | ||
seccomp | ||
seccomp.block-secondary | ||
shell none | ||
|
||
disable-mnt | ||
private-dev | ||
private-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 | ||
private-tmp | ||
|
||
dbus-user none | ||
dbus-system none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,29 @@ | ||
# Firejail profile for npm | ||
# Description: The Node.js Package Manager | ||
quiet | ||
# This file is overwritten after every install/update | ||
# Persistent local customizations | ||
include npm.local | ||
# Persistent global definitions | ||
include globals.local | ||
|
||
blacklist /tmp/.X11-unix | ||
blacklist ${RUNUSER} | ||
ignore read-only ${HOME}/.npm-packages | ||
ignore read-only ${HOME}/.npmrc | ||
|
||
noblacklist ${HOME}/.node-gyp | ||
noblacklist ${HOME}/.npm | ||
noblacklist ${HOME}/.npmrc | ||
|
||
noblacklist ${PATH}/bash | ||
noblacklist ${PATH}/dash | ||
noblacklist ${PATH}/sh | ||
|
||
ignore noexec ${HOME} | ||
|
||
include disable-common.inc | ||
include disable-exec.inc | ||
include disable-passwdmgr.inc | ||
include disable-programs.inc | ||
include disable-shell.inc | ||
include disable-xdg.inc | ||
|
||
# If you want whitelisting, change the line below to your npm projects directory | ||
# If you want whitelisting, change ${HOME}/Projects below to your npm projects directory | ||
# and uncomment the lines below. | ||
#mkdir ${HOME}/.node-gyp | ||
#mkdir ${HOME}/.npm | ||
#mkfile ${HOME}/.npmrc | ||
#whitelist ${HOME}/.node-gyp | ||
#whitelist ${HOME}/.npm | ||
#whitelist ${HOME}/.npmrc | ||
#whitelist ${HOME}/Projects | ||
#include whitelist-common.inc | ||
include whitelist-runuser-common.inc | ||
include whitelist-usr-share-common.inc | ||
include whitelist-var-common.inc | ||
|
||
caps.drop all | ||
ipc-namespace | ||
machine-id | ||
netfilter | ||
no3d | ||
nodvd | ||
nogroups | ||
nonewprivs | ||
noroot | ||
nosound | ||
notv | ||
nou2f | ||
novideo | ||
protocol unix,inet,inet6,netlink | ||
seccomp | ||
seccomp.block-secondary | ||
shell none | ||
|
||
disable-mnt | ||
private-dev | ||
private-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 | ||
private-tmp | ||
|
||
dbus-user none | ||
dbus-system none | ||
# Redirect | ||
include nodejs-common.profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Firejail profile for yarn | ||
# Description: Fast, reliable, and secure dependency management | ||
quiet | ||
# Persistent local customizations | ||
include yarn.local | ||
# Persistent global definitions | ||
include globals.local | ||
|
||
ignore read-only ${HOME}/.yarnrc | ||
|
||
noblacklist ${HOME}/.yarn | ||
noblacklist ${HOME}/.yarn-config | ||
noblacklist ${HOME}/.yarncache | ||
noblacklist ${HOME}/.yarnrc | ||
|
||
# If you want whitelisting, change ${HOME}/Projects below to your yarn projects directory and uncomment the lines below. | ||
#mkdir ${HOME}/.yarn | ||
#mkdir ${HOME}/.yarn-config | ||
#mkdir ${HOME}/.yarncache | ||
#mkfile ${HOME}/.yarnrc | ||
#whitelist ${HOME}/.yarn | ||
#whitelist ${HOME}/.yarn-config | ||
#whitelist ${HOME}/.yarncache | ||
#whitelist ${HOME}/.yarnrc | ||
#whitelist ${HOME}/Projects | ||
#include whitelist-common.inc | ||
|
||
# Redirect | ||
include nodejs-common.profile |