To configure USBGuard daemon to log via Linux Audit (as opposed directly to a file), AuditBackend option in /etc/usbguard/usbguard-daemon.conf needs to be set to LinuxAudit.
Using the Linux Audit logging allows for centralized trace of events.
The usbguard
package can be installed with the following command:
$ apt-get install usbguard
usbguard is a software framework that helps to protect against rogue USB devices by implementing basic whitelisting/blacklisting capabilities based on USB device attributes.
The USBGuard service should be enabled.
The usbguard
service can be enabled with the following command:
$ sudo systemctl enable usbguard.service
The usbguard service must be running in order to enforce the USB device authorization policy for all USB devices.
To allow authorization of Human Interface Devices (keyboard, mouse) by USBGuard daemon, add the line allow with-interface match-all { 03:*:* } to /etc/usbguard/rules.conf.
Without allowing Human Interface Devices, it might not be possible to interact with the system.
To allow authorization of USB devices combining human interface device and hub capabilities by USBGuard daemon, add the line allow with-interface match-all { 03:*:* 09:00:* } to /etc/usbguard/rules.conf.
Without allowing Human Interface Devices, it might not be possible to interact with the system. Without allowing hubs, it might not be possible to use any USB devices on the system.
To allow authorization of USB hub devices by USBGuard daemon, add line allow with-interface match-all { 09:00:* } to /etc/usbguard/rules.conf.
Without allowing hubs, it might not be possible to use any USB devices on the system.
By default USBGuard when enabled prevents access to all USB devices and this lead to inaccessible system if they use USB mouse/keyboard. To prevent this scenario, the initial policy configuration must be generated based on current connected USB devices.
The usbguard must be configured to allow connected USB devices to work properly, avoiding the system to become inaccessible.