pykong / YubiGuard

Python script to prevent accidental triggering of YubiKeys on Linux.
GNU General Public License v3.0
24 stars 8 forks source link
yubikey

YubiGuard

Python script to protect against accidental triggering of YubiKeys on Linux.

Most recent version: 0.9.3

A predecessor called YubiSwitch tried to solve the same problem, but came with major security flaws, was cumbersome to use and lacked several important features.

Advantages over YubiSwitch:

  1. No root privilege required to run!
  2. No unintended output release after reactivation, if you pressed your YubiKey while locked!
  3. Detects YubiKeys automatically, no need to hardcode ids manually.
  4. Can handle multiple YubiKeys concurrently.
  5. Timeout which locks off YubiKey after 5 seconds.
  6. Automatically locking after YubiKey has been triggered.
  7. Panel indicator showing the activation status of YubiKey(s).

Installation & Setup

  1. Download zip archive here: ZIP
  2. Extract files.
  3. Install dependencies.
  4. Run YubiGuard.py.
  5. Bind system key combination to the same file, but with "-t" as command line parameter.
  6. This key combinatin is used to unlock YubiKeys (See: Usage for further instructions.)

Requirements:

sudo pip install pyzmq

Usage:

Usage screen lock mode:

FAQ:

Q: The LED of my YubiKey is still active. Does this mean the script is not working? A: No. LEDs will continue to blink, despite YubiKey output being blocked as intended.

Q: How does YubiGuard activate and deactivate YubiKeys? A: YubiGuard uses the xinput command to identify and control the output of YubiKeys. Namely: xinput list, xinput --enable , xinput --disable and xinput test .

Tested on:

Linux Distributions (all 64-bit):

(Only checked working of xinput command and correct panel indicator display so far.)

Not working on (all 64-bit):

(Those distros are not working as xinput is not installed: "xinput: command not found". One might get YubiGuard to run with additional work though.)

Screen lock mode:

YubiKey models:

Credits:

Changelog:

v 0.2:

v 0.3

v 0.4

v 0.5

v 0.6 (major update)

v 0.7

v 0.8

v 0.9

v 0.9.1

v 0.9.2

v 0.9.3