-
Notifications
You must be signed in to change notification settings - Fork 36
Multi-device support #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note: I haven't updated any of the debian packaging yet. libsodium and libevdev are now dependencies. What's the preferred build chain on Whonix? I was going to just stick a "$(shell pkg-config --cflags --libs libevdev)" into the Makefile, but this probably isn't very portable, and pkg-config doesn't come installed on Whonix by default anyway. Any suggestions? |
Build dependencies or runtime dependencies? For build dependencies: Change
to:
For runtime dependencies: Change from:
to:
Would that work? Makefile I don't know yet. |
Thanks, I added the runtime and build dependencies. Might be easiest to add pkg-config as well unless there's another command to get the cflags for a particular package on Whonix. The other option would be to use something like autoconf or cmake, but those seem overkill for this application. |
Not a problem at all for |
Could the events coming from mice be distinguished and treated separately from keyboard ones more easily? perhaps by separating them according to Linux device nomenclature or some other method? - That way the best threshold is maintained for the separate device types while not impacting performance or protection. I found some code that interacts with udev to tell them apart: https://www.mattfischer.com/blog/archives/182 https://naiveprogrammer.blogspot.com/2011/01/using-udev-to-catch-keyboard-and-mouse.html |
Yes, absolutely. I've already stuck some functions in there to determine whether a device is a keyboard or mouse, and maintaining a separate threshold for each device class is certainly possible. The only potential issue is if both devices are being used simultaneously, events across the devices could become permuted but within each device they would maintain order. For example, physical action sequence:
could become:
if the key down and up events are delayed beyond the time the mouse button down and up events are released.
Awesome, thanks for the links |
If libsodium cannot be initialized it is not safe to use. |
@qua3k fixed, thanks a lot for catching that |
@adrelanos, running kloak directly as root seems to work fine, but building the deb package and running as a service fails at creating the new ui devices at this line: I suspect the apparmor profile needs to be changed. I tried changing |
Does that help? Related: |
Any help here would be appreciated :) admittedly I don't have many cycles to work on it currently. Pretty sure it was an issue with AppArmor and I have something not configured correctly. |
We must not allow security hardening to stop the development of this project.
|
From now, for any AppArmor issues I suggest:
|
finally determined the root cause here, there were a few missing seccomp filters. Added them back to the service file and it works now. Do you want to test one more time on Whonix to make sure everything works properly and then I think we're ready to merge? |
This branch is ready to merge. And it's just a merge into the dev branch. So should be merged either way as soon as possible. But it won't work on its own due to seccomp and apparmor issues. These however are resolved in my PR #49 which I updated just now. Therefore I recommend to merge this one first then then merge #49 after that. In case of the C level changes in #49 deemed not ready, I recommend either:
|
Forgot to mention, I tested this + #49 in Whonix today and it was working fine. |
changes in #49 all look good, thanks! |
Merge pull request vmonaco#38 from vmonaco/dev
This PR adds support for obfuscating multiple devices simultaneously. This addresses #7 and #37.
Changes include:
I lowered the max delay to 20ms because obfuscating a pointer device by even a small amount introduces a noticeable lag. Users are much more perceptive of pointing lag compared keyboard lag. This includes devices that emit REL_X and REL_Y events (most computer mice) or ABS_X and ABS_Y events (typically includes virtual machines).
Events should be emitted in the order they were received (FIFO), otherwise there could be unwanted effects if events become permuted, e.g., performing a drag-and-drop requires a particular sequence of motion and click events. It might be possible to maintain a separate max delay for each physical device so long as events are not permuted.
Another option is to adjust the max delay depending on whether a pointing device is currently being used. A heuristic could look something like "if number of motion events exceeds 5 in the past 1 second, then set the max delay to 20ms, otherwise set the max delay to 100ms".