Whitelisting USB Keyboard(human interface devices)
Verfasst: 12.12.2018 14:01:20
Hallo 
Ich will alle USB-Geräte blocken, nur HID-Devices (Maus, Tastatur) erlauben. Dazu habe ich folgende Config geschrieben (Udev Regel) und getestet. Es hat bisher funktioniert. Ich bin mir aber nicht ganz sicher, könntet ihr bestätigen das es immer funktioniert?

Ich will alle USB-Geräte blocken, nur HID-Devices (Maus, Tastatur) erlauben. Dazu habe ich folgende Config geschrieben (Udev Regel) und getestet. Es hat bisher funktioniert. Ich bin mir aber nicht ganz sicher, könntet ihr bestätigen das es immer funktioniert?
Code: Alles auswählen
#whitelist keyboards and mouse
# Skeep not USB
SUBSYSTEM!="usb", GOTO="usb_end"
# Skeep remove actions
ACTION=="remove", GOTO="usb_end"
# Linux Foundation
# enable ehci
SUBSYSTEMS=="usb", ACTION=="add", ATTR{product}=="EHCI Host Controller", \
ATTR{bDeviceClass}=="09", ATTR{authorized}="1", GOTO="usb_end"
# enable uhci
SUBSYSTEMS=="usb", ACTION=="add", ATTR{product}=="UHCI Host Controller", \
ATTR{bDeviceClass}=="09", ATTR{authorized}="1", GOTO="usb_end"
# get to intel hubs / enable root hubs
SUBSYSTEMS=="usb", ACTION=="add", ATTR{bInterfaceClass}=="09", ATTR{authorized}="1", GOTO="usb_end"
# enable intel hubs / all hubs
SUBSYSTEMS=="usb", ACTION=="add", ATTR{bDeviceClass}=="09", ATTR{authorized}="1", GOTO="usb_end"
#enable 00 (one before keyboar)
SUBSYSTEMS=="usb", ACTION=="add", ATTR{bDeviceClass}=="00", ATTR{authorized}="1", GOTO="usb_end"
#enable human interface devices
SUBSYSTEMS=="usb", ACTION=="add", ATTR{bInterfaceClass}=="03", ATTR{authorized}="1", GOTO="usb_end"
# Disable all other USB devices
SUBSYSTEMS=="usb", ACTION=="add", ATTR{authorized}="0"
LABEL="usb_end"