Skip to content

Commit

Permalink
Merge branch 'master' into replace-iwrite-iwuser
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Oct 9, 2021
2 parents 3050ef0 + bb815a4 commit 4937f73
Show file tree
Hide file tree
Showing 39 changed files with 319 additions and 149 deletions.
21 changes: 17 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ assignees: ''

---

<!--
See the following links for help with formatting:
https://guides.github.com/features/mastering-markdown/
https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
-->

### Description

_Describe the bug_
Expand All @@ -15,7 +22,7 @@ _Describe the bug_

_Steps to reproduce the behavior_

1. Run in bash `LANG=C firejail PROGRAM` (`LANG=C` to get English messages that can be understood by everybody)
1. Run in bash `LC_ALL=C firejail PROGRAM` (`LC_ALL=C` to get a consistent output in English that can be understood by everybody)
2. Click on '....'
3. Scroll down to '....'
4. See error `ERROR`
Expand All @@ -30,7 +37,7 @@ _What actually happened_

### Behavior without a profile

_What changed calling `firejail --noprofile /path/to/program` in a terminal?_
_What changed calling `LC_ALL=C firejail --noprofile /path/to/program` in a terminal?_

### Additional context

Expand All @@ -44,6 +51,12 @@ _Any other detail that may help to understand/debug the problem_

### Checklist

<!--
Note: Items are checked with an "x", like so:
- [x] This is a checked item.
-->

- [ ] The issues is caused by firejail (i.e. running the program by path (e.g. `/usr/bin/vlc`) "fixes" it).
- [ ] I can reproduce the issue without custom modifications (e.g. globals.local).
- [ ] The program has a profile. (If not, request one in `https://github.com/netblue30/firejail/issues/1139`)
Expand All @@ -55,7 +68,7 @@ _Any other detail that may help to understand/debug the problem_
### Log

<details>
<summary>Output of <code>firejail /path/to/program</code></summary>
<summary>Output of <code>LC_ALL=C firejail /path/to/program</code></summary>
<p>

```
Expand All @@ -66,7 +79,7 @@ output goes here
</details>

<details>
<summary>Output of <code>firejail --debug /path/to/program</code></summary>
<summary>Output of <code>LC_ALL=C firejail --debug /path/to/program</code></summary>
<p>

```
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,5 @@ $ ./profstats *.profile

### New profiles:

clion-eap, lifeograph, io.github.lainsce.Notejot, rednotebook, zim, microsoft-edge-beta, ncdu2, gallery-dl, yt-dlp
clion-eap, lifeograph, io.github.lainsce.Notejot, rednotebook, zim, microsoft-edge-beta, ncdu2, gallery-dl, yt-dlp, goldendict, bundle,
cmake, make, meson, pip, codium
5 changes: 4 additions & 1 deletion RELNOTES
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
firejail (0.9.67) baseline; urgency=low
* work in progress
* exit code: distinguish fatal signals by adding 128
* deprecated --disable-whitelist at compile time
* deprecated whitelist=yes/no in /etc/firejail/firejail.config
* new condition: ALLOW_TRAY
* remove (some) environment variables with auth-tokens
* new includes: whitelist-run-common.inc, disable-X11.inc
* removed includes: disable-passwordmgr.inc
* new profiles: microsoft-edge-beta, clion-eap, lifeograph, zim
* new profiles: io.github.lainsce.Notejot, rednotebook, gallery-dl
* new profiles: yt-dlp
* new profiles: yt-dlp, goldendict, goldendict, bundle, cmake
* new profiles: make, meson, pip, codium
-- netblue30 <[email protected]> Thu, 29 Jul 2021 09:00:00 -0500

firejail (0.9.66) baseline; urgency=low
Expand Down
2 changes: 1 addition & 1 deletion contrib/vim/syntax/firejail.vim
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ syn match fjCommandNoCond /quiet$/ contained

" Conditionals grabbed from: src/firejail/profile.c
" Generate list with: awk -- 'BEGIN {process=0;} /^Cond conditionals\[\] = \{$/ {process=1;} /\t*\{"[^"]+".*/ { if (process) {print gensub(/^\t*\{"([^"]+)".*$/, "\\1", 1);} } /^\t\{ NULL, NULL \}$/ {process=0;}' src/firejail/profile.c | sort -u | tr $'\n' '|'
syn match fjConditional /\v\?(BROWSER_ALLOW_DRM|BROWSER_DISABLE_U2F|HAS_APPIMAGE|HAS_NET|HAS_NODBUS|HAS_NOSOUND|HAS_X11) ?:/ nextgroup=fjCommand skipwhite contained
syn match fjConditional /\v\?(ALLOW_TRAY|BROWSER_ALLOW_DRM|BROWSER_DISABLE_U2F|HAS_APPIMAGE|HAS_NET|HAS_NODBUS|HAS_NOSOUND|HAS_X11) ?:/ nextgroup=fjCommand skipwhite contained

" A line is either a command, a conditional or a comment
syn match fjStatement /^/ nextgroup=fjCommand,fjCommandNoCond,fjConditional,fjComment
Expand Down
3 changes: 3 additions & 0 deletions etc/firejail.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# keyword-argument pairs, one per line. Most features are enabled by default.
# Use 'yes' or 'no' as configuration values.

# Allow programs to display a tray icon
# allow-tray no

# Enable AppArmor functionality, default enabled.
# apparmor yes

Expand Down
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
4 changes: 3 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 Expand Up @@ -142,6 +143,7 @@ blacklist ${HOME}/.config/SubDownloader
blacklist ${HOME}/.config/Thunar
blacklist ${HOME}/.config/Twitch
blacklist ${HOME}/.config/Unknown Organization
blacklist ${HOME}/.config/VSCodium
blacklist ${HOME}/.config/VirtualBox
blacklist ${HOME}/.config/Whalebird
blacklist ${HOME}/.config/Wire
Expand Down
1 change: 1 addition & 0 deletions etc/profile-a-l/amule.profile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ nosound
notv
nou2f
novideo
# Add netlink protocol to use UPnP
protocol unix,inet,inet6
seccomp
shell none
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
10 changes: 10 additions & 0 deletions etc/profile-a-l/codium.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Firejail profile alias for VSCodium
# This file is overwritten after every install/update
# Persistent local customizations
include codium.local
# Persistent global definitions
# added by included profile
#include globals.local

# Redirect
include vscodium.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
Loading

0 comments on commit 4937f73

Please sign in to comment.