Closed luckylinux closed 5 months ago
I cannot mount an external USB Flashdrive anymore.
It seems highly unlikely that this would be caused by firejail.
(and switched
apparmor
toenforcing
mode).
Does the problem still happens without that?
If yes, does it still happen after running sudo firecfg --clean
and
uninstalling firejail?
I'm pretty sure I tried to "lower" the apparmor settings but it didn't make a difference.
So far I had to use the Laptop (which has a less enforcing apparmor policy and other hardening Settings) when I wanted NFS or an External USB Flashdrive.
On the other side apparmor
is supposed to be in enforcing mode by default on Ubuntu nowadays, so I'm a bit surprised that there isn't a Profile shipped for it, if that is the case.
And I do NOT know how to create one to be honest ...
Does the problem still happen after running sudo firecfg --clean
,
uninstalling firejail and rebooting?
I'm a bit wary of doing that to be honest, given all the trouble it took just to set it up.
Aren't there other alternatives ?
Unfortunately, whatever is causing these issues, isn't being logged much if at all.
I'm a bit wary of doing that to be honest, given all the trouble it took just to set it up.
How was firejail set up?
What other changes were done to the system?
Note that firecfg(1)
says that firecfg "automatically loads and forces the
AppArmor profile "firejail-default"", so it could be related, though I think
that this loading should not survive a reboot.
This is the command used:
/sbin/apparmor_parser -r /etc/apparmor.d/firejail-default /etc/apparmor.d/firejail-default
Does running the following command (to remove the profile) change anything?
sudo /sbin/apparmor_parser -R /etc/apparmor.d/firejail-default /etc/apparmor.d/firejail-default
If not, is there any change if you run sudo firecfg --clean
and reboot
without uninstalling firejail?
Aren't there other alternatives ?
Unfortunately, whatever is causing these issues, isn't being logged much if at all.
Other than firecfg loading the apparmor profile, note that firejail itself is only executed when you call it; there is no daemon running in the background or anything.
So it will only be of relevance if you call it directly or if you call something that calls it indirectly.
sudo firecfg
creates symlinks in /usr/local/bin and .desktop files in
~/.local/share/applications.
But as far as I know it does not create them for privileged system binaries (certainly not for binaries related to apparmor or systemd).
Weird Result:
root@HOST:/# sudo /sbin/apparmor_parser -R /etc/apparmor.d/firejail-default /etc/apparmor.d/firejail-default
/sbin/apparmor_parser: Unable to remove "firejail-default". Profile doesn't exist
/sbin/apparmor_parser: Unable to remove "firejail-default". Profile doesn't exist
I cannot reboot right now, it will be tomorrow. I ran the command though:
sudo firecfg --clean
So far, NFS nor USB Disks are working yet.
Might be some of the other sysctl
:disappointed:. There was some associated Kernel+Network Hardening I did, but I think the issues started AFTER I also introduced Firejail.
Weird Result:
root@HOST:/# sudo /sbin/apparmor_parser -R /etc/apparmor.d/firejail-default /etc/apparmor.d/firejail-default /sbin/apparmor_parser: Unable to remove "firejail-default". Profile doesn't exist /sbin/apparmor_parser: Unable to remove "firejail-default". Profile doesn't exist
Where was firejail installed to?
What is the output of which -a firejail
?
How about the following command:
sudo /sbin/apparmor_parser -R /etc/apparmor.d/firejail-default /usr/local/etc/apparmor.d/firejail-default
Yeah maybe I found out the issue for this specific Case ....
In /etc/modprobe.d/hardening-filesystems.conf
I was blacklisting:
install nfs /bin/false
install nfsv3 /bin/false
install nfsv4 /bin/false
Furthermore in /etc/modprobe.d/hardening-other.conf
I was blacklisting:
install usb-storage /bin/false
I still need to rebuild initramfs and reboot to test whether the Issue will be solved though.
I can confirm, removing those entries and rebuilding the initramfs and possibly GRUB Configuration & Rebooting solved the Issue:
update-initramfs -k all -u ; update-grub ; update-initramfs -k all -u ; update-grub ; reboot
I can now mount NFS Mounts and get USB Flashdrives to mount (automounted on Ubuntu using Udisk2 I believe).
So yeah, not firejail
Fault at all. Just another part of the Hardening Process that caused this.
Sorry for the Trouble :disappointed:.
Description
Describe the bug Weird issues started occurring when I enabled
firejail
(and switchedapparmor
toenforcing
mode).I cannot mount an external USB Flashdrive anymore. I believe also external Hard Drives are affected.
Steps to Reproduce
Steps to reproduce the behavior
root@HOST:/# dmesg ... [ 2016.596006] usb 3-6: USB disconnect, device number 9 [ 2016.596810] systemd-journald[2068]: sd-device: Failed to chase symlinks in "/sys/dev/char/189:264". [ 2019.499524] usb 3-6: new high-speed USB device number 10 using xhci_hcd [ 2019.627454] usb 3-6: New USB device found, idVendor=090c, idProduct=1000, bcdDevice=11.00 [ 2019.627469] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 2019.627477] usb 3-6: Product: Flash Drive [ 2019.627484] usb 3-6: Manufacturer: Samsung [ 2019.627489] usb 3-6: SerialNumber: 0372221080004100 ...
root@HOST:/# ls -l /dev/disk/by-id/
!!! not listed !!!
output goes here
output goes here