CIRCL / Circlean

USB key cleaner
https://www.circl.lu/projects/CIRCLean/
BSD 3-Clause "New" or "Revised" License
451 stars 70 forks source link

Add generic block HID rule to avoid keyboards and non mass-storage devices #34

Open adulau opened 9 years ago

adulau commented 9 years ago

Add generic block HID rule to avoid keyboards and non mass-storage devices

@mdurvaux did an interesting proposal:

SUBSYSTEM=="hidraw", DRIVERS=="usbhid", RUN+="/bin/bash -c 'cd /sys/devices/platform/bcm2708_usb/usb1/1-1 ; for d in $(ls -d 1-1.[2-5]); do if [ $(ls -lR $d | grep -c usbhid) -gt 0 ] ; then echo 0 > $d/authorized ; fi ; done'"

Should we test it to review the various test cases to see if everything still work.