All Projects → pykong → YubiGuard

pykong / YubiGuard

Licence: GPL-3.0 license
Python script to prevent accidental triggering of YubiKeys on Linux.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to YubiGuard

Yubitls
A Go TLS/HTTPS server demo that uses a Yubikey as the backend for it's private key
Stars: ✭ 168 (+630.43%)
Mutual labels:  yubikey
Wincryptsshagent
Using a Yubikey for SSH Authentication on Windows Seamlessly
Stars: ✭ 218 (+847.83%)
Mutual labels:  yubikey
yubikey
PHP library to interface with the Yubikey REST API
Stars: ✭ 68 (+195.65%)
Mutual labels:  yubikey
Piv Go
Keys and certificates for YubiKeys, written in Go
Stars: ✭ 172 (+647.83%)
Mutual labels:  yubikey
Nginx Sso
SSO authentication provider for the auth_request nginx module
Stars: ✭ 195 (+747.83%)
Mutual labels:  yubikey
Lam
LDAP Account Manager
Stars: ✭ 223 (+869.57%)
Mutual labels:  yubikey
Yubikey Manager Qt
Cross-platform application for configuring any YubiKey over all USB interfaces.
Stars: ✭ 137 (+495.65%)
Mutual labels:  yubikey
win-gpg-agent
[DEPRECATED] Windows helpers for GnuPG tools suite
Stars: ✭ 214 (+830.43%)
Mutual labels:  yubikey
Go Ykpiv
Golang interface to manage Yubikeys, including a crypto.Signer & crypto.Decrypter interface
Stars: ✭ 196 (+752.17%)
Mutual labels:  yubikey
ucsf-vpn
Linux command-line client to manage a UCSF VPN connection
Stars: ✭ 30 (+30.43%)
Mutual labels:  yubikey
Yubico Piv Tool
Command line tool for the YubiKey PIV application
Stars: ✭ 172 (+647.83%)
Mutual labels:  yubikey
Yubioath Android
Yubico Authenticator for Android
Stars: ✭ 176 (+665.22%)
Mutual labels:  yubikey
Libfido2
Provides library functionality for FIDO 2.0, including communication with a device over USB.
Stars: ✭ 244 (+960.87%)
Mutual labels:  yubikey
Yubikey Touch Detector
A tool to detect when your YubiKey is waiting for a touch (to send notification or display a visual indicator on the screen)
Stars: ✭ 167 (+626.09%)
Mutual labels:  yubikey
tauri-plugin-authenticator
An official Tauri plugin for using a yubikey in your Tauri App
Stars: ✭ 42 (+82.61%)
Mutual labels:  yubikey
Okta Awscli
Provides Okta authentication for awscli
Stars: ✭ 161 (+600%)
Mutual labels:  yubikey
Python Fido2
Provides library functionality for FIDO 2.0, including communication with a device over USB.
Stars: ✭ 222 (+865.22%)
Mutual labels:  yubikey
yubitell
Silently extract a YubiKey serial number
Stars: ✭ 15 (-34.78%)
Mutual labels:  yubikey
clarion
WebAuthn (U2F) helper for CLI operations (e.g. SSH Log in)
Stars: ✭ 78 (+239.13%)
Mutual labels:  yubikey
mitome.in
Explore OpenPGP and other cryptography as an alternative for seals (mitome-in)
Stars: ✭ 30 (+30.43%)
Mutual labels:  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:

  • xinput (installed on most Linux distributions by default)
  • gir1.2-gtk-3.0
  • gir1.2-appindicator3
  • pyzmq
sudo pip install pyzmq

Usage:

  • YubiGuard locks output from all inserted YubiKeys by default.
  • The locked state is indicated in the panel by the default icon.
  • Simply Triggering via key combination (e.g.: super + y) will unlock YubiKey. (Here is a short explanation on how to create key bindings under Linux Mint: https://www.lifewire.com/how-to-change-the-linux-mint-cinnamon-keyboard-shortcuts-4064754) | Alternatively click the PanelIcon, then click Unlock.
  • In the unlocked state the icon changes to green.
  • After triggering your YubiKey or after timeout, YubiKey will again be locked with the icon reverting back to default.
  • While no YubiKeys are inserted, the panel indicator will be darkened.

Usage screen lock mode:

  • start YubiGuard.py with "-l" as command line flag:
./YubiGuard.py -l
  • removing a YubiKey will now immediately result in screen lock

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.)

  • Xubuntu 15.10 (Wily Werewolf)
  • Xubuntu 16.04 (Xenial Xerus)
  • Elementary OS 0.4
  • Fedora 24
  • Linux Mint 18 (Cinnamon)
  • Manjaro Linux 15.09
  • Ubuntu 16.04

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:

  • Xubuntu 16.04 (Xenial Xerus)

YubiKey models:

  • YubiKey 4 Nano
  • YubiKey NEO
  • YubiKey II

Credits:

  • Yubico company generously provided additional YubiKey models for testing.
  • Stefaan Lippens' asynchronous stdout pipe allowed for an non-blocking way to monitor YubiKey output: stefaanlippens.net/python-asynchronous-subprocess-pipe-reading
  • mozfreddyb provided the idea to add the unlock button in version 0.9.3 and also helped clean up parts of the code.

Changelog:

v 0.2:

  • renamed to YubiLock, as this name better portrays the function
  • instead of text notificaions, now descriptive icons are displayed
  • in case of changing xinput ids (e.g. devices are switched) old ids will be automatically activated

v 0.3

  • beautified icons
  • set working dir, to always allow relative import of icons
  • now preventing overtriggering when hitting key combinations in short succession

v 0.4

  • added exit handler, which will reactivate YubiKeys after script has exited

v 0.5

  • code rectified
  • introduced missing thread locking

v 0.6 (major update)

  • added a Panel Indicator (replacing notification of LOCK/UNLOCK)
  • major rectification of code
  • switched from thread based concurrency to process based for superb responsiveness
  • added key event listener, replacing triggering via external script over zmq
  • added settings.ini to grant user to customize time out and triggering key combination
  • eliminated minor bugs which led to laggy or unreliable unlocking

v 0.7

  • switched back from KeyEventListener to ZmqListener, as the former interfered with YubiKey release (see issue)

v 0.8

  • changed name back to YubiGuard, as two other GitHub projects are already titled YubiLock
  • updated icons
  • minor rectifivation of code

v 0.9

  • YubiGuard.py itself is now used for triggering, when run with command line paramater: '-t'. (yg_trigger.sh removed)
  • fixed minor bug preventing exit when no keys were inserted

v 0.9.1

  • introduced screen lock mode which will automatically lock your screen when removing a YubiKey (security feature)

v 0.9.2

  • reduced internal cycle time to more reasonable settings to minimize CPU load

v 0.9.3

  • minor code cleanup
  • added unlock button to Menu (kudos to mozfreddyb for initial idea and co-development)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].