Hacker News new | ask | show | jobs
by littlecranky67 22 days ago
I'd suggest to use ssh keys inside the secure enclave on macOS that require your fingerprint for every new session [0]. That way agents cannot initiate anything, and you will always be aware when a new ssh connection is being made.

[0]: https://gist.github.com/arianvp/5f59f1783e3eaf1a2d4cd8e952bb...

3 comments

Or in a Yubikey and set the touch-required mechanism (light in the key will blink when it needs a touch to continue the auth).
I've been using secretive on the mac for exactly this.
Secretive is amazing! I know that it's not its purpose, but it would be great if it could store more than ssh keys, like providing a safe place for my .envs
I know it's not open-source, but this is how I use 1Password with FIFO .envs. I'm unsure if 1P stores its SSH in the enclave, but it works the same way - whenever SSH key is accessed, it prompts for TouchID or password.

Besides the open source, any reason why I should use secretive over 1P?

- someone trying to be better about security no matter how annoyed.

> know it's not open-source, but this is how I use 1Password with FIFO .envs

I tried it some months ago, but it didn't work so well... The FIFO approach looks elegant, but in practice it doesn't work so well (maybe because the application was trying to read it twice?).

The best I could do with 1P was to store the env var as a password and retrieve through the CLI...

> I'm unsure if 1P stores its SSH in the enclave

I am reasonably sure the answer is no, as evidenced by it being exportable

macOS secure enclave supports exportable keys (see the link I posted). Still think 1P is not using it, though.
Your link is describing keys that are encrypted using a key in the secure enclave, not keys exportable from the secure enclave; the latter would defeat the whole purpose of a secure enclave.
Good point, that makes sense.
1Password also supports this BUT that does not prevent your agent from being forwarded and you still have to inspect each command being used if you don't trust your agent.

Halfway better would be a separate key for each concern, then check that the key you expect to be used is being used before authorizing.