mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2259] Whitelisting results in fs_private: Read-only file system #1512
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#1512
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 @rhaamo on GitHub (Nov 13, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2259
Using firejail 0.9.56-1 (the .deb amd64 one from SFnet).
I want to jail ffmpeg and ffprobe for the user
peertubewhich HOME directory is/var/www/peertube.I created a ffprobe profile like that (diff from ffmpeg):
And two wrappers:
So I want ffprobe/ffmpeg to be able to transcode videos in
/var/www/peertube/storage/videosand I've written the following profile:If I do
/usr/local/bin/jail_ffprobe /var/www/peertube/storage/videos/somevideo.extI get aNo such file or directory(the file really exists), so I tried to whitelist that directory with:But now it results in:
Whitelisting storage or the home itself results in the same error.
Any ideas how to get that working ?
@smitsohu commented on GitHub (Nov 13, 2018):
At this moment in time the support for home directories outside of
/homeis incomplete.But I think it should be possible to work around the current limitations:
/homepointing to the users home directory/var/www/peertube/etc/passwd, provide this symbolic link as home directory of user peertube--writable-varoption--allusers,--overlayor--chrootoptions (just to say it, you're maybe not interested in this anyway)@smitsohu commented on GitHub (Nov 13, 2018):
and not to forget:
/homeblacklist /var/www/peertubeIt's really funky work around. We should probably just try to fix it 😄
@rhaamo commented on GitHub (Nov 13, 2018):
Thanks !
I went somewhat in the same conclusion that the issue was because HOME was outside of /home :)
I will try the workaround in the next few days to see it if helps.
@smitsohu commented on GitHub (Nov 26, 2018):
One problem are users who control the home directory path (i.e. have write permission on earlier elements of the pathname)... they could redirect us everywhere by means of symbolic links.
I think fixing this shouldn't be too hard if denying symbolic links in home directory paths is considered an acceptable limitation. In the special case where the entry in /etc/passwd references a link inside /home (as in the workaround above), everything would work as it does now. While not perfect, it would be probably good enough for almost all users.
Other/better ideas? @netblue30?
@smitsohu commented on GitHub (Nov 26, 2018):
Regarding the implementation, the proposed
fs_tmpfsfunction from #2276 could be called fromfs_privateif the home directory is outside /home. The other fs_private* functions would need to do something similar.@smitsohu commented on GitHub (Nov 29, 2018):
Maybe we can call realpath early on on user homedir and check, while denying symbolic links, once if that directory is owned by the user.... Then there would be no need to compromise regarding symlinked home directory paths. Also, a restriction that the home directory must be owned by the user looks quite natural.
@smitsohu commented on GitHub (Jul 25, 2019):
Should be fixed now in master.