Is it safe to share a .kdbx file on the network? #12575
-
|
I have been reading around, and it looks like the Keeshare feature is broken and cannot really be relied upon. The question is then, is it safe to place a .kdbx file on a network file server and share it with other users for concurrent access? I guess that depends on how KeePassXC is written. Sharing a .kdbx file does not seem out of the question, as I have seen the following options under "Settings > General > File Management": Does KeePassXC attempt to lock the .kdbx file? What happens if the underlying filesystem does not support locking? Does the user at least get a warning? Does it lock the file the whole time? Or only when reading from or writing to it? If it does not lock the file the whole time, when saving changes, does KeePassXC write to a temporary file first and rename the file to its final-name.kdbx afterwards? Renaming a file is the only atomic operation many filesystems support in order to guarantee a consistent write. What happens if you change a password, and another user modifies the shared .kdbx file in the meantime? Are the other user's changes overwritten by the current user? Does the user get a warning before or afterwards? How does KeePassXC realise that a file on a network share has changed? inotify and co. probably do not work over NFS, SSHFS or SMB/CIFS. Does it poll at regular intervals? Is there a window of opportunity for things to go awry then? The reason I created this Issue is because I couldn't find documentation about this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
From my experience with kdbx on sharepoint and Nextcloud. The reason here seams to be the delay
So as soon as a synchronisation backend is involved, it can happen that a conflict occurs, without direct involvement of KeePassXC. The resulting conflict can and needs to be solved by a manual merge, within KeepassXC (Database => Merge from Database...). Considerations:
To be tested:
In total a really interesting topic. Single user an easy option Slow backend: To answer your question: I would consider it safe to store it on any shared location. There might be conflict files, but this can be resolved by merging the files manually through KeePassXC. Testing with the different options File-Management/Autosave/AutoOpen... might reduce the chance of conflicts. |
Beta Was this translation helpful? Give feedback.
-
YMMV, really depends on the concurrency of database writes
No
If the file is inaccessible at time of write the user will get an error and they will have to try again.
File is locked by the OS when we open it for writing. However, that can get interesting depending on how you mounted the network share. This occurs only when a save has been initiated.
There are options, the default is to write to a temporary file right next to the existing one then delete existing and rename temporary. See https://keepassxc.org/docs/KeePassXC_UserGuide#_advanced_save_options
First one to lock the file wins. The other person should see a request to merge the file prior to their subsequent save.
We poll the file every 30 seconds, pulling the first 1 KiB of information, to detect if the file has changed. If so, we request a merge to happen. This also happens prior to saving. |
Beta Was this translation helpful? Give feedback.
YMMV, really depends on the concurrency of database writes
No
If the file is inaccessible at time of write the user will get an error and they will have to try again.
File is locked by the OS when we open it for writing. However, that can get interesting depending on how you mounted the network share. This occurs only w…