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...
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).
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.
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.
[flagged]