Bring Your Own Password Manager: Portable BitWarden on a Pi Zero
novamostra.com
novamostra.com
What's the usage flow? Is there browser extension that allows you to interact with it without opening Keepass program?
Maintenance you described is easy, but what about the actual usage and sharing passwords?
I don't share my passwords database. Right now my wife and I do have a very limited number of shared accounts but I set up the same system for her and we simply duplicate the few shared logins we have in our two databases. This could be an issue if we need to share more.
Creating new accounts is easy. Both my windows and iOS Keepass clients open the file directly from cloud storage. They can save changes and reload the database on startup. Once in a while I've had conflicting writes but it's rare, and I stopped getting them when I got better about saving and closing after changes.
Usage flow on PC (I'm sure I could install a browser extension, but haven't bothered yet):
1. oh I need a password. windows+s, type keepass, open keepass, type master password.
2. ctrl+e look for the website I'm on
3. ctrl+b copy username, paste
4. ctrl+c copy password, paste
Usage flow on iOS:
1. oh I need a password. iOS magically knows, gives me options of iCloud keychain or Keepass client. Select Keepass client
2. Sometimes it's not smart enough to detect which password entry to use. In this case, type in the website/app name and select it
3. Usually it's smart enough to fill out the username & password fields automatically
We also use macOS/iOS keychain for convenience, but the TOTP and other notes about the account are stored in Keepass database.
This has worked great for us for a number of years.
Storing new accounts syncs just like everything else.
> Is there browser extension that allows you to interact with it without opening Keepass program?
I sure hope not.
My wife and I have a number of accounts we share a single credential for. There are a surprising number of services we access as parents that don't have the concept of shared ownership of content on the server side.
I'd bet there are other use cases as well. Off the top of my head, Hello Fresh also doesn't allow more than one login to manage the same subscription.
Fedex/UPS only lets one account get detailed tracking numbers for an address, so I need to share my Fedex account. To check and pay my freeway tolls I'm only allowed a single account - so it gets shared. Plenty of people share all sorts of subscriptions, be they to Netflix, the New Yorker, or more. I need to share access to my insurance, to the utility bills, to sporting event tickets, to grocery store and pet food orders. On and on and on.
Also, for many of my accounts today, I use "Sign in with Google" so it's not even possible for me to share a password or credentials unless I share my whole Google account shebang.
For personal use: none for me. Instructions for deriving/obtaining my master password and physical key will be made available in any will or power of attorney documentation I get around to drawing up.
In DayJob there are several, though they are usually only temporary needs, such as:
1. We often get sent password-protected documents by clients, that more than one of us needs to read. It pains me how often I see an attached document on an email containing the password needed to open it… A shared password manager where someone can record the credential and mark who should be able to access it (or better have all credentials encrypted by the public keys of those who should be able to access them rather than just trusting a flag) would be less daftly insecure.
2. Distributing initial credentials for new assets or to new people, where those assets are not integrated with single-sign-on so nothing needs to be distributed anyway.
There are other ways to manage such situations of course, but a password management arrangement with a well-defined way of sharing credentials may encourage behaviour more secure than some of the ad-hoc solutions people regularly use.
Sometimes I write the password in a file in the home directory of a server we both access in ssh. It doesn't happen often, maybe not every year.
A customer has no servers, not a chance with them.
As you say, things can be more complicated for externals. I often don't have write access to much that they can read from, without putting in a request through infrastructure, for obvious separation-of-concerns reasons, because things we host/manage directly for them are well locked down, anything at their end is too, and most of our clients have white-list-only access to other resources.
At work we use hashicorp vault, ansible vault, and cyberark for different things, but I still store my stuff in keepass. For personal use, I use keepass on dropbox, and it's worked incredibly well for almost 15 years now.
There's plenty.
> I sure hope not.
Why? I'm not suggesting to have an extension that has access to your file system. Bitwarden has browser extension that communicates to Bitwarden vault via HTTP and it's easy to autofill passwords or generate new credentials.
For throwaway accounts or demo accounts or any kind of new web service/app accounts, it's easy to memorize username and autogenerate a strong, safe password which are saved to vault.
You have the access to that same vault from a different device (smartphone etc), it makes interacting with passwords and its storage extremely easy and without mistakes.
I have quite a few shared passwords in my "family" vault in Bitwarden. Utility websites (electric, gas, water, internet, etc), streaming services, banking, credit cards, mortgage, car payments, car insurance, Chewey (manage pet food auto ship), probably others.
My solution for the past 14 years has been a simple GPG-encrypted org-mode (text) file. I can get to a password multiple ways from any device. The main way I check one is to open the file in Emacs which prompts for the master password via pinentry. You could also use a keyfile. Usually I just ssh and connect to a tmux session with emacs -nw already running, but I can also decrypt and grep it from the CLI, or clone the private repo its on to do the same locally. I only do anything involving PII or money in a dedicated PureOS VM though, so I generally don't jump through any hoops and it's relatively transparent.
Have you ever taken a look at pass?
Also look at Passage which uses Age encryption.
It would just be a heck of a lot easier to just use KeePass and save the database on a SD card.
Tailscale and wireguard are available for all major devices, including mobile. So, if you do this, your password manager can live anywhere and doesn’t need to be exposed to the main internet at all. You don’t even need SSH/network access to the remote machine, just HTTPS over Wireguard (and local or console access). Everything else can be locked down tight.
I think I'll stick with running my own wireguard thanks.
If you want to keep your data secure by keeping them on you, just use a notebook. Cheaper than this and works without a power chord.
This is a bit of attack surface that all hosted cloud solutions share, and it is one that it has never been easier to eliminate.
Also, adversarial does not refer to just possibly breaking encryption, it also applies to daily continuity. I trust my ability to keep a small encrypted password database safe more than I trust some random companies to get bought or change their business model and suddenly I have to decide between a massive Flag Day or paying for something I did not have to before or having some kind of other unwelcome limitation placed on me.
I like controlling my own destiny, thank you very much.
On the other hand, docker containers on a RPi Zero? What a sad state of affairs we have in 2022.
Sincere question - AFAIK, Raspberry PI OS is a Linux distribution like any other, with dependency/distribution issues like any other. Why would using Docker on it be a sad state of affairs, in contrast to using it on any other distribution?
I am not a fan of this kind of redundancy and opaqueness.
There seem to be some other Docker features used, like healthcheck [0], and MariaDB seems to be installed, too, so it might be worth considering how much additional OS-dependent complexity would the equivalent functionality without using Docker require. At the very least, you need some kind of service manager to run your program on boot, and restart it on error. At that point, Docker may as well be used as a glorified service manager - just slap your static binary in a `FROM scratch` container, and you're done.
> I am not a fan of this kind of redundancy and opaqueness.
Me neither. But I wouldn't blame Docker itself - it's just a tool. If it wasn't for Docker, some other way of circumventing good engineering would be found :-)
[0] https://github.com/dani-garcia/vaultwarden/blob/main/docker/...
That said, I am skeptical of running it on a PiZero. I could see running it on a Pi3 or Pi4 where I can leave it connected to my network and cron backups to a NAS.
The BitWarden documentation itself shows 12 containers running. https://bitwarden.com/help/install-on-premise-linux/
Is there a way to do it without backing up all the os packages?
With docker I can stop the service, then snapshot its data volume, then restart it. And restoring is very easy.
I have no idea how to get that workflow at an os level without a vm manager.
The vaultwarden install instructions assume Docker, for example: https://github.com/dani-garcia/vaultwarden. If you want to install native binaries, you're going to have to git fetch/checkout/pull the latest release tag and run `cargo build --features sqlite --release` yourself. Doable in a cronjob, but it'll probably take a compile to build a system like vaultwarden on a low-power ARM core.
Not to mention that it encourages sloppiness and software bloat. The password manager could be put on a simple MCU device, instead, we have a large non-transparent multi-component installation swept under the rug with Docker. I do not think this is a good thing.
Based on the name, I expected someone to take vaultwarden and make it an αcτµαlly pδrταblε εxεcµταblε that runs on its own without an OS; instead, this is just a quick tutorial for "how to set up vaultwarden".
One thing I would add: a self-signed certificate is not adequate for password transmission. In some ways, it's even worse than transmitting over clear-text http because it provides an illusion of security.
Any actor on your network can man-in-the-middle, provide their own certificate, and you'd be none the wiser.
I'd suggest provisioning LetsEncrypt leaf-node certificate on a node that can respond to HTTP-01 or DNS-01 challenges (don't open your home network to :80 :443 - use a VM in the Cloud to respond to challenges), then transfer the certificate to the Raspberry Pi. https://letsencrypt.org/docs/challenge-types/
The hassle of forwarding the ports for their verification and having to do it so regularly (3 months) is a real pita.
I used to just pay for yearly certs for this reason but prices have gone up so now I'm back to using self signed. I'd love to set up my own PKI but the tool chain is so complex and many OSes like Android allow apps to opt out of user -added root certificates which makes it very hard to deal with.
You never need to expose a webserver to the public internet to use letsencrypt to get a valid SSL certificate, even if IP is in the private RFC range (192.168.x.x, 10.x.x.x, etc etc).
Every single webapp I run internally has a two line automated Caddy/letsencrypt auto configuration, that just works.
To suggest it is way too difficult suggests you haven't tried recently, or are familiar with very old http-based DNS authentication challenges. You do not need to use http-based challenges to use letsencrypt for a long time, although still supported.
> https://caddyserver.com/docs/automatic-https
> https://caddy.community/t/how-to-use-dns-provider-modules-in...
No port forwarding required, ever.
This feature also exists in plain ole letsencypt, their "dns-01" challenge support:
https://letsencrypt.org/docs/challenge-types/#dns-01-challen...
The list of DNS providers who support this is massive now too:
https://community.letsencrypt.org/t/dns-providers-who-easily...
It is now so absurdly easy to do, all my personal projects just have valid SSL by default now, even on my internal LAN. All letsencrypt needs is proof of domain ownership- thanks to DNS TXT records, no one needs to host a website/port forward to accomplish that.
I also don't really like leaking internal network info in my external DNS provider which is why I run my own internal DNSes. And I use a domain for my internal network which does not really exist in the real world, I don't know if letsencrypt can handle this.
I have indeed not tried it recently, the last time I tried it it was about 1 year since they launched. Trying to script all the firewall rules to open the ports for a second was a real PITA.
I'll have a look at this, thanks for the heads-up.
There's still no good solution if you're using a domain that's not valid on the net. LE's lookup has to be able to reach the DNS server for the domain. I think it's something the industry as a whole has failed at - ensuring even LAN devices have good security without doing things like "your home network must have a publicly resolveable domain" or "run your own CA".
I am sympathetic (and capable) of self-hosting, but if my instance and my passwords are compromised, the fallout could be catastrophic for me. Am I better of in the long term by just using the BitWarden server and assuming that they have better security than I do, even though they are the even jucier target?
In theory.
What are the advantages of this setup over carrying a pendrive with am encrypted KeePassXC vault in it?
Building a portable terminal that can emulate a keyboard with a reasonable screen for ease of use seems like a fairly reasonable solution.
> Authorizer is a Password Manager for Android. It emulates an HID keyboard over USB and enters your credentials on your target device. Additionally it supports OTP
One downside is the PoE hats are massive
https://pine64.com/product/rock64-4gb-single-board-computer/
It just seems like a HUGE hassle and risk of data loss compared to the classic KeepassXC + Syncthing burrito.