pykong / YubiGuard

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

No appindicator and blocking of YK on F26 #11

Open cjustin88 opened 7 years ago

cjustin88 commented 7 years ago

Hi,

I am on Fedora 26 (4.12.8-300.fc26.x86_64) with Wayland and a Yubikey 4 Nano (firmware 4.2.8). When I run YubiGuard.py, I get:

➜  YubiGuard git:(master) ✗ ./YubiGuard.py 
Starting YubiGuard.
ZMQ listener started

but when I press my Yubikey, I still get an OTP. This is of course without running YubiGuard.py -t following running YubiGuard.py.

I think it might have something to do with the fact that my Yubikey doesn't show up on xinput:

➜  YubiGuard git:(master) ✗ xinput --list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer:13                       id=6    [slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:13              id=7    [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ xwayland-keyboard:13                      id=8    [slave  keyboard (3)]

whereas if I ask libinput:

➜  YubiGuard git:(master) ✗ libinput list-devices
...
Device:           Yubico Yubikey 4 OTP+U2F+CCID
Kernel:           /dev/input/event4
Group:            1
Seat:             seat0, default
Capabilities:     keyboard 
Tap-to-click:     n/a
Tap-and-drag:     n/a
Tap drag lock:    n/a
Left-handed:      n/a
Nat.scrolling:    n/a
Middle emulation: n/a
Calibration:      n/a
Scroll methods:   none
Click methods:    none
Disable-w-typing: n/a
Accel profiles:   n/a
Rotation:         n/a

I see my Yubikey. I think xinput has been deprecated in favour of libinput in the switch from X to Wayland. But in your README, you state that you have tested with Fedora 26, so maybe the problem lies elsewhere (Wayland should be running by default under F26, but it may have been automatically disabled because of hardware?)

Is the problem something else or does support for libinput need to be added?

I'm also no getting any app indicator. Some more debug information below:

Thanks, Justin

➜  YubiGuard git:(master) ✗ echo $XDG_SESSION_TYPE        
wayland
➜  YubiGuard git:(master) ✗ rpm -qa | grep libappindicator
libappindicator-gtk3-12.10.0-14.fc26.x86_64
libappindicator-sharp-12.10.0-14.fc26.x86_64
libappindicator-12.10.0-14.fc26.x86_64
➜  YubiGuard git:(master) ✗ pip show pyzmq
Name: pyzmq
Version: 16.0.2
Summary: Python bindings for 0MQ
Home-page: https://pyzmq.readthedocs.org
Author: Brian E. Granger, Min Ragan-Kelley
Author-email: zeromq-dev@lists.zeromq.org
License: LGPL+BSD
Location: /usr/lib64/python2.7/site-packages
Requires: 
pykong commented 7 years ago

@cjustin88 Thanks for letting me know. The readme states Fedora 24 only.

Maybe it is necessary to include some check whether YubiGuard is working correctly.

I am not going to fix the issue on Fedora 26, as I have no experience with this distribution. Still, I am open to quality pull requests in this regard.

I opened an issue in this regard and updated the compatibility list in the README.

pykong commented 7 years ago

Closed.

cjustin88 commented 7 years ago

OK, I am looking into how to disable a device with libinput in a way similar to xinput --set-int-prop that YubiGuard is doing.

pykong commented 7 years ago

That is really good! Just post here if you need any assistance or have any question.