Skip to content

Commit

Permalink
Merge pull request #4519 from rusty-snake/build-systems
Browse files Browse the repository at this point in the history
Add profiles for build-systems (/package-managers)
  • Loading branch information
netblue30 committed Oct 9, 2021
2 parents 29af7da + f0d2392 commit 35f3f7e
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 54 deletions.
5 changes: 4 additions & 1 deletion etc/inc/allow-common-devel.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ noblacklist ${HOME}/.python-history
noblacklist ${HOME}/.python_history
noblacklist ${HOME}/.pythonhist

# Ruby
noblacklist ${HOME}/.bundle

# Rust
noblacklist ${HOME}/.cargo/*
noblacklist ${HOME}/.cargo
1 change: 1 addition & 0 deletions etc/inc/allow-ruby.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include allow-ruby.local

noblacklist ${PATH}/ruby
noblacklist /usr/lib/ruby
noblacklist /usr/lib64/ruby
1 change: 1 addition & 0 deletions etc/inc/disable-interpreters.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ blacklist /usr/share/php*
# Ruby
blacklist ${PATH}/ruby
blacklist /usr/lib/ruby
blacklist /usr/lib64/ruby

# Programs using python: deluge, firefox addons, filezilla, cherrytree, xchat, hexchat, libreoffice, scribus
# Python 2
Expand Down
3 changes: 2 additions & 1 deletion etc/inc/disable-programs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ blacklist ${HOME}/.bibletime
blacklist ${HOME}/.bitcoin
blacklist ${HOME}/.blobby
blacklist ${HOME}/.bogofilter
blacklist ${HOME}/.bundle
blacklist ${HOME}/.bzf
blacklist ${HOME}/.cargo/*
blacklist ${HOME}/.cargo
blacklist ${HOME}/.claws-mail
blacklist ${HOME}/.cliqz
blacklist ${HOME}/.clion*
Expand Down
66 changes: 66 additions & 0 deletions etc/profile-a-l/build-systems-common.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Firejail profile for build-systems-common
# This file is overwritten after every install/update
# Persistent local customizations
include build-systems-common.local
# Persistent global definitions
# added by caller profile
#include globals.local

ignore noexec ${HOME}
ignore noexec /tmp

# Allow /bin/sh (blacklisted by disable-shell.inc)
include allow-bin-sh.inc

# Allows files commonly used by IDEs
include allow-common-devel.inc

# Allow ssh (blacklisted by disable-common.inc)
#include allow-ssh.inc

blacklist ${RUNUSER}

include disable-common.inc
include disable-exec.inc
include disable-interpreters.inc
include disable-programs.inc
include disable-shell.inc
include disable-X11.inc
include disable-xdg.inc

#whitelist ${HOME}/Projects
#include whitelist-common.inc

whitelist /usr/share/pkgconfig
include whitelist-run-common.inc
include whitelist-usr-share-common.inc
include whitelist-var-common.inc

caps.drop all
ipc-namespace
machine-id
# net none
netfilter
no3d
nodvd
nogroups
noinput
nonewprivs
noroot
nosound
notv
nou2f
novideo
protocol unix,inet,inet6
seccomp
seccomp.block-secondary
shell none
tracelog

disable-mnt
private-cache
private-dev
private-tmp

dbus-user none
dbus-system none
23 changes: 23 additions & 0 deletions etc/profile-a-l/bundle.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Firejail profile for bundle
# Description: Ruby Dependency Management
# This file is overwritten after every install/update
quiet
# Persistent local customizations
include bundle.local
# Persistent global definitions
include globals.local

noblacklist ${HOME}/.bundle

# Allow ruby (blacklisted by disable-interpreters.inc)
include allow-ruby.inc

#whitelist ${HOME}/.bundle
#whitelist ${HOME}/.gem
#whitelist ${HOME}/.local/share/gem
whitelist /usr/share/gems
whitelist /usr/share/ruby
whitelist /usr/share/rubygems

# Redirect
include build-systems-common.profile
56 changes: 4 additions & 52 deletions etc/profile-a-l/cargo.profile
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,18 @@ include cargo.local
# Persistent global definitions
include globals.local

ignore noexec ${HOME}
ignore noexec /tmp

blacklist /tmp/.X11-unix
blacklist ${RUNUSER}
ignore read-only ${HOME}/.cargo/bin

noblacklist ${HOME}/.cargo/credentials
noblacklist ${HOME}/.cargo/credentials.toml

# Allows files commonly used by IDEs
include allow-common-devel.inc

# Allow ssh (blacklisted by disable-common.inc)
#include allow-ssh.inc

include disable-common.inc
include disable-exec.inc
include disable-interpreters.inc
include disable-programs.inc
include disable-xdg.inc

#mkdir ${HOME}/.cargo
#whitelist ${HOME}/YOUR_CARGO_PROJECTS
#whitelist ${HOME}/.cargo
#whitelist ${HOME}/.rustup
#include whitelist-common.inc
whitelist /usr/share/pkgconfig
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
noinput
nonewprivs
noroot
nosound
notv
nou2f
novideo
protocol unix,inet,inet6
seccomp
seccomp.block-secondary
shell none
tracelog

disable-mnt
#private-bin cargo,rustc
private-cache
private-dev
private-etc alternatives,ca-certificates,crypto-policies,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,magic,magic.mgc,nsswitch.conf,passwd,pki,protocols,resolv.conf,rpc,services,ssl
private-tmp

dbus-user none
dbus-system none

memory-deny-write-execute
read-write ${HOME}/.cargo/bin

# Redirect
include build-systems-common.profile
13 changes: 13 additions & 0 deletions etc/profile-a-l/cmake.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Firejail profile for cargo
# Description: The Rust package manager
# This file is overwritten after every install/update
quiet
# Persistent local customizations
include cargo.local
# Persistent global definitions
include globals.local

memory-deny-write-execute

# Redirect
include build-systems-common.profile
13 changes: 13 additions & 0 deletions etc/profile-m-z/make.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Firejail profile for make
# Description: GNU make utility to maintain groups of programs
# This file is overwritten after every install/update
quiet
# Persistent local customizations
include make.local
# Persistent global definitions
include globals.local

memory-deny-write-execute

# Redirect
include build-systems-common.profile
14 changes: 14 additions & 0 deletions etc/profile-m-z/meson.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Firejail profile for meson
# Description: A high productivity build system
# This file is overwritten after every install/update
quiet
# Persistent local customizations
include meson.local
# Persistent global definitions
include globals.local

# Allow python3 (blacklisted by disable-interpreters.inc)
include allow-python3.inc

# Redirect
include build-systems-common.profile
18 changes: 18 additions & 0 deletions etc/profile-m-z/pip.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Firejail profile for pip
# Description: package manager for Python packages
# This file is overwritten after every install/update
quiet
# Persistent local customizations
include meson.local
# Persistent global definitions
include globals.local

ignore read-only ${HOME}/.local/lib

# Allow python3 (blacklisted by disable-interpreters.inc)
include allow-python3.inc

#whitelist ${HOME}/.local/lib/python*

# Redirect
include build-systems-common.profile

0 comments on commit 35f3f7e

Please sign in to comment.