Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

Non-automounted filesystems are ignored #16

Open
1 of 2 tasks
jaseg opened this issue Oct 8, 2017 · 2 comments
Open
1 of 2 tasks

Non-automounted filesystems are ignored #16

jaseg opened this issue Oct 8, 2017 · 2 comments
Assignees
Labels
bug done requires testing A feature that has been completed, but requires more testing before being pushed to the code base enhancement in progress A feature request or bug that is currently being worked on

Comments

@jaseg
Copy link

jaseg commented Oct 8, 2017

usb-canary only monitors what psutil considers "physical", mounted partitions. This means any attached device that does not automount while usb-canary is active (e.g. while the screen is locked) will not be caught.

  • Feature Request
  • Bug Report

Expected Behavior

Consider the following setup: There is a laptop, with usb-canary configured to monitor while the screen is locked. Automounting is disabled. The user locks the screen, goes away. During her absence, a coworker of her goes near the laptop and finds a USB stick lying on the ground. Thinking the USB stick fell out, she picks it up and plugs it in. Later, the user returns to unlock her laptop. At this point, usb-canary will not have picked up on the additional device since it is not mounted yet. However, now that the laptop is unlocked, she or some automatism might inadvertently mount the filesystem of the usb stick.

Current Behavior

usb-canary does not pick up on the new device absent automounting.

Possible Solution

Monitor physical block devices, or even better, monitor physical USB devices instead of mounted partitions.

Steps to Reproduce (for bugs)

Context

usb-canary at least on first glance looks like a security tool. Thus it should be secure.

Your Environment

I'm no mac expert, but this issue will very likely persist on mac since this "list only mounted filesystems thing" is the documented behavior of psutil's list_partitions.

@errbufferoverfl
Copy link
Owner

Hi @jaseg,

Thanks for submitting an issue, this has been put into the roadmap. Again thanks for taking the time to contribute to USB Canary.

@errbufferoverfl errbufferoverfl self-assigned this Oct 8, 2017
@errbufferoverfl errbufferoverfl added done requires testing A feature that has been completed, but requires more testing before being pushed to the code base regression blocked and removed done requires testing A feature that has been completed, but requires more testing before being pushed to the code base blocked regression labels May 7, 2018
@errbufferoverfl
Copy link
Owner

Replaced psutil and hidapi to libusb1, while it does not have the same support for HID devices, but seems to be working well at listing them on OSX.

Further testing needs to be done on *nix with different devices.

The switch to this library has also modified installation method due to the following error when using sander-daemon or pydaemon:

The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.

OSX will now be "installed" via plist file in LaunchAgents directory and *nix will be installed via what ever their equivalent is. However, further testing is required before that point.

@errbufferoverfl errbufferoverfl added done requires testing A feature that has been completed, but requires more testing before being pushed to the code base in progress A feature request or bug that is currently being worked on labels May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug done requires testing A feature that has been completed, but requires more testing before being pushed to the code base enhancement in progress A feature request or bug that is currently being worked on
Projects
None yet
Development

No branches or pull requests

2 participants