mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2938] Allow binaries to run in ${HOME}/bin/** while having noexec ${HOME} #1835
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#1835
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 @pedrib on GitHub (Aug 31, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2938
As the name says: I want to allow running binaries off ~/bin and its subdirectories, even in profiles with noexec ${HOME}.
Is there a way to achieve this? I have tried:
Example debug output:
And here's the full profile:
Firejail version:
The only thing in my /etc/firejail/globals.local is:
Everything else is on default values.
@rusty-snake commented on GitHub (Aug 31, 2019):
noexecis to disable the opportunity to run a executable in the dir and all its subdirs and subsubdirs, ... . Since there is noexecoption in firejail you can't revert this for some subdirs. So you must useignore noexec ${HOME}.Because you have
apparmorin yourglobals.local, I think that your system has AA.Because AA has the more powerful globbing, you could try it with this.
e.g.
noexec ${HOME}/{**^bin}I'm not using AA, so I can't help find the full rule for AA.
@pedrib commented on GitHub (Aug 31, 2019):
Thanks! Any plans to make this exec available? I assume I'm not the only one to need this.
And thanks a lot for your work.
@Vincent43 commented on GitHub (Aug 31, 2019):
You can achieve this with
owner /{,run/firejail/mnt/oroot/}home/bin/** ix,in/etc/apparmor.d/local/firejail-local(or/etc/apparmor.d/local/firejail-defaultin debian).After that run
sudo apparmor_parser -r /etc/apparmor.d/firejail-defaultand replaceignore apparmorwithignore noexec ${HOME}in firejail profile.I believe
execrule can't be added because user could then remount arbitrarynoexecdirs in their system.EDIT: @rusty-snake right, fixed.
@rusty-snake commented on GitHub (Aug 31, 2019):
Suggestion:
s/ignore noexec/ignore noexec ${HOME}/g@rusty-snake commented on GitHub (Sep 10, 2019):
@pedrib I'm closing here due to inactivity, please fell free to reopen if you have more questions.
@pedrib commented on GitHub (Sep 10, 2019):
@rusty-snake @Vincent43 thanks, I ended up putting the stuff in /opt so that I could leave the noexec ${HOME} in place, but might change it as you suggested.
@rieje commented on GitHub (Sep 18, 2020):
@rusty-snake I am having trouble running a script in $HOME/bin when using mpv. In mpv, I have a key bound to the script in input.conf, e.g.
DEL run "/home/rieje/bin/mpv-testme". Without firejail, it runs fine. With firejail, running the script with the DEL key in mpv gives the errorRunning subprocess failed: initwith the default profile. I then addignore nexec ${HOME}. I commented outapparmor` (I'm using stock kernel so it's not using better integrated apparmor anyway) and it's the same.Any ideas? I just want to allow this single script for mpv (or whatever is the best way to implement whitelisting a script in $HOME).
Additional info: I'm on latest version of Arch Linux with latest version of Firejail. With the default profile, mpv does not play any videos at all and does not show any errors in the terminal unless I disable seccomp, which I've done.
@rusty-snake commented on GitHub (Sep 18, 2020):
AMD GPU? Try
seccomp !kcmp(#3219).Is this a elf-binary or bash,perl,...-script?
If it requires a interpreter, you need to allow it, use
include allow-XXX.incand add it toprivate-bin. Shell scripts likely need more programs inprivate-binsuch as ls,awk,grep,….You maybe need to allow /bin/sh to start the script.
@rieje commented on GitHub (Sep 18, 2020):
Yea, it's an AMD GPU and replacing
seccompwith that works.Sorry yea, this is an sh script. It actually calls another simple sh script that uses notify-send, but for now to make things simple, I just want mpv to use
/home/rieje/bin/mpv-testmewhich the single commandnotify-send testme. I now haveprivate-bin env,mpv,python*,youtube-dl,bash,sh,notify-send,mpv-testmebut the same issue occurs. I've also added:but it seems to have no effect.
@rusty-snake commented on GitHub (Sep 19, 2020):
Too obviously for me, but $HOME is noexec. So try this mpv.local
EDIT: Wait, you said that you add it. weird.