How to add current devices to usbguard?

I was able to add all of my devices that I expect to use (docks included) on another machine (Fedora). But, I am unable to do it on my Librem 11. It’s frustrating because I like USBguard, but the issues are making me have to uninstall it every time I want to use my HHKB because the custom PCB is forgotten repeatedly when I select “Accept” from the notificatuon shade. It will be remembered for X minutes, then stop working and ask again. This behavior is not observed with USBGuard disabled.

It sounds like you want to use the generate-policy sub-command.

https://manpages.ubuntu.com/manpages/focal/man1/usbguard.1.html#:~:text=generate-policy%20[OPTIONS]

generate-policy [OPTIONS]
       Generate a rule set (policy) which authorizes the currently connected USB devices.

       Available options:

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/security_guide/sec-using-usbguard

To create the initial rule set, enter the following command as root:

$ usbguard generate-policy > /etc/usbguard/rules.conf
1 Like