I'd like to build a version of Ubuntu that has absolutely no ability to recognize any USB device inserted. Is this possible?

There's the issue that mouses and keyboards nowadays are connected via usb, so I wonder if it's possible to recognize these but not everything else.

In the end it's a security measure, so different solutions to achieve this goal are also welcome.