Need help?
<- Back

Comments (77)

  • handplane
    While in theory, this adds at least some small layer of protection, I have doubts that it adds anything meaningful to stop a smart attacker.The problem here is that everything is running as your user, so it's all the same security sphere.You may be thinking, "But Bitwarden requires me to approve each key request". Problem is that if the attacker is already running as your user, which I'm assuming here because to steal your bare keys, they'd already need to be. This means they can also hit the approve button for you.Ok, now you say "But it requires touchID!". Maybe that gets you just a little bit of protection, but...The next idea is to just steal the decrypted key out of RAM. This requires a little bit of effort, because you generally can't attach to a sibling process without root on Linux with default configs. This will only delay things slightly. Attaching to your child is allowed, so all an attacker needs to do is replace your launch shortcut/service for Bitwarden with a thin wrapper that makes the attacker the parent process, and then they can just ptrace it and steal the decrypted key next startup. On Mac, where the ptrace path isn't viable due to disallowing ptrace of signed binaries by default, you could just replicate the Bitwarden GUI as a wrapper and steal the master password at startup.If you really want to protect your keys from attacks like this, you need a real hardware device with OOB signaling.
  • binarin
    I just can't stop preaching SSH certificates everytime similar discussions come up - they have expiration date, the scope can be as granular as possible. Then everything can be encoded: - Daily cert for unprivileged daily work, with 24 expiration - A 10-minute root access to a single serverAnd any combination of things in-between - it all depends only on you imagination (or paranoia:) )The downside is that you can only use it on the infra you control, i.e. GitHub will never trust ssh CA your are using for cert signing. But speaking of git forges, at least self-hosted forgejo supports ssh certs natively.
  • 201984
    Why not just use the regular SSH agent with a password? Still encrypted on disk, so I don't see what the difference is.
  • mmulqueen
    Yubikey or another removable security key is the way to go in my opinion. I've been doing this since I think 2018. There are few ways you can do it, I've always used the GPG key option - you have the GPG key irretrievably on the Yubikey, you set up SSH to talk to gpg-agent and you have to provide a PIN every time you plug the USB back in. When I walk away, the Yubikey goes with me. I've never had a problem getting it working with anything on Linux or any external service. You can either let existing sessions continue or there are ways you can break existing sessions when the key is unplugged. Works on Windows and macOS too, from memory, macOS was almost as easy as Linux and Windows is more fiddly.By having it as a GPG key, you get signing and encryption on top of SSH. You can pair it with gopass as a password vault.I haven't had to make a new key for years, they're very hard-wearing, mine lives on my key ring with my house keys. But I wrote this script to automate setting up a new key, I haven't tested it with recent Yubikeys or a recent version of GPG, but might be a useful starting point: https://github.com/Method-B-Ltd/auto-gpg-card - PRs welcome if it's broken.You still need to be really careful about what can run as your user, but being able to take the key away physically remove a load of risk.
  • rosencrantz
    Someone said "Software should not need a manual"He was right! As soon as a procedure is awkward or even looks like it might not work the first time I will deem it to be wrong.Wrong because I don't want to learn another way and I don't need to learn another way than what is supposed to be the obvious way and if that is not immediately obvious to the user (customer) then I'm not going for it.
  • OptionOfT
    I wish there was a fool-proof way to do this with WSL.If I put in a YubiKey in Windows, I should be able to use it in WSL, and when I SSH into another machine.
  • getfacl
    The best answer for more than a handful of servers and the one arrived at by Google, Netflix, and Uber is to not put the keys on the servers at all and instead sign short lived (30-60 min) versions of them instead.SSH CA is built into the openssh server for a long time and there are multiple opensource management platforms. You can even sign use limitations into the key.
  • tylergetsay
    You can use your machines TPM to sign a key via ssh-tpm-keygen, basically a built in yubikey.
  • InsidiousWombat
    > I was keeping copies of my private keys in my password manager, for safe-keeping, but I was still using the version on disk, loaded into memory with ssh-addBitwarden can act as SSH agent if you want to keep them all in password manager
  • kevsamuel
    Few people know this, but yubikeys are not just fancy passphrase typers, they also have writable memory.You can enroll your ssh keys into a yubikey, and have it securely stored in the hardware until you plug it in to ssh.
  • jon-wood
    I’m currently trying to get to a point where I don’t keep long lived credentials on disk, and as much as possible keep them out of environment variables as well. I don’t want random processes running as my user account to be able to go sniff out my GitHub, AWS, and so on API tokens. Unfortunately It’s a massive pain to get right at the moment. I particularly don’t want long lived credentials where if a process sends them to a server somewhere they’re valid for ages afterwards.SSH keys are pretty much solved, I’m using 1Password’s SSH agent similar to what OP is doing with Bitwarden. It works wonderfully.Various API keys are a pain in the backside. 1Password has some features which kind of maybe help by allowing you to keep credentials in 1Password and then exposing them either as a named pipe that requires auth to read, or via CLI wrappers that inject the credentials at runtime. Both of those still require long lived credentials though.At some point I’ll probably snap and build something analogous to what 1Password are doing but using OAuth or similar to request short lived, scoped, credentials as needed. I assume there’s approximately six hundred things like this which are targeted at agent use but I’d like something that doesn’t require me to run everything in a sandbox.
  • K0IN
    I might be tainted here (I'm building something for this), but maybe short lived ssh certs are the way to go.
  • submain
    I use tokens for my SSH (yubikey, token2). Private key never leaves the hardware. Requires both password and touch to unlock.
  • tristor
    Everyone is updating their threat models to include locally operating LLM agents. Here's a random thought: Don't let LLM agents act on your local system as you? They should be operating in a constrained way with their own account and privileges, rather than acting directly on your behalf with your privileges and access. Treat the agent as if its another user.
  • a3w
    cat ~/.ssh/id_rsa | pbcopyfeels wrong. Unnecessary uses of cat.`pbcopy < ~/.ssh/id_rsa`
  • lxgr
    How is it “on disk” vs “in Bitwarden”? Guess where Bitwarden stores them in the end…
  • usernametaken29
    There was an article here a while ago promoting Secure Enclave. Been using it since. It’s awesome, ticks all your boxes.
  • anon
    undefined
  • tabith
    shameless plughttps://venya.ai/#/securityworking on SIEM now (for beta4, now testing against fluentd, logstash, splunk, rsyslog)
  • iririririr
    biggest takeaway is that everyone just threw this hands up and accepted their own computers are not theirs anymore.is this a view of recent attacks everywhere? is this everyone just handling the keys to remote-chatbots with exec permission? is that just illiteracy?i think that's the best angle of this discussion.(also, extra funny they are worried about keys on disc stolen by local priviledged attakers, but use an ssh agent)
  • mococa
    Mine are on enclave
  • RIMR
    Tailscale SSH solves a lot of this. You use your Tailscale identity to authenticate, you can force SSO w/ MFA for every login, and Tailscale keys can be locked behind a TPM.
  • 1317
    ...upload them to the internet instead?