Rendered at 13:27:56 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
handplane 3 days ago [-]
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.
macNchz 3 days ago [-]
A lot of your caveats here assume some level of sophisticated attacker that has persistent access to the machine and is motivated to investigate when something doesn't work, rather than the extremely common case of a smash-and-grab credential stealer script that quickly scans through the system and tries to grab anything it can before being removed.
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.
handplane 3 days ago [-]
I agree 100% here, and I had this argument running through my head as I wrote this comment. The problem is I think these assumptions only hold up for a very short time in today's world. Even unsophisticated attackers will have access to the sorts of methods involved here soon, if they don't already. I'm not up to date on the latest malware practices, but I would be surprised if they weren't already targeting popular credential managers like Bitwarden.
timcobb 3 days ago [-]
What is the intersection of unsophisticated attacker and enabling tools? That is, what is today's script kiddie? Is there a community around abliterated models that people run to h4ck?
handplane 3 days ago [-]
While I have no direct knowledge here, surely there must be. It takes approximately 20 min or less to set up a very capable ablated model on a local consumer-gaming-class GPU. It's not frontier levels right now, but it's still very capable, and with the pace things are going, current frontier power will probably be available in no more than 1-2 years locally.
esseph 3 days ago [-]
This answers some of those questions both directly, and indirectly...
The article presumes that your attacker is more motivated than a simple smash-and-grab credential stealer.
If they are motivated then this advice doesn't really buy you much. If they aren't motivated then the advice is moot to begin with. Passphrase-protected keys on disk are perfectly adequate for defending against simple credential stealers.
macNchz 3 days ago [-]
My understanding is that stealers are increasingly incorporating keyring integrations to pull passphrases along with the keys themselves, where possible...I think MacOS has some good segmentation for which apps can access what now, but I know GNOME Keyring does not, and I think Windows is similar. There are also stealers doing phishing that looks like a system prompt: https://www.jamf.com/blog/ghostclaw-ghostloader-malware-gith...
nextaccountic 9 hours ago [-]
LLM agents can get quite sophisticated though
barbariangrunge 2 days ago [-]
Sophisticated attacker might mean a cron job that queries a remote ai for instructions. A teenager could get that working as long as their ai provider didnt block the actions
macNchz 21 hours ago [-]
Then they have to make some real investment of their own in attacking you specifically (tokens/hardware/electricity), and you buy time for their malware to be detected. A teenager could do that, but what we see in the real world right now is lots of credentials being stolen in simple drive-by attacks that take whatever they can find. Why not protect yourself against that with some small and easy changes, even if it doesn't protect against some hypothetical teenager running an AI hackbot?
bashkiddie 2 days ago [-]
> sophisticated attacker
Is this argument "if I move the keys from $HOME/.ssh to $HOME/ssh, the script kiddies may not have guessed and therefore I am secure"
?
macNchz 21 hours ago [-]
Not claiming anything suddenly makes you "secure," so much as "less likely to get popped." Renaming your ssh directory is not a good example, but other relatively low-effort things like this post discusses that move you out of the path of the lowest-common-denominator script kiddie can have a meaningful impact on your risk, since the average person is only being targeted by script kiddies and not more motivated attackers.
D13Fd 3 days ago [-]
It's defense-in-depth. Each hurdle you make an attacker jump over can filter some types of attackers. Yes, some might still get through, but that doesn't make it valueless.
> 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?"
bigbuppo 3 days ago [-]
Besides, we know the best place to attack all this is the cloud-hosted MFA solution that can bypass all this authentication nonsense.
Aurornis 3 days ago [-]
> 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.
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.
breakwaterlabs 3 days ago [-]
Just to note, it is not a given that "running as same user" implies "has control over all other user processes". Wayland for instance (famously) blocks that kind of attack.
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.
handplane 3 days ago [-]
All of this is true, but would you notice if a malware swapped in a shim into the place where your Bitwarden startup is (user systemd, WM startup, etc), and all that shim did was spawn Bitwarden as a child process? You can generally ptrace a child process.
breakwaterlabs 3 days ago [-]
This is a strong argument for doing software installations using superuser privileges and denying exec from user-writable locations.
Which is, in fact a relatively common posture.
handplane 2 days ago [-]
Doesn't that seem problematic on a development system? This would mean you need superuser just to compile and run a program you're working on.
breakwaterlabs 2 days ago [-]
Devs are already some of the more risky users, given their proclivity to download and execute a mountain of unvetted dependencies.
There are a lot of ways of tackling this but the point is dev system security should not resemble the standard user posture.
imtringued 2 days ago [-]
You are kind of right, but also kind of missing the point.
We have reached a point where developing on your host OS has become irresponsible. Running development inside a container or VM is now mandatory.
stryan 3 days ago [-]
I'm all aboard the Yubikey train[0] for securing SSH keys, but I'd imagine most SSH keys aren't being exfiltrated by smart attackers putting in the work to steal decrypted keys from RAM. Most SSH keys are being exfiltrated by scripts being run via curl | bash (or agents...) that quickly gather up every potentially useful user file they can find and upload it to a remote endpoint somewhere.
[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.
lokar 3 days ago [-]
You could also setup the yubikey as a CA to sign short lived ssh keys.
what 3 days ago [-]
What benefit does this provide over just having the ssh key on the yubikey?
Also, pretty sure you can’t use the CA for GitHub without enterprise.
lokar 3 days ago [-]
More niche situations where you can't use the agent. You need to use it from somewhere you can't forward the agent, or you need to make too many calls (eg ssh to 10,000 machines).
medina 3 days ago [-]
The key can be ephemeral.
barbariangrunge 2 days ago [-]
I like the intention behind his strategy but it seems limited. Having special keys or physical backups on higher level admin accounts, maybe in secure vaults or bank safes is another approach for at least undo some of the damage an incident caused. But anything getting into your dev machine is able to do some crazy damage regardless
Reminds me of that nodejs tech talk by the founder who wanted to do a new language or framework that restricted packages more securely so a bad one in node modules cant do as much harm
keyle 3 days ago [-]
Most people getting their credential stolen is purely through env or .config. They have their keys either as env variables for any shell sessions of theirs to read or just grepping through .config does the trick.
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>
ozim 3 days ago [-]
Tell that to software devs that were hit by Sha1-Hulud and other stealers. They were taking all .ssh when you did ‘npm install’ and you might not knew what happened and they were now able to access all your boxes.
Supply chain risks are big nowadays.
That part of Touch ID would stop them.
skydhash 3 days ago [-]
Are the passphrase encrypted keys that easy to defeat? And maybe that depends on your CI strategy, but why not have multiple users/boxes with different keys?
Security postures are not binary. There’s a wide range of techniques to defeat some likely risks.
enedil 2 days ago [-]
> can't attach to a sibling process without root on Linux with default configs
I think Fedora permits it. Ubuntu blocks. No idea what are the defaults elsewhere, but it is not universal.
anthk 2 days ago [-]
At sysctl.conf:
kernel.yama.ptrace_scope=2
AceJohnny2 3 days ago [-]
> The problem here is that everything is running as your user, so it's all the same security sphere.
What about storing it in Secure Enclave? Is this not what 1password etc do?
tylergetsay 3 days ago [-]
This is what the TPM was made for
mmulqueen 3 days ago [-]
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.
zikduruqe 3 days ago [-]
You can use a GPG authentication sub-key without a hardware key.
jdmoreira 2 days ago [-]
[dead]
csomar 2 days ago [-]
Yubikey has to be the most impractical solution out there and I have no idea how people work with it. No one can access your system if you can't access it yourself I guess?
ycombinatrix 2 days ago [-]
Why isn't it practical? It's phishing proof, can't be stolen, and easier than remembering passwords.
OroPla 2 days ago [-]
With all that hassle why not just skip this song and dance entirely. Entering a username and password is less trouble at this point, isn't it? The long password can live on your yubikey, then you only have to touch it once instead of typing it out. You can have a short thing you type before or after to have different passwords across services.
mmulqueen 2 days ago [-]
The difference is scope/persistence. If someone steals your really long password, they have your password to use at their leisure as many times as they want. At worst, if I plug my Yubikey into a compromised machine, the attacker can only use my GPG key while it's plugged in and unlocked - it can't steal the key itself, nor does using the key once grant it the ability to keep using it. To use my key, an attacker needs control of the machine, my Yubikey to be physically connected to that machine and my PIN to have been typed in correctly within 3 attempts. I can unplug it when I'm not using it and it blinks whenever it's asked to do anything even once unlocked.
There's very little hassle involved anyway. You set up the hardware key once and it lasts years and you have to configure SSH and GPG on any machines that you use as a terminal (not any of the machines you connect to). It is easily scripted and deployed en masse.
OroPla 2 days ago [-]
I guess if you remove your yubikey after you are done that is true. I always have mine connected, though. And if that machine is compromised it's game over anyway.
I'm talking about the hassle of entering your PIN everytime you need to use it. The idea of ssh keys is that you don't have to enter your password anymore, but if you just have to enter a different password everytime then I don't really see the point. If you still need to enter a PIN it also prevents automation, like having a backup run during the night to an offsite location via ssh.
mmulqueen 2 days ago [-]
Leaving it plugged does weaken the security it provides. I probably enter my PIN a few times per day depending on how often I'm away from my desk. I don't enter it on every use, just the first time on each plug. I think that's the default rather than something I've configured. It's no more hassle than unlocking my screen.
For machine to machine like a backup process, it runs with its own key, with its own system user on the source and destination machine. That key has to sit on disk (or at least that's the risk that I accept), but that's a completely different risk to a key living in a real user's home directory. It can be locked down on both sides to mitigate further. Read only pull backups over SSH are possible this way for example.
You can use hardware tokens without interaction of course, but I agree in this particular case, it doesn't buy you much extra protection.
201984 3 days ago [-]
Why not just use the regular SSH agent with a password? Still encrypted on disk, so I don't see what the difference is.
praash 3 days ago [-]
Just to clarify your point for others; SSH private key files can already be encrypted with a passphrase. SSH will then prompt for the passphrase whenever the key is used. The standard SSH agent can optionally keep keys unlocked for a time period.
There's no need to reveal your unencrypted keys to Bitwarden or any other cloud service.
eqvinox 3 days ago [-]
> The standard SSH agent can optionally keep keys unlocked for a time period.
The default for keys added to ssh-agent without further config/options is to keep them unlocked indefinitely (as long as the ssh-agent process keeps running anyway).
abound 3 days ago [-]
Yeah I'm really curious why using a key passphrase is not an option for the author. Seems like it has everything they're looking for:
- Good ergonomics
- No private key sitting unencrypted on disk
Hell, isn't it even the default when using `ssh-keygen`? As in, it prompts you for a passphrase if you don't explicitly tell it not to?
SoftTalker 3 days ago [-]
> it prompts you for a passphrase
Yes but you can just hit <enter>
handplane 3 days ago [-]
There's real ergonomic gain here if you ever forward your ssh agent to another machine. With default SSH, you need to use the clunky askpass setup to be able to approve each access of your keys from the remote machine, but with Bitwarden, you can easily attach it to TouchID or similar.
eqvinox 3 days ago [-]
ssh-add -c + ssh-askpass might be clunky, but - hitting TouchID is notably worse security wise since you'll get into a pattern of hitting it relatively often, making it much easier to smuggle an illegitimate request into that, no? It diminishes the value of TouchID.
handplane 3 days ago [-]
Absolutely, but what's the better option? If you're forwarding to a remote and that remote isn't fully trusted with your key, you need a manual approval step of some sort whether that's askpass, Bitwarden, or a yubikey.
eqvinox 3 days ago [-]
> Absolutely, but what's the better option? If you're forwarding to a remote and that remote isn't fully trusted with your key
Honestly: don't use agent forwarding at all, use ProxyJump / -J. Agent forwarding is really only for systems you do in fact fully trust.
mingus88 3 days ago [-]
If your threat model includes rogue LLM agents on your system then your passphrase can be compromised by a logger or just getting it from memory
I use yubikey Fido keys so I need to touch the key to unlock it
It’s quite wild to be working and see my yubikey flash waiting for input because I have an agent running a task and it’s trying things like GitHub auth without asking me. Not hard to imagine it taking the next step and just grabbing tokens it needs to do whatever it needs to complete its task
cozzyd 3 days ago [-]
why would you run an agent as your user, is probably the real question.
mingus88 3 days ago [-]
If you want the agent to look at logs, create PRs, run tests that need network access (grade, Basel, etc) then you are going to have to give it enough access that there is probably very little functional difference from you running those commands yourself
I can tell you at my work, a large enterprise, people have pretty much just given Claude auto-mode free rein to do everything. Incidents in production are honestly people just sharing the output of their Claude’s investigations colored by whatever skills, memory and tokens available to it
cozzyd 3 days ago [-]
Why does it need to create PR's? It can work in a local branch that you pull from your user and push to whatever upstream you want. Sure, it's slightly slower, but you're not handing Anthropic keys to your kingdom.
Would you give a contractor developer your private key, just because it's somewhat lower friction?
blooalien 3 days ago [-]
> If you want the agent to look at logs, create PRs, run tests that need network access (grade, Basel, etc) then you are going to have to give it enough access that there is probably very little functional difference from you running those commands yourself
The difference is that one situation is logged in the logs as you doing a thing, and the other is logged as the agent doing the thing. That's why you should really run your agents as their own separate user account and give that account whatever (minimal required) permissions it needs to do the job. For auditability purposes when tracing down a problem (to implement a solution, or to lay blame), you probably want to know when the "bot" screwed up so that it can be fixed (and so you don't have to take the blame for something you had absolutely no control over). The problem with that whole plan is this; I double-dog dare you to try to get the "bosses" to implement anything that improves security and auditability if it's going to cost even just ten seconds of extra time, or ten cents of extra money. Ain't gonna happen.
cozzyd 3 days ago [-]
plus the bosses are sure as hell running an AI assistant with full permisisons to access all their spreadsheets, or whatever.
blooalien 3 days ago [-]
> plus the bosses are sure as hell running an AI assistant with full permisisons to access all their spreadsheets, or whatever.
I 100% guarantee that at least some (far too many more than should be) absolutely are doing exactly this...
subscribed 3 days ago [-]
My model(s) run inside the sandbox with only CWD, a subset of /bin and a handful of files from /etc and ~/
And it couldn't even do anything on github because the only token it can use (which is in the config file outside of its reach) can only do a very limited number of things on the repo.
I feel like a lot can be done without relying on the mechanism you use.
bigstrat2003 2 days ago [-]
> If your threat model includes rogue LLM agents on your system
If you're running an LLM with access to your system, you've already thrown security and system stability out the window. That is an extremely foolish thing to do.
lxgr 3 days ago [-]
And you’re 100% sure you’d do a diligent investigation every single time you have to tap your Yubikey twice for unexplainable reasons?
If you grant an LLM agent full system access, it’ll have full system access.
ethersteeds 3 days ago [-]
I think the answer is more plainly and reasonably given in the article TFA cites as inspiration, "I deleted all my SSH keys":
> First – Isn’t using a passphrase enough? Probably. I don’t intend to imply that this post is the only way that anyone should be doing SSH keys. [...] So yes, the ’traditional’ method is probably fine for most threat models.
Typing a reasonably strong SSH key passphrase many times a day is deeply annoying, and the alternative to that is running ssh-add once a session and then anything else running as your user being able to use it with impunity.
Agents like Bitwarden and 1Password are more granular in their authorisation, in 1Password’s case I tap the fingerprint reader on my laptop when a process in a specific terminal first requests SSH key access to authorise that, after which it can use it as much as it likes until the session times out. Doing so however doesn’t mean that some other process spawned by some malware can also use it, that’s going to pop a prompt up again.
AtlasBarfed 2 days ago [-]
Because "enterprisey"
zelsisapp 3 days ago [-]
[flagged]
tristor 3 days ago [-]
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.
Majromax 3 days ago [-]
> 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.
That's effective when possible, but it's not quite the correct level of permission. Separation of users usually involves disjoint working spaces/sets, and that defeats many typical 'assistant' roles. For example, "look through my e-mail for the past month and remind me if anybody needs something from me" is a very useful task for an assistant (LLM or human), but it necessarily involves access to one's own information -- even on a read-only basis.
IMO we're missing a robust task-level permission system, and this is difficult because a 'task' does not have a 1:1 mapping to a path, user, or application.
InsidiousWombat 3 days ago [-]
Well, we're missing permission levels full stop.
I'd love e-mail provider that provides api-key-like IMAP creds I can just generate and hand out to automation, with not only read/write scope but also per-path one.
skydhash 3 days ago [-]
For the email example, it’s as easy as syncing to maildir and set the group of the files to something the agent cann access.
There’s plenty of way to share specific information across boundaries and some are quite fairly simple to implement. No need to create another complex project for each task.
tristor 3 days ago [-]
Right, but I don't need an LLM to do something as basic as read my email... in fact, having an LLM read my email actually makes email less valuable. The "assistant role" is of no actual value or usefulness to most people. On the other hand, LLM assisted coding can be highly useful and does not need to access anything that's uniquely tied to my identity/account/privileges.
RALaBarge 3 days ago [-]
I always scoff when I see people zoom into HN and say hey check out what I am working on, but I agree with you and I made a 2 computer system -- one that is the core with everything on it and another that is a sandbox. They are both their own physical machines and the sandbox is not attached to a network at all, just directly to the core machine which allows you to modify firewall rules at egress
It's a nice thought and probably the right way to be thinking about things. I take the view it's where we'll end up eventually.
The tooling is all DIY however and most people aren't used to operating multi-user environments, nor do they have filesystem permissions set up correctly, nor do they have a good way of handling secrets management, development environment credentials, etc etc etc.
Essentially, I feel like there's a lot of hand waving going on. Are you operating in this style of environment already? Are you using Claude Code or similar operating as another user on your local machine?
tristor 3 days ago [-]
A modern Mac is already a multi-user environment. Any Linux device is already a multi-user environment. Is there some particular reason why you can't set up a user account specifically for using coding agents? That's effectively what I've done on my system. It's not as if I'm using the computer for other tasks when I'm running coding agents as they are monopolizing my computer (with local LLMs) anyway, so clearly separating these tasks into a dedicated user account with appropriate permissions is not a huge barrier and significantly improves your security posture against various issues.
theodosiskats 2 days ago [-]
[flagged]
heartbreak 3 days ago [-]
I would assume that almost everyone is running agents on their machines without user separation or any other protection. Maybe some folks are using the Swiss cheese built-in sandboxing.
I run mine on an isolated VM with an unprivileged user. It's a hassle, but I still get plenty of work done with these agents. They can't read my email, but I think I'm okay with that.
binarin 3 days ago [-]
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 server
And 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.
SoftTalker 3 days ago [-]
The security you understand and actually use normally wins. In my experience very few people really even understand SSH keys, never mind certificates.
OroPla 2 days ago [-]
Don't you think that running an entire certificate infrastructure is a bit overkill for private use.. or where do you get your certificates from?
binarin 1 days ago [-]
Yubikey's are my SSH cert infrastructure for private use. Every yubikey I own is in trusted_user_ca_keys on my every server. The only moving part in the servers is authorized_principals - but these are just plain tags. Currently I use "machine--user" as principal, which allows me to be as granular as I want. (And I can also use Yubikey SSH key directly in breaking-the-glass situations).
K0IN 2 days ago [-]
It does not need to be complex, we are building the ca for the 99% out there, just hook up your identity provider, and configure who can access what, use certs.
See: flotte.sh
rosencrantz 3 days ago [-]
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.
chuckadams 3 days ago [-]
Excessively complex security also has exploits lurking in all the moving parts. Sometimes by confusing the user, sometimes because the user weakens the system themselves just to make it usable for them.
getfacl 3 days ago [-]
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.
Bender 3 days ago [-]
I keep my keys on disk. The servers require they come from my static IP among other things and I would never run an agent on my machine for many reasons beyond ssh keys [1]. AI agents need to run on their own isolated hardware and that hardware must not have anything one would not want an LLM to have unfettered access to. Even then the OS must be configured to log everything the agent does so there is a smoking gun when things inevitably go sideways. Logging and auditing of everything gives the incident response and legal teams what they need. This logging must be tamper proof no different than a payment card environment. Restricting what resides on that machine also makes it much easier to answer questions from corporate security, legal and other teams.
AI companies know this is true. All of their sandboxes must traverse a SSL Bump proxy that decrypts and logs everything the sandbox does. I had AI build a web interface that lets the AI see for itself that it is being observed.
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.
UltraSane 3 days ago [-]
I like AWS Credential Manager and using a IAM API key that is IP restricted and encrypted using the OS credential manager.
K0IN 3 days ago [-]
I might be tainted here (I'm building something for this), but maybe short lived ssh certs are the way to go.
binarin 3 days ago [-]
Exactly! I just use my yubikeys as ssh CAs for my servers.
But one interesting centralized implementation I saw was about having a separate ssh server which you connected to with a forwarded ssh agent, and after doing 2FA dance it injected the freshly signed temp cert into your forwarded agent.
Woodi 1 days ago [-]
At this point we want Kerberos tickets reinvented an implemented without DES inside...
matltc 3 days ago [-]
I went down this rabbit hole after mini shai hulud. It was painful, but I learned a lot about ssh and gpg. It was a lot of work but gave me peace of mind and was empowering. I felt a bit paranoid afterward though and questioned whether it was worthwhile given my low profile/unimportance.
That said, I don't understand how a dev like bigballs from DOGE managed to push an exfil tool up to a public GitHub repo. Even private repos leak info; wrote this tool to check up on friends and myself and was surprised to see private repo info pop up:
#!/bin/sh
# gets recent GitHub activity for user.
user="${1:-your-username-here}"
outfile="/tmp/hist-for.log"
gh api --paginate "/users/$user/events" --jq '.[] | "\(.created_at) | \(.type) in \(.repo.name)"' | tee "$outfile"
echo "History for $user saved to $outfile."
exit 0
pshc 2 days ago [-]
It’s definitely way painful to do this stuff, I’m on the struggle bus with my own Yubikey-based setup. We need to smooth out the dev experience.
submain 3 days ago [-]
I use tokens for my SSH (yubikey, token2). Private key never leaves the hardware. Requires both password and touch to unlock.
rustyhancock 2 days ago [-]
Trezor has a nice feature where you can deterministically derive ssh, PGP and age keys from your bip39 seed. Fido/u2f keys are also deterministic and recoverable.
Useful as a recoverable hardware wallet probably not your daily driver but a long term/offline master.
It has the added benefit of having a screen so depending on what's needed you can see what key is accessed or what's being signed.
I’ve switched to yubikeys for humans and timed SSH certificates for deployment operations. Pretty happy with the setup
tylergetsay 3 days ago [-]
You can use your machines TPM to sign a key via ssh-tpm-keygen, basically a built in yubikey.
InsidiousWombat 3 days ago [-]
> 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-add
Bitwarden can act as SSH agent if you want to keep them all in password manager
oarmstrong 3 days ago [-]
That’s exactly what the article describes?
evanjrowley 3 days ago [-]
You can temporarily put the decrypted keys into ephemeral storage at `/dev/shm`. Regardless of ephemeral or persistent storage, use the `shred` command to delete them when finished.
jmclnx 2 days ago [-]
You trust bitwaeden but not your OS you admin yourself ?
With diak encryption I think keeping the default is fine.
Of course when creating the keys you can assign a paraphrase.
lxgr 3 days ago [-]
How is it “on disk” vs “in Bitwarden”? Guess where Bitwarden stores them in the end…
jmull 3 days ago [-]
I think they mean unencrypted on disk vs. encrypted in bitwarden.
eqvinox 3 days ago [-]
Well, if you don't put a passphrase on your SSH keys…
kevsamuel 3 days ago [-]
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.
InsidiousWombat 3 days ago [-]
and you should never do that
If you want secure the key, generate one on YK directly and use it. The entire point of hardware key storage is for key itself to never touch anything else
pshc 2 days ago [-]
I think that’s what OP meant to say. I don’t think yubikeys even provide the option to “upload” a private key.
vanchor3 2 days ago [-]
FIDO2 is the only type of key that you can't import existing private keys for, since those are generated on device by design. Other types of keys you can of course upload a private key for, otherwise you wouldn't be able to add keys from your trusted CA for example.
moebrowne 2 days ago [-]
I'd love to however this requires touching the key for every git push to GitHub, GitLab and Bitbucket because neither support `no-touch-required` keys.
RIMR 3 days ago [-]
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.
overflowy 3 days ago [-]
The risk of this is the Tailscale control plane being blocked by the firewall and you getting locked out of the machine. I had that happening in my company thanks to Fortinet.
a3w 3 days ago [-]
cat ~/.ssh/id_rsa | pbcopy
feels wrong. Unnecessary uses of cat.
`pbcopy < ~/.ssh/id_rsa`
zulux 3 days ago [-]
I stopped fighting this war because the Cat version sort of follows the Subject-Verb-Object order in English, depending on how you think about the subject.
adrian_b 3 days ago [-]
The redirected input file can be moved before the command name, which improves the syntax for pipes.
rpigab 3 days ago [-]
This feels better, to have data flow from left to right, just like regular pipelines:
`<~/.ssh/id_rsa pbcopy`
InsidiousWombat 3 days ago [-]
cat /a/thing
ok it looks right, let's continue
cat /a/thing | thing doer
HN: "noooo you're doing it wrooong, use my obscure syntaaax that reads baaadlyy"
matvore 3 days ago [-]
"reads badly" is subjective. How many processes your pipeline starts up is not.
InsidiousWombat 3 days ago [-]
yes, objectively it is "doesn't matter, it's interactive shell session", unless you're throwing around 5GB/s+ it doesn't matter, neither does few tens of KBs cat invocation would take
wpm 2 days ago [-]
cat /a/thing
^-a Meta-d
thing doer /a/thing
(mostly snark I am a fan of unnecessary cats)
andai 3 days ago [-]
I just run Claude as root on all my nodes, so Skynet already owns them — I'm just ahead of the curve! :)
OptionOfT 3 days ago [-]
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.
I run ssh-agent in Windows, and then have a socket-activated systemd service that uses the above program to forward the SSH agent socket to the Windows ssh-agent. I have a similar setup for my GPG agent. This lets me seamlessly use my Yubikey for SSH/GPG in both Windows and WSL.
You could also use something like usbip to expose the Yubikey to your WSL distro as a USB device, but this has to be done manually each time you want to use it, and you can't use it in Windows until you manually switch it back.
bitfilped 2 days ago [-]
Putting your keys in a cloud service is more secure than on disk? I don't buy it for a second.
3 days ago [-]
usernametaken29 3 days ago [-]
There was an article here a while ago promoting Secure Enclave. Been using it since. It’s awesome, ticks all your boxes.
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.
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.
https://www.techbuzz.ai/articles/hundreds-of-artex-ai-hackin...
If they are motivated then this advice doesn't really buy you much. If they aren't motivated then the advice is moot to begin with. Passphrase-protected keys on disk are perfectly adequate for defending against simple credential stealers.
Is this argument "if I move the keys from $HOME/.ssh to $HOME/ssh, the script kiddies may not have guessed and therefore I am secure" ?
> 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?"
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.
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.
It is also not a given that a userland process can do this.Which is, in fact a relatively common posture.
There are a lot of ways of tackling this but the point is dev system security should not resemble the standard user posture.
We have reached a point where developing on your host OS has become irresponsible. Running development inside a container or VM is now mandatory.
[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.
Reminds me of that nodejs tech talk by the founder who wanted to do a new language or framework that restricted packages more securely so a bad one in node modules cant do as much harm
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>
Supply chain risks are big nowadays.
That part of Touch ID would stop them.
Security postures are not binary. There’s a wide range of techniques to defeat some likely risks.
I think Fedora permits it. Ubuntu blocks. No idea what are the defaults elsewhere, but it is not universal.
see also https://m.xkcd.com/1200/ (2013)
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.
There's very little hassle involved anyway. You set up the hardware key once and it lasts years and you have to configure SSH and GPG on any machines that you use as a terminal (not any of the machines you connect to). It is easily scripted and deployed en masse.
I'm talking about the hassle of entering your PIN everytime you need to use it. The idea of ssh keys is that you don't have to enter your password anymore, but if you just have to enter a different password everytime then I don't really see the point. If you still need to enter a PIN it also prevents automation, like having a backup run during the night to an offsite location via ssh.
For machine to machine like a backup process, it runs with its own key, with its own system user on the source and destination machine. That key has to sit on disk (or at least that's the risk that I accept), but that's a completely different risk to a key living in a real user's home directory. It can be locked down on both sides to mitigate further. Read only pull backups over SSH are possible this way for example.
You can use hardware tokens without interaction of course, but I agree in this particular case, it doesn't buy you much extra protection.
There's no need to reveal your unencrypted keys to Bitwarden or any other cloud service.
The default for keys added to ssh-agent without further config/options is to keep them unlocked indefinitely (as long as the ssh-agent process keeps running anyway).
- Good ergonomics
- No private key sitting unencrypted on disk
Hell, isn't it even the default when using `ssh-keygen`? As in, it prompts you for a passphrase if you don't explicitly tell it not to?
Yes but you can just hit <enter>
Honestly: don't use agent forwarding at all, use ProxyJump / -J. Agent forwarding is really only for systems you do in fact fully trust.
I use yubikey Fido keys so I need to touch the key to unlock it
It’s quite wild to be working and see my yubikey flash waiting for input because I have an agent running a task and it’s trying things like GitHub auth without asking me. Not hard to imagine it taking the next step and just grabbing tokens it needs to do whatever it needs to complete its task
I can tell you at my work, a large enterprise, people have pretty much just given Claude auto-mode free rein to do everything. Incidents in production are honestly people just sharing the output of their Claude’s investigations colored by whatever skills, memory and tokens available to it
Would you give a contractor developer your private key, just because it's somewhat lower friction?
The difference is that one situation is logged in the logs as you doing a thing, and the other is logged as the agent doing the thing. That's why you should really run your agents as their own separate user account and give that account whatever (minimal required) permissions it needs to do the job. For auditability purposes when tracing down a problem (to implement a solution, or to lay blame), you probably want to know when the "bot" screwed up so that it can be fixed (and so you don't have to take the blame for something you had absolutely no control over). The problem with that whole plan is this; I double-dog dare you to try to get the "bosses" to implement anything that improves security and auditability if it's going to cost even just ten seconds of extra time, or ten cents of extra money. Ain't gonna happen.
I 100% guarantee that at least some (far too many more than should be) absolutely are doing exactly this...
And it couldn't even do anything on github because the only token it can use (which is in the config file outside of its reach) can only do a very limited number of things on the repo.
I feel like a lot can be done without relying on the mechanism you use.
If you're running an LLM with access to your system, you've already thrown security and system stability out the window. That is an extremely foolish thing to do.
If you grant an LLM agent full system access, it’ll have full system access.
> First – Isn’t using a passphrase enough? Probably. I don’t intend to imply that this post is the only way that anyone should be doing SSH keys. [...] So yes, the ’traditional’ method is probably fine for most threat models.
https://blog.infected.systems/posts/2026-11-03-i-deleted-all...
Agents like Bitwarden and 1Password are more granular in their authorisation, in 1Password’s case I tap the fingerprint reader on my laptop when a process in a specific terminal first requests SSH key access to authorise that, after which it can use it as much as it likes until the session times out. Doing so however doesn’t mean that some other process spawned by some malware can also use it, that’s going to pop a prompt up again.
That's effective when possible, but it's not quite the correct level of permission. Separation of users usually involves disjoint working spaces/sets, and that defeats many typical 'assistant' roles. For example, "look through my e-mail for the past month and remind me if anybody needs something from me" is a very useful task for an assistant (LLM or human), but it necessarily involves access to one's own information -- even on a read-only basis.
IMO we're missing a robust task-level permission system, and this is difficult because a 'task' does not have a 1:1 mapping to a path, user, or application.
I'd love e-mail provider that provides api-key-like IMAP creds I can just generate and hand out to automation, with not only read/write scope but also per-path one.
There’s plenty of way to share specific information across boundaries and some are quite fairly simple to implement. No need to create another complex project for each task.
https://github.com/RALaBarge/enclave
The tooling is all DIY however and most people aren't used to operating multi-user environments, nor do they have filesystem permissions set up correctly, nor do they have a good way of handling secrets management, development environment credentials, etc etc etc.
Essentially, I feel like there's a lot of hand waving going on. Are you operating in this style of environment already? Are you using Claude Code or similar operating as another user on your local machine?
I run mine on an isolated VM with an unprivileged user. It's a hassle, but I still get plenty of work done with these agents. They can't read my email, but I think I'm okay with that.
And 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.
See: flotte.sh
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.
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.
AI companies know this is true. All of their sandboxes must traverse a SSL Bump proxy that decrypts and logs everything the sandbox does. I had AI build a web interface that lets the AI see for itself that it is being observed.
[1] - https://ping.ohftp.org/Do-Not-Trust-Continuously-Verify.html
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.
But one interesting centralized implementation I saw was about having a separate ssh server which you connected to with a forwarded ssh agent, and after doing 2FA dance it injected the freshly signed temp cert into your forwarded agent.
That said, I don't understand how a dev like bigballs from DOGE managed to push an exfil tool up to a public GitHub repo. Even private repos leak info; wrote this tool to check up on friends and myself and was surprised to see private repo info pop up:
#!/bin/sh # gets recent GitHub activity for user. user="${1:-your-username-here}" outfile="/tmp/hist-for.log"
gh api --paginate "/users/$user/events" --jq '.[] | "\(.created_at) | \(.type) in \(.repo.name)"' | tee "$outfile"
echo "History for $user saved to $outfile."
exit 0
Useful as a recoverable hardware wallet probably not your daily driver but a long term/offline master.
It has the added benefit of having a screen so depending on what's needed you can see what key is accessed or what's being signed.
https://trezor.io/guides/bonus-tools/ssh-with-trezor
Bitwarden can act as SSH agent if you want to keep them all in password manager
You can enroll your ssh keys into a yubikey, and have it securely stored in the hardware until you plug it in to ssh.
If you want secure the key, generate one on YK directly and use it. The entire point of hardware key storage is for key itself to never touch anything else
feels wrong. Unnecessary uses of cat.
`pbcopy < ~/.ssh/id_rsa`
`<~/.ssh/id_rsa pbcopy`
^-a Meta-d
thing doer /a/thing
(mostly snark I am a fan of unnecessary cats)
If I put in a YubiKey in Windows, I should be able to use it in WSL, and when I SSH into another machine.
I run ssh-agent in Windows, and then have a socket-activated systemd service that uses the above program to forward the SSH agent socket to the Windows ssh-agent. I have a similar setup for my GPG agent. This lets me seamlessly use my Yubikey for SSH/GPG in both Windows and WSL.
You could also use something like usbip to expose the Yubikey to your WSL distro as a USB device, but this has to be done manually each time you want to use it, and you can't use it in Windows until you manually switch it back.
https://venya.ai/#/security
working on SIEM now (for beta4, now testing against fluentd, logstash, splunk, rsyslog)
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)
https://github.com/roddhjav/apparmor.d
(I'm the contributor)
Still, validation without extraction (FIDO2), instead of read to validate is the best solution in OP's situation.