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:
DuckDuckWhale 2020-10-24 19:34:59 -07:00
parent ead87aaab8
commit 62486926f6
Signed by: DuckDuckWhale
GPG Key ID: E4B9FC170FFD71CE

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