mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3342] Permission denied when using terminal inside dolphin / kate #2096
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2096
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Apr 10, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3342
Describe the bug
Both
dolphin(file manager) andkate(editor) use the KDE terminal applicationkonsoleto show a terminal window inside the application. Before using firejail, commands were executed, now commands such aspython(only dolphin) orsudo echo test(both programs) result inBehavior change on disabling firejail
All commands were executed without permission error.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
All commands are executed without permission error.
Desktop (please complete the following information):
@ghost commented on GitHub (Apr 10, 2020):
Thanks for reporting this. Not being familiar with KDE this is all a bit speculative, but looking at the firejail profiles for both dolphin and kate, I see a few things that might explain your issues. Both profiles have the 'noroot' option, which could account for commands run with sudo to fail hard. Besides that, the
sudocommand itself is blacklisted in disable-common.inc, which also gets included in both profiles. Can you try with adding the below to override files /etc/firejail/dolphin.local and /etc/firejail/kate.local (create those if non-existing):The python issue is probably the easiest to get fixed, as that is only blacklisted via disable-interpreters.inc in the dolphin profile. Try putting the below in /etc/firejail/dolphin.local (you'll have to create that override file if it doesn't exist):
@rusty-snake commented on GitHub (Apr 10, 2020):
sudo is a suid binary to additional to @glitsj16 fix you need to
ignore nonewprivs.I'm unsure about
nogroups.@ghost commented on GitHub (Apr 11, 2020):
Thank you very much for all your help!
Regarding
sudo: I started testing with dolphin (kate will probably be similar). As it turns out, I need all of the following commands for the dolphin.local:This set is minimal, i.e. if i leave any one of them out, sudo fails (with different errors). But I am not sure - is this really the best solution, especially regarding
caps.dropandprotocol(which have valuesallandunix,inet,inet6,netlinkin the dolphin.profile)? The best solution for me is the one that keeps as much blacklisting / restriction as possible while still allowingsudoto work.By the way,
nogroupsis not required.@rusty-snake commented on GitHub (Apr 11, 2020):
ignore caps.drop allyou can keep this and addcaps.keep cap1,cap2,.... Usefirejail --debug-capsas a help. I think at leastsetuidandsetgidare required.ignore protocolyou can tryunix,inet,inet6,netlink,packet. That's are all the protocols supported by firejail, but I think sudo needs something crazy.seccompeither sudo reject any seccomp filter on it (for security reasons) or it need some blacklisted. The last is definitely true, the first I don't know. Search your syslog/journal for SECCOMP violations. Firejail 0.9.60 does not support exceptions for seccomp, therefore you need to addseccomp.dropsyscalls.txt
syscalls.txt (0.9.60)
@ghost commented on GitHub (Apr 12, 2020):
File managers are a bit
specialand notoriously hard to sandbox IMO, at least not in a practical/workable way (without crippling the profiles to a bare minimum). That's whyfirecfgdoes not enable caja, nautilus, nemo, pcmanfm, ranger and {T,t}hunar by default. I was a bit surprised to see that the only other file manager we support is in fact enabled by default:dolphin. Not sure if we would want to change that, as - like I mentioned before - my KDE experience/insights are close to zero.@udopt This is just my personal opinion. It is based mainly on the fact that applications inherit the sandbox properties from the application they were launched by. In this context that means - again IMO - that it hardly makes sense to firejail a file-manager you use daily/very frequently. Or to put it differently, it makes more sense to give the specific applications their best possible profile protection, which means you launch them from a not-already-sandboxed application (like a file-manager or a terminal emulator). It is up to you to find a sensible balance between security and workability. Other opinions on this are very welcome, just wanted to give the best info I can on this issue.
@rusty-snake commented on GitHub (Jun 4, 2020):
I'm closing here due to inactivity, please fell free to reopen if you have more questions.
@ghost commented on GitHub (Apr 27, 2021):
Hey
I would like to run a bash script inside of dolphin and I get the following error message:
bash: ./cp-releng.sh: /bin/bash: bad interpreter: Permission denied.Ignoring apparmor solved the issue but I would like to try to allow apparmor.
type=AVC msg=audit(1619554752.107:770): apparmor="DENIED" operation="exec" profile="firejail-default" name="~/cp-releng.sh" pid=484211 comm="bash" requested_mask="x" denied_mask="x" fsuid=1000 ouid=1000^]FSUID="dan" OUID="dan"Which one should I work on? Firejail or Apparmor?
dolphin.local looks like this at the moment (samba is another problem :)):
Thanks
@rusty-snake commented on GitHub (Apr 28, 2021):
5515b5e4eb/etc/apparmor/firejail-local (L4-L15)