Tor-Browser-Bundle + firejail als user2 geht nicht

Warum Debian und/oder eine seiner Spielarten? Was muss ich vorher wissen? Wo geht es nach der Installation weiter?
Antworten
Benutzeravatar
c1ue
Beiträge: 98
Registriert: 27.03.2018 13:13:28

Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von c1ue » 02.05.2021 15:37:54

Hallo,

ich versuche gerade das Tor-Browser-Bundel mit firejail laufen zu lassen.
Wenn ich das normal, als zur Zeit angemeldeter user1 mache, dann klappt das auch ganz normal:

firejail /home/clue/tor-browser_en-US/Browser/start-tor-browser

und das TBB wird brav mit firejail abgesichert.

Nun habe ich aber einen separaten user2 angelegt, mit praktisch gar keinen Rechten am System, um mit seinen nicht vorhandenen Rechten für zusätzlichen Schutz zu sorgen. Auch hier möchte ich gerne TBB zusammen mit firejail laufen lassen. Dazu öffne ich den Dolphin von user2 in meiner laufenden Session als user1:

xhost +SI:localuser:user2 && pkexec --user user2 env DISPLAY=$DISPLAY dolphin

Im daraufhin erscheinenden Dolphin von user2 führe ich dann ein ausführbares Skript mit folgendem Inhalt in der integrierten Dolphin-Konsole aus (öffnet sich bei Druck auf F4):

Code: Alles auswählen

#!/bin/bash

firejail --hostname=office --machine-id --profile=tor-browser_en-US sh -c '"/home/user2/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ !  -x "/home/user2/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k

Als Ergebnis kommt folgende Fehlermeldung:

sh firejailed-tbb.sh:

Code: Alles auswählen

