cropi / usbguard-notifier Goto Github PK
View Code? Open in Web Editor NEWA tool for detecting usbguard policy and device presence changes
License: GNU General Public License v2.0
A tool for detecting usbguard policy and device presence changes
License: GNU General Public License v2.0
Hi,
I wanted to ask if/when there will be an initial release. I package usbguard for openSUSE and would like to package a replacement for the usbguard-applet-qt. An official release would make packaging easier for me, as well as reporting bugs.
Thanks!
Hey Cropi,
I'm using the latest usbguard and usbguard-notifier version. I installed all required packages mentioned in the README.md.
I did following steps:
./autogen.sh
./configure --prefix /home/$(id -un)
make
make install SYSTEMD_UNIT_DIR=/home/$(id -un)/.config/systemd/user/
systemctl enable --now --user usbguard-notifier.service
Connection has been established
terminate called after throwing an instance of 'std::runtime_error'
what(): Failed to show notification
[2] 40050 abort sudo ./usbguard-notifier
If I run this using the debug flag. I receive this message
LOG: src/Notifier.cpp::102 [DevicePresenceChanged] Device presence changed signal
Connection has been established
I hope I could resolve this issue. Thanks for your help.
Regards,
William
I just plugged in a thumbdrive, and I got the popup on my desktop, but:
mathias@kirika:~> usbguard-notifier-cli No notifications to show.
Any ideas?
Libnotify interface for creating pop-up notifications
Please rename released tarball:
usbgard-notifier-0.0.1 -> usbguard-notifier-0.0.1
Hello,
I just installed this software on ArchLinux. I used to use the old QT program.
I have installed the program so far that I get a message when I connect a device via USB.
But unfortunately I can't find a way to create rules via GUI.
OS: Arch Linux x86_64
Kernel: 5.4.2-arch1-1
Shell: /bin/zsh 5.7.1
Resolution: 3840x1080 @ 59.97Hz
DE: Cinnamon 4.4.3
WM: Mutter (Muffin)
Terminal: terminology
CPU: Intel i7-8550U (8) @ 4.000GHz [50.0°on]
GPU: Intel UHD Graphics 620
Memory: 2960MiB / 31997MiB (9%)
GPU Driver: i915
I am trying to install usbguard-notifier
on Ubuntu 20.04 and I did the following:
git clone https://github.com/Cropi/usbguard-notifier
cd usbguard-notifier/
./autogen.sh
Then I run:
./configure --prefix /home/$(id -un)
...and get the error:
checking for unistd.h... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for usbguard... no
configure: error: in `/home/matej/usbguard-notifier':
configure: error: libusbguard development files not found
See `config.log' for more details
usbguard
is running (I can see it is active by running sudo service usbguard status
, any other idea what could be wrong?
In config.log file I can see things like this (but I do not know if that is relevant):
...
configure:3544: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3555: $? = 1
configure:3544: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
...
configure:8548: gcc -E conftest.c
conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory
11 | #include <ac_nonexistent.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
...
conftest.c:62:53: warning: integer overflow in expression of type 'int' results in '-2147483648' [-Woverflow]
62 | < (int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 2))];
| ^
conftest.c:61:12: error: storage size of 'test_array' isn't constant
61 | static int test_array [1 - 2 * !((int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 1)
| ^~~~~~~~~~
configure:12179: $? = 1
To be able to install, you need all kind of packages:
Hello.
usbguard
recommends usbguard-notifier
as a replacement for their retired QT applet. Unfortunately however, there seems to be no way to actually allow/block/reject added devices.
Would it be possible, to include some functionality in the GUI, that for any new devices a notification stays open for some configurable amount of time (just as the previous QT applet did) allowing to accept/block/reject the device via some buttons, and if no action is taken in the configured time, it should just leave it as is (e.g. whatever usbguard
decided, typically blocked)?
Also, it should show these for possibly multiple devices attached at the same time, and waiting for a choice. Just consider e.g. when one plugs a laptop to a docking stations and a handful of new USB devices shows up.
That would tremendously increase the usefulness of the tool.
Regards,
Philippe
It would be great to a have a config option that allows to suppress messages about known devices. Right now when connecting the laptop to the dock I get usbguard messages for all the usb devices that get connected. They are all mine and are all allowed. So it would be nice to have an option to reduce the noise a bit.
Add systemd unit file
Create a set of tests
Hello,
A few days ago I have noticed that I can't manage to install this package with makepkg (Arch Linux install helper).
It seems like the signature for the newest release is expired and I am also getting some cxx build errors.
It doesn't seem like the main branch is getting the same build errors. But 0.1.0 definetly does when using the above mentioned install method.
If you can't reproduce or think that this is invalid because I am not using the recommended install method, you are welcome to close this issue.
Add and install usbguard icon somewhere into /usr/share directory.
Add README.md
I have compiled the tool with the following commands (and installed it on my system):
bash autogen.sh
./configure --with-bundled-catch --prefix=/opt/usbguard-notifier --with-usbguard-devel=/opt/usbguard-dev --with-permanent-notifications=/tmp/usbguard-notifier
make
The notifications work just fine, however, when I run usbguard-notifier-cli
it mentions the following error:
Error: file /tmp/usbguard-notifier/jeff doesnt exist.
What's up with that? :)
usbguard allow-device [number]
)After 3., I have 2 notifications:
After 4., I have 3 notifications:
Less notifications, max 1 notification per device. As the previous state is not valid any more, it is not of interest.
Possible ideas include:
Notify.Notification.update()
) instead of creating a new notification.usbguard-1.0.0-4.fc34.x86_64
usbguard-notifier-0.0.6-4.fc34.x86_64
glib2-2.68.2-1.fc34.x86_64
libnotify-0.7.9-4.fc34.x86_64
EDIT:
Note: My USB device seems to have an empty name, which is also being reported as empty by usbguard list-devices
in the name
field.
Create usbguard-notifier-cli:
The 0.1.1 release tag points to 0938f4a and there is an official release on github, but the commit is not part of any branch. Would you mind merging that into main?
(Otherwise git fetch
does not fetch the tag...)
I'm running usbguard-daemon -d -k -c /etc/usbguard/usbguard-daemon.conf
with notifier in the background and when I send a sigterm to usbguard-daemon, notifier crashes.
Nov 12 09:40:37 Axis systemd[1384]: usbguard_notifier.service: Main process exited, code=killed, status=11/SEGV
Nov 12 09:40:37 Axis systemd[1384]: usbguard_notifier.service: Failed with result 'signal'.
Nov 12 09:40:37 Axis systemd-coredump[28466]: Process 28433 (usbguard_notifi) of user 1000 dumped core.
Stack trace of thread 28435:
#0 0x0000000000406c88 n/a (/home/rsroka/sbin/usbguard_notifier)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.