-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Use DBus interface to unlock with hardware key (YubiKey) #8017
Comments
If you have enabled "Remember database keys" we will remember the yubikey used to unlock a database after the first time. Then technically you can use the dbus with username and password and your yubikey will be selected automatically. We do need to introduce a delay to wait for key polling, so this might not work. |
@droidmonkey That's a workaround, however this would require that KeePassXC needs to check again for all keys connected. Currently, if I launch KeePassXC before inserting my YubiKey, it will not use the key (before because it might still run but the database was locked again). So it would require me to restart KeePassXC afterwards so it detects the YubiKey properly. |
Curious, why would you do this? DBus can be intercepted. |
I did not found anything relating to the security of D-Bus and because Secret Services are exposed using D-Bus also other tools use D-Bus to transmit passphrases, I determined it might be secure enough for my case. But only the owner of the session bus can do that? If so, then it may be ignored, because then any application which can intercept D-Bus might also attach a debugger to KeePassXC and retrieve the passphrase or the stored passwords from RAM, am I right? |
Indeed. dbus should have been called dumb bus. No need for a debugger, they make it even easier - dbus-monitor |
Couple points to raise here:
|
You're not wrong, but you're not entirely correct. I wouldn't say anything using a private API can do so without knowing anything about its peers. Just a guy whose had to deal with clients IT departments after security incidents.. keepass is used quite often and unknown to the organization. Some of the changes going into keepass are bizzare but that is better discussed elsewhere. I do agree dbus is not secure thus should never be used for anything like a password manager though. |
closing in favor of #9229 |
Summary
Using the dbus interface, it is possible to unlock a database either using a passphrase only or a passphrase together with a key file. However I'm missing to be able to unlock my database, which is secured by a passphrase and a YubiKey.
Examples
Instead of calling
org.keeepassxc.MainWindow.openDatabase(fileName=…, pw=…)
either callorg.keeepassxc.MainWindow.openDatabase(fileName=…, pw=…, hw=true)
to use the first hardware key available (most of the time, only one should be connected for most of the people) ororg.keeepassxc.MainWindow.openDatabase(fileName=…, pw=…, hw=<ID>)
to select the hardware key by its id (shown by KeePassXC, e.g.YubiKey [<ID>] Challenge Response - Slot 2 - Press
). If the concept if slots is applicable to other keys as well, it could be introduced as another parameter or by concatenating it to the id, e.g.<ID>:<SLOT>
.Context
I want to build a script which would be able to unlock my database nearly automatically by retrieving my database passphrase using my TPM or another secret service (I'm not sure yet how to make this in a secure enough way) when inserting my YubiKey, so I would just need to press the button on my YubiKey to open my database.
The text was updated successfully, but these errors were encountered: