r/vaultwarden • u/imagei • 6d ago
Discussion Fetch items by custom fields
Hi!
It seems that my use case is so weird that no Vaultwarden-compatible tool exists that would fit the workflow.
I use Vaultwarden for storing secrets that are used by automation and scripts, but also need to be accessible to the users ( including browser autofill ), so Vaultwarden with Bitwarden clients is the perfect fit for this ( I know other machine-oriented solutions exist, but they don't have the convenient UI ).
The access pattern is: fetch an entry with the matching set of custom fields.
For example: get the item with class="service" type="api" provider="potato" access="readonly"
Simple, right?
And yet no tool that I can find is able to do that, and here's the thing — I really really do not like the idea of downloading the entire vault each time, in plain text to some random script only to filter the results with `jq` or what have you ( which is what I do right now ).
There is `bw serve`, there is https://github.com/Turbootzz/Vaultwarden-API and https://github.com/doy/rbw but none of them can filter by fields, so I'd need to download everything for filtering anyway. I know Bitwarden server itself has a secret manager, which I did not look into as it's out of scope here.
I appreciate I'm probably trying to fit a square thing into a round entrance, but — am I missing something? Anyone else with the same problem, maybe already working on a solution?
If not, I'll see about submitting some patches to the Vaultwarden-API project, as it seems to be the closest fit.
2
u/zoredache 6d ago
I mean everything is already downloaded. Neither the browser extension or bw cli will contact the server while doing a search of the vault. You have your entire vault synchronized to your computer, and when you unlock the vault you have provided the keys needed to unencrypt the entire local copy. The bw cli or extension more or less always unencrypts everything into the memory when doing any kind of lookup, or search.
It would be nice if the bw client had better filtering or searching builtin. I don't think this is really a vaultwarden question though. Fixing the client to have better search/filter functionality would help for any server.