[0] I also use an SSH key in Bitwarden for lower priority concerns, but my main SSH keys that get automatically installed on remote systems and used for signing commits are stored via FIDO on Yubis.
Also, pretty sure you can’t use the CA for GitHub without enterprise.
You’re not wrong, but for most of us the threat of a simple credential stealer is a million times more likely than being targeted by a dedicated, intelligent hacker.
In the most common compromise scenario, the attack comes along with some widely distributed software and is going for quantity of keys compromised via automated scripts, not precision extraction of one person’s keys through interactive exploration of their computer.
Adjust your security model if you’re in an important position at a big company or some other high value target.
For most of us, though, anything that defeats a common credential stealer is highly valuable.
Even things that will not stand up to a motivated attacker still add value towards reducing the likelihood of a breach, by increasing friction for attackers that are simply grabbing at low-hanging fruit. A setup with a bit more friction is a locked door in a long hallway of unlocked doors. Yeah someone can get through it, but it's not going to be their highest priority. This is the case for almost anything security related: layers of imperfect protection are good in combination.
It is certainly possible to enable authentication methods whereby two processes at the same privilege level cannot grab each other's secrets or tokens. Credential guard is one example, I am sure there are analogous implementations on Linux but I believe namespacing and SELinux attack this from different angles.
The next idea is to just steal the decrypted key out of RAM.
It is also not a given that a userland process can do this.Which is, in fact a relatively common posture.
> 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...
That's a pretty big leap. Systems like Mac OS are designed so that other apps can't easily click that Touch ID button for you. The vast majority of attackers are going to be filtered at this step. Beyond that, anything that "clicks that button for you" could only work when you're logged in - another hurdle - and will probably result in some visible screen activity even if it's "clicked" quickly.
When compared to simple plaintext SSH keys stored on disk, it's a night and day difference.
This is like saying "sure, you could wear a seatbelt, but it's not going to do anything for you if you drive your car off a cliff, so why wear it at all?"
Supply chain risks are big nowadays.
That part of Touch ID would stop them.
I moved all my security keys to keychains and use basic shell scripts to auth on every use. That helps a lot. On Linux this password protection can be different for every key.
I will consider what you wrote about regarding ssh keys, but what do you mean about "real hardware with OOB signaling"? <insert meme about rooted crypto wallet hardware>
see also https://m.xkcd.com/1200/ (2013)
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.