USBGuard - can help to protect Linux from BadUSB and etc.
Open Source software framework helps to protect your computer against rogue USB devices (a.k.a. BadUSB) by implementing basic whitelisting and blacklisting capabilities based on device attributes:
https://usbguard.github.io