Is it possible to lock the usb-ports if the librem is locked?

Read an interesting article today about ChromeOS today which has a feature now to lock the usb ports to secure from malicious devices like the rubber ducky or poisontap. Is there some kind of “standard” linux equivalent to this feature, which can be used on the librem?