udev: lock screen on HID connection

This prevents hardware attacks where a USB device disguises as a
keyboard and types malicious commands by locking the screen before
enabling any human interface device once connected.
This commit is contained in:
2020-10-24 19:34:59 -07:00
parent ead87aaab8
commit 62486926f6

View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo 'SUBSYSTEM=="usb", DRIVER=="usbhid", RUN+="/usr/bin/loginctl lock-sessions"' | sudo tee /etc/udev/rules.d/00-usbhid-lock-screen.rules
sudo systemctl reload udev