qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
854 stars 277 forks source link

USB Whitelist/Blacklist #78

Open dsanders11 opened 8 years ago

dsanders11 commented 8 years ago

While the USB functionality in 2.0 is awesome (plan to integrate a digital scale this weekend), it does bring up some security concerns for me. Being able to access any USB device on the system via QZ Tray is worrying if QZ Tray access was to be compromised. Previously the worst that could happen was an attacker could print things, which was not too concerning.

I think a good way to improve the security of this functionality would be to add the ability to whitelist or blacklist devices. Ideally this would be possible in a menu in the QZ Tray UI, but a flag or property would suffice as a first step in that direction.

Each approach has an advantage, so it seems like allowing both would be nice. Blacklisting would be useful if there was only one real device (such as a webcam) you wanted to prevent access to while allowing the flexibility of new devices, where as whitelisting would be the best way to entirely lock down the USB access except for a device or two.

@tresf, thoughts? I unfortunately don't have the manpower to roll up my sleeves and write some code here (as much as I'd like to contribute), but a preliminary look seems to identify src/qz/utils/UsbUtilities.java as the likely place for enforcing the whitelist/blacklist.

tresf commented 8 years ago

Seems completely reasonable to provide a method of blacklisting all USB devices if a manual whitelist in place. We can do whitelisting on a device level or on a vendor level, or both.

The GUI logic will actually be more work than the whitelist file, so we may decide to just offer it to sysadmins for starters.