mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4114] Apparmor and Firejail - Sandboxing not working properly #2539
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#2539
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 @g4njawizard on GitHub (Mar 18, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4114
In the past I started every firefox session via an alias. Now I wanted to test it with default settings and apparmor activated.
I've run the following:
To enable apparmor:
sudo apparmor_parser -r /etc/apparmor.d/firejail-defaultWhen I start Firefox from inside my terminal, I see:
But if I check all active sandboxes, I only see:
What also is strange, that after a system reboot the apparmor firejail profile is gone, so I have to rerun apparmor_parser -r. How can I safe this setting?
After a reboot, I see this message, when starting firefox:
When I do firecfg --clean, the sandbox warning disappears, but I have no more profiles.
Am I missing a step?
I am using Debian
@rusty-snake commented on GitHub (Mar 18, 2021):
/usr/bin/firefoxis a shell-script that starts/usr/lib/firefox-esr/firefox-esr.@g4njawizard commented on GitHub (Mar 18, 2021):
This is just informative, but not helping. Or what do you want to tell me?
@smitsohu commented on GitHub (Mar 18, 2021):
No matter if firejail is used or not, you will never find
/usr/bin/firefoxin your process tree on a Debian system.Just try it out using
toporpgrep -a firefoxor whatever tool you prefer.As @rusty-snake said, the reason is that when you type
/usr/bin/firefox, at first you run a shell, and/usr/lib/firefox-esr/firefox-esra.k.a. Firefox is executed only in a second step.In other words, your
aa-statusoutput looks good.Did you already try what firejail suggested you to do?
@g4njawizard commented on GitHub (Mar 18, 2021):
Thanks for explaining.
But I still don't understand why it matters if I start using "firefox" or "firefox-esr" Both lead to the same issue.
regarding aa-enforce, I had to additionally install apparmor-utils to enforce it. I think it will persist now. Haven't rebooted yet.
@rusty-snake commented on GitHub (Mar 18, 2021):
Firefox is started in firejail and AA is enforced you said, anything missing?
The "Warning: an existing sandbox was detected. /usr/bin/frog will run without any additional sandboxing features" is because you run
firejail frogandwhich frogis the firecfg symlink. You should always usefirejail /usr/bin/frogif there is a firecfg symlink for frog.@g4njawizard commented on GitHub (Mar 18, 2021):
Ok, now I got it.
I wasn't sure, if I always have to define the path.
It looks better now.
If I might ask, do you always type firejail <path/app>, or do you use aliases, or is there another trick to make things easier? ^^
And thank you guys for your quick feedback! Well appreciated.
@rusty-snake commented on GitHub (Mar 18, 2021):
as you
sudo firecfg, you can simply typefirefox. (I myself use firecfg.py instead).@g4njawizard commented on GitHub (Mar 18, 2021):
Oh, thats good to know! THX :)
@g4njawizard commented on GitHub (Mar 19, 2021):
I have to sorry for reopening this issue.
But it seems like apparmor is not able to safe the firejail profile.
After every boot I have to manually set "aa-enforce firejail-default"
And just like @rusty-snake mentioned with using firecfg, I could simply type firefox to open it sandboxed.
But today after starting It didn't work again.
I had to go this way again:
This seems to me like either my system is not running well, or is this a bug?
@rusty-snake commented on GitHub (Mar 19, 2021):
This shows firefox is running in firejail, so this works.
So AA is the thing that does not seem to work (after a reboot). However I can help here, I'm on a SELinux system for years.
@g4njawizard commented on GitHub (Mar 19, 2021):
but as you see, when I only type firefox
I dont have SELinux enabled on my private notebook. So this can't be the cause for this problem. Yesterday I saw a message in dmesg, but I forgot to copy it. There stood something like, "unconfined".. "error=2" "firejail-default"
And yes, apparmor is just unable to load all profiles after boot. It only loads docker-profile by default. Everything else I have to pass manually
Long story short, I am back to where I was yesterday. :D
@rusty-snake commented on GitHub (Mar 19, 2021):
firefox and firefox-esr are the same on debian. Both are shell-script or one is a symlink to the other (maybe through alternatives). There's nothing wrong, everything works.
firejail (from debian) has AA and SE support enabled. If neither of them is enabled no is used, if AA is enabled it is used and if SE is enabled it is used.
@g4njawizard commented on GitHub (Mar 19, 2021):
I saw my mistake regarding firejail firefox. I have to run "firefox-esr" to make the warning disappear.
SELinux is not enabled on my system.
getenforce is an unknown command.
aa-enabled
yes
So how do I deal with this?
I forgot to mention, that under /etc/apparmor.d/ lies the unused firejail-default profile.
Is there a apparmor cfg, where I can set this profile on autoload?
@rusty-snake commented on GitHub (Mar 19, 2021):
It's just an informative warning.
You can not use AA and SE. There nothing that you need to do about SE. The only thing you we need to focus is the loading of the AA profile. (and as I said I have no much knowledge about AA usage).
@g4njawizard commented on GitHub (Mar 19, 2021):
oh, than you had a typo:
Well then, thank you anyway for your time and help. :)
@g4njawizard commented on GitHub (Mar 19, 2021):
Problem solved.
having aa-enabled (yes) alone is not working, when you dont have the (apparmor.service) enabled.
I've added my /apparmor.d/ profiles via /etc/apparmor/parser.conf
systemctl enable apparmor.service
But... it should have worked without enabling the service, since there was 1 docker-profile which was always loaded after boot.
If someone has an idea how to approach enabling a profile without enabling the service, that would be great!