Open morfikov opened 5 years ago
It looks like the systemd service causes the problem.
When I commented out the following line:
CapabilityBoundingSet=CAP_CHOWN CAP_FOWNER
It works well now. It's weird...
I had to add two extra CAPs:
CapabilityBoundingSet=CAP_CHOWN CAP_FOWNER CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE
.
Now it works well.
Re-opening this issue as the necessary changes may not have been committed. This was pulled in the Debian package (https://salsa.debian.org/bisco-guest/usbguard/commit/492e3a38ae0bce192fca926e1eedc0e71dbdb5a2), but I'm not sure these are necessary (and potentially dangerous).
Any chance you could share the version of systemd that you were using? Thanks.
See #289 .
# systemd --version
systemd 242 (242)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
+GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN
+PCRE2 default-hierarchy=hybrid
I'm using Debian Sid.
Seeing the same thing in Linux Kernel 5.3.8
(Arch Linux) with Systemd 242
I think there is some more capabilities missing to be able to write on the /etc/usbguard/rules.conf
@cyrinux yes, you must allow writing to your rules.conf file.
A quick fix is to place this file at /etc/systemd/system/usbguard.service.d/override.conf:
[Service]
CapabilityBoundingSet=CAP_DAC_OVERRIDE
ReadWritePaths=-/etc/usbguard/rules.conf
But ideally, this should be fixed upstream.
@alcros wrote:
[Service] CapabilityBoundingSet=CAP_DAC_OVERRIDE ReadWritePaths=-/etc/usbguard/rules.conf
The latter is already in the usbguard.service file: https://github.com/USBGuard/usbguard/blob/master/usbguard.service.in#L24 (fffd3d3fc16ff3426e95350b061a44f0ce02d3c7)
Regarding the necessary CAP_DAC_OVERRIDE
capability, see #289 for more information and an alternative to adding this potentially dangerous capability.
I just upgraded my kernel to the latest stable (5.0.7->5.0.9) and I notticed that
usbguard-applet-qt
has a gray icon. In it's log I can see the following messages:Also I'm using AppArmor profiles for all the usbguard execs, and I had to add to
usr.sbin.usbguard-daemon
andusr.sbin.usbguard-dbus
profiles the following rules:There was similar rule to the last one:
/dev/shm/qb-usbguard-{request,response,event}-[0-9]*-[0-9]*-[0-9]*-{header,data} rw,
and probably the change causes the problem.