Reading profile /home/user2/.config/firejail/tor-browser_en-US.profile
Reading profile /etc/firejail/torbrowser-launcher.profile
Reading profile /etc/firejail/allow-python2.inc
Reading profile /etc/firejail/allow-python3.inc
Reading profile /etc/firejail/disable-common.inc
Reading profile /etc/firejail/disable-devel.inc
Reading profile /etc/firejail/disable-exec.inc
Reading profile /etc/firejail/disable-interpreters.inc
Reading profile /etc/firejail/disable-passwdmgr.inc
Reading profile /etc/firejail/disable-programs.inc
Reading profile /etc/firejail/disable-xdg.inc
Reading profile /etc/firejail/whitelist-common.inc
Reading profile /etc/firejail/whitelist-var-common.inc
Warning: networking feature is disabled in Firejail configuration file
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Parent pid 12034, child pid 12035
30 programs installed in 1415.93 ms
Warning: An abstract unix socket for session D-BUS might still be available. Use --net or remove unix from --protocol set.
Warning fcopy: skipping /etc/alternatives/arptables-restore, cannot find inode
Warning fcopy: skipping /etc/alternatives/nawk, cannot find inode
Warning fcopy: skipping /etc/alternatives/x-window-manager, cannot find inode
Warning fcopy: skipping /etc/alternatives/pftp, cannot find inode
Warning fcopy: skipping /etc/alternatives/aptitude, cannot find inode
Warning fcopy: skipping /etc/alternatives/unrar, cannot find inode
Warning fcopy: skipping /etc/alternatives/awk, cannot find inode
Warning fcopy: skipping /etc/alternatives/ftp, cannot find inode
Warning fcopy: skipping /etc/alternatives/ebtables, cannot find inode
Warning fcopy: skipping /etc/alternatives/pico, cannot find inode
Warning fcopy: skipping /etc/alternatives/editor, cannot find inode
Warning fcopy: skipping /etc/alternatives/cc, cannot find inode
Warning fcopy: skipping /etc/alternatives/c99, cannot find inode
Warning fcopy: skipping /etc/alternatives/jcontrol, cannot find inode
Warning fcopy: skipping /etc/alternatives/write, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzless, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzcmp, cannot find inode
Warning fcopy: skipping /etc/alternatives/pinentry, cannot find inode
Warning fcopy: skipping /etc/alternatives/ip6tables-restore, cannot find inode
Warning fcopy: skipping /etc/alternatives/pager, cannot find inode
Warning fcopy: skipping /etc/alternatives/arptables, cannot find inode
Warning fcopy: skipping /etc/alternatives/x-session-manager, cannot find inode
Warning fcopy: skipping /etc/alternatives/cpp, cannot find inode
Warning fcopy: skipping /etc/alternatives/unlzma, cannot find inode
Warning fcopy: skipping /etc/alternatives/ControlPanel, cannot find inode
Warning fcopy: skipping /etc/alternatives/arptables-save, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzgrep, cannot find inode
Warning fcopy: skipping /etc/alternatives/iptables-restore, cannot find inode
Warning fcopy: skipping /etc/alternatives/nc, cannot find inode
Warning fcopy: skipping /etc/alternatives/mozilla-javaplugin.so, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzfgrep, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzmore, cannot find inode
Warning fcopy: skipping /etc/alternatives/ebtables-restore, cannot find inode
Warning fcopy: skipping /etc/alternatives/mt, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzegrep, cannot find inode
Warning fcopy: skipping /etc/alternatives/ebtables-save, cannot find inode
Warning fcopy: skipping /etc/alternatives/ip6tables, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzdiff, cannot find inode
Warning fcopy: skipping /etc/alternatives/iptables-save, cannot find inode
Warning fcopy: skipping /etc/alternatives/lzcat, cannot find inode
Warning fcopy: skipping /etc/alternatives/rmt, cannot find inode
Warning fcopy: skipping /etc/alternatives/ip6tables-save, cannot find inode
Warning fcopy: skipping /etc/alternatives/c89, cannot find inode
Warning fcopy: skipping /etc/alternatives/gnome-www-browser, cannot find inode
Warning fcopy: skipping /etc/alternatives/x-terminal-emulator, cannot find inode
Warning fcopy: skipping /etc/alternatives/infobrowser, cannot find inode
Warning fcopy: skipping /etc/alternatives/iptables, cannot find inode
Warning fcopy: skipping /etc/alternatives/www-browser, cannot find inode
Warning fcopy: skipping /etc/alternatives/x-www-browser, cannot find inode
Warning fcopy: skipping /etc/alternatives/open, cannot find inode
Warning fcopy: skipping /etc/alternatives/javaws, cannot find inode
Warning fcopy: skipping /etc/alternatives/netcat, cannot find inode
Warning: skipping asound.conf for private /etc
Warning: skipping crypto-policies for private /etc
Warning: skipping pki for private /etc
Warning fcopy: skipping /etc/pulse/client.conf.d/01-enable-autospawn.conf, cannot find inode
Private /etc installed in 390.15 ms
Warning: cleaning all supplementary groups
Warning: cleaning all supplementary groups
Warning: cleaning all supplementary groups
Warning: cleaning all supplementary groups
Cannot mount tmpfs on /home/user2/.config/pulse
Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,
Child process initialized in 1967.36 ms
dummy: 1: /home/user2/tor-browser_en-US/Browser/start-tor-browser: Permission denied
dummy: 1: ./Browser/start-tor-browser: not found

Parent is shutting down, bye...


Wie gesagt, als standard user1 klappt das ganz normal. Ich nutze KDE über das aktuelle Testing (Bullseye). Mit dem aktuellem Stable release geht übrigens beides tadellos. Erst seit Testing hackts.
Wir erleben gerade die letzte Ruhe vor dem Sturm. Genießen wir sie, solange es noch geht

inne
Beiträge: 3273
Registriert: 29.06.2013 17:32:10
Lizenz eigener Beiträge: GNU General Public License
Kontaktdaten:

Re: Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von inne » 02.05.2021 21:27:00

Hallo,
folgende Zeilen würde mir aufstoßen. Gerade die letzen beiden: Permission denied und not found. Nun kenn wir deine Police nicht.

Code: Alles auswählen


Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,

Cannot mount tmpfs on /home/user2/.config/pulse

Seccomp list in: !chroot, check list: @default-keep, prelist: unknown,

Child process initialized in 1967.36 ms

dummy: 1: /home/user2/tor-browser_en-US/Browser/start-tor-browser: Permission denied

dummy: 1: ./Browser/start-tor-browser: not found

Benutzeravatar
c1ue
Beiträge: 98
Registriert: 27.03.2018 13:13:28

Re: Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von c1ue » 05.05.2021 12:07:23

inne hat geschrieben: ↑ zum Beitrag ↑
02.05.2021 21:27:00
Hallo,
folgende Zeilen würde mir aufstoßen. Gerade die letzen beiden: Permission denied und not found. Nun kenn wir deine Police nicht.
Welche police meinst Du? Z.B. policy-kit?

Also ich hab nix am System rumgefummelt. Das sollte alles Auslieferungsstandard sein.
Wir erleben gerade die letzte Ruhe vor dem Sturm. Genießen wir sie, solange es noch geht

inne
Beiträge: 3273
Registriert: 29.06.2013 17:32:10
Lizenz eigener Beiträge: GNU General Public License
Kontaktdaten:

Re: Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von inne » 05.05.2021 12:26:41

c1ue hat geschrieben: ↑ zum Beitrag ↑
05.05.2021 12:07:23

Welche police meinst Du?
Mit Policy meine ich "Reading profile /home/user2/.config/firejail/tor-browser_en-US.profile", also was firejail erlaubt und was nicht. So tief stecke ich in firejail nicht drin, aber ich würde noch mal schauen ob

/home/user2/tor-browser_en-US/Browser/start-tor-browser die korrekten rechte hat

und was das working direktor ist wenn ./Browser/start-tor-browser nicht existiert.

Ich hatte mal geschaut ob es offizelle firejail profile gibt und gefunden habe ich viele Berichte das gerade der Tor-Browser mit firejail schon ticky ist... das Debian Paket in den Backports hat übrigens AppArmor dabei.

willy4711

Re: Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von willy4711 » 05.05.2021 12:54:06

Mal abgesehen davon, dass ich das Starten vom Tor-Browser als zweiten User für sinnlos halte, da das
Firejail Profil eh nur den Zugriff auf ein ganz paar Ordner im /home zulässt, und andere Ordner / Verzeichnisse von
jeglichem Zugriff ausgeschlossen sind.

Der Ort der Modifikation wäre in den Profilen zu suchen (siehe Fehlermeldungen):

/etc/firejail/tor-browser-en-us.profile sagt:

Code: Alles auswählen

# Firejail profile alias for torbrowser-launcher
# This file is overwritten after every install/update

# Persistent global definitions
include tor-browser-en-us.local

noblacklist ${HOME}/.tor-browser-en-us

mkdir ${HOME}/.tor-browser-en-us
whitelist ${HOME}/.tor-browser-en-us

# Redirect
include torbrowser-launcher.profile
und /etc/firejail/torbrowser-launcher.profile sagt u.A.:

Code: Alles auswählen

caps.drop all
netfilter
nodvd
nogroups
nonewprivs
noroot
notv
nou2f
novideo
protocol unix,inet,inet6
seccomp !chroot
shell none
# tracelog may cause issues, see github issue #1930
#tracelog

disable-mnt
private-bin bash,cat,cp,cut,dirname,env,expr,file,gpg,grep,gxmessage,id,kdialog,ln,mkdir,mv,python*,rm,sed,sh,tail,tar,tclsh,test,tor-browser,tor-browser-en,torbrowser-launcher,update-desktop-database,xmessage,xz,zenity
private-dev
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,machine-id,pki,pulse,resolv.conf,ssl
private-tmp

dbus-user none
dbus-system none
Wahrscheinlich müsstest du dort ansetzen und die Dateien manipulieren.
Dein Rattenschwanz an Optionen kann ich nicht nachvollziehen.

Sinnvoller aus meiner Sicht hielte ich, mit der Option --private=directory zu operieren.
siehe:
https://firejail.wordpress.com/features-3/man-firejail/

Edit

Du müsstet dir also ein extra Profil anlegen, was nicht bei einem Update überschrieben wird. Ob das dann
sicherer ist ? ich glaube es nicht.

Benutzeravatar
c1ue
Beiträge: 98
Registriert: 27.03.2018 13:13:28

Re: Tor-Browser-Bundle + firejail als user2 geht nicht

Beitrag von c1ue » 06.05.2021 17:57:20

Dankeschön für Eure guten Ansätze. Mich wundert es ja gerade, dass es als angemeldeter user1 klappt, versuche ich es aber in meiner laufenden Session als user2 mit firejail, gehts halt nicht, obwohl beide ja firejail Rechte besitzen.

Habt Ihr es bei Euch schonmal als anderer user zum Laufen gebracht?
Wir erleben gerade die letzte Ruhe vor dem Sturm. Genießen wir sie, solange es noch geht

Antworten