TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Secretive: Store SSH Keys in the Secure Enclave

292 pointsby ValentineCabout 2 years ago

19 comments

mjg59about 2 years ago
Secretive has to function as both a key generation utility and an SSH agent because of a restriction in Apple&#x27;s Secure Enclave functionality - only the app that generates a key is allowed to use it. There&#x27;s actually a workaround for this, which is to use <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;cryptotokenkit" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;cryptotokenkit</a> to expose keys to the user keychain, which then means the tool used for key generation doesn&#x27;t have to be the same tool that allows applications to make use of that key. We&#x27;re using this internally to generate keys that are then combined with user creds to receive x.509 and ssh certificates, and exposing the ssh certs to ssh using the SSH agent protocol. Our next step is to take that a step further and use <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;devicecheck&#x2F;accessing_and_modifying_per-device_data" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;devicecheck&#x2F;access...</a> to verify that the device asking for a cert is a device that we own (IT will be able to set one of those bits during device provisioning, and then we query that data during certificate issuance to show that the request comes from something we provisioned)
评论 #35094490 未加载
LoganDarkabout 2 years ago
I&#x27;ve always been afraid to invest in something like a yubikey or even to use the TPM on any devices I own. I don&#x27;t ever want to depend on &quot;something I have&quot; that can&#x27;t be backed up or recovered in any way.<p>As an example, when I started using a password manager last year, I also made sure to start hosting the (encrypted) passwords database publicly (on a web server) so that if I ever lose it for any reason (SSD fails, etc) I&#x27;ll be able to download it back onto a computer and unlock it with my master password.<p>If I ever lose my passwords database I&#x27;ll also lose access to every internet account I&#x27;ve ever made. It would be far too risky to make it rely on any physical possession of mine.<p>Some people (most people??) would feel safe knowing that it&#x27;s impossible for anyone to get into their accounts without their yubikey, but I&#x27;d just always be afraid of losing the yubikey.
评论 #35091320 未加载
评论 #35091012 未加载
评论 #35091173 未加载
评论 #35090893 未加载
评论 #35091516 未加载
评论 #35090887 未加载
评论 #35090942 未加载
dangabout 2 years ago
Related:<p><i>Secretive: An app for storing and managing SSH keys in the Secure Enclave</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28853329" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=28853329</a> - Oct 2021 (11 comments)<p><i>Secretive – macOS native app to store SSH keys in the Secure Enclave</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23664129" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23664129</a> - June 2020 (106 comments)
kylehotchkissabout 2 years ago
I wish Apple would add more native support for this somehow. Until then, I’ve enjoyed using 1Pass for SSH key which continently allows me to share keys across machines, work confidently knowing my key isn’t accessible if a machine is lost, and asks me for Touch ID permission
评论 #35091450 未加载
VoxPelliabout 2 years ago
I was considering this but ultimately opted for 1Password’s SSH Agent instead and storing my SSH keys there and unlocking it with Touch ID: <a href="https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;agent&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;agent&#x2F;</a><p>Also use it to sign my git commits: <a href="https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;git-commit-signing" rel="nofollow">https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;git-commit-signing</a>
评论 #35094055 未加载
buildbotabout 2 years ago
NB: If you use this, make sure to backup the key somehow. About a year ago I tested this with a few servers and lost all of the keys when my Mac had a kernel panic that wiped the state of the Secure Enclave! Updates can do this too!
评论 #35091512 未加载
评论 #35091033 未加载
评论 #35091182 未加载
评论 #35091121 未加载
评论 #35099296 未加载
nixpulvisabout 2 years ago
What I kinda want is a way to use a detachable hardware key like a Yubikey as a primary factor for SSH and login authentication. I have multiple computers and I provision new OSes frequently and I always find it irritating depending on either network or flash drive synchronization for secret material when I could just be plugging in a smartcard device.<p>Anyone gone down this path?
评论 #35092896 未加载
评论 #35094149 未加载
评论 #35092612 未加载
评论 #35104544 未加载
评论 #35092585 未加载
评论 #35094508 未加载
obscuretteabout 2 years ago
Looked at it at some point with hope that it&#x27;d provide easier user experience to use SSH with Yubikey PIV functionality on Mac. Unfortunately it doesn&#x27;t support RSA keys we have to use for various reasons.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;maxgoedjen&#x2F;secretive&#x2F;issues&#x2F;10">https:&#x2F;&#x2F;github.com&#x2F;maxgoedjen&#x2F;secretive&#x2F;issues&#x2F;10</a>
评论 #35097084 未加载
macrolimeabout 2 years ago
How I&#x27;m setting up SSH access currently is to use two factor authentication where one of the factors is a device identifier, i.e. SSH key stored in TPM or with this on the Secure Enclave on a Mac, allowing only access from trusted devices. The second is a user identifier, stored in a yubikey.<p>In sshd_config, you can enable multifactor authentication with a comma separated list after AuthenticationMethods, for example publickey, publickey to require two keys.<p><a href="https:&#x2F;&#x2F;manpages.debian.org&#x2F;bullseye&#x2F;openssh-server&#x2F;sshd_config.5.en.html#AuthenticationMethods" rel="nofollow">https:&#x2F;&#x2F;manpages.debian.org&#x2F;bullseye&#x2F;openssh-server&#x2F;sshd_con...</a>
评论 #35093636 未加载
评论 #35093673 未加载
aheppabout 2 years ago
Wow, this is really exciting! I have wished something like this existed, I&#x27;ll have to try it out. I would love to use touchID to protect my ssh keys instead of a password!
评论 #35090694 未加载
neloxabout 2 years ago
This is excellent.<p>A different way of enhancing the security of a private key is to use a passphrase and store the passphrase in the macOS Keychain. Then, configure ssh-agent to always use the Keychain. When you login to your Mac user account, it will unlock it for use with ssh.<p>The encryption key needed to decrypt the Keychain is stored inside the Secure Enclave.<p>If someone manages obtain your private key, they would also need guess your passphrase or gain access to the Secure Enclave.
WhyNotHugoabout 2 years ago
Doesn&#x27;t Secure Enclave offer a smartcard-like interface on macOS?<p>SSH already supports using hardware-backed keys via smartcard interfaces, so such an interface would allow it to work without any extra moving parts.<p>I keep seeing lots of new programs that are basically &quot;Secure Enclave for X&quot;, where X already supports hardware-based keys via existing interfaces.
评论 #35097043 未加载
exabrialabout 2 years ago
I’ll definitely give this a spin!<p>My go to right now is using a gpg key with ssh subkey. The key is actually on YubiKey. Similar security properties but portable.
评论 #35090862 未加载
rgreenabout 2 years ago
Secretive is one of my favorite tools on mac os. it&#x27;s the best ssh workflow i&#x27;ve used: key material never leaves the device, can auth with touch id, and forward the agent as necessary. i&#x27;ve also sent him $ on github as a small thank you for a tool i use daily (and i&#x27;d encourage you to, too!)
nyolfenabout 2 years ago
there was a cool app called krypt that did this for ios, with push notifications to your phone when you ssh&#x27;d, where requests were authenticated against your secure enclave. then it got bought by akamai and turned into some b2b saas crap.
rollcatabout 2 years ago
Unfortunately the SEP only supports ECDSA keys. <a href="https:&#x2F;&#x2F;blog.cr.yp.to&#x2F;20140323-ecdsa.html" rel="nofollow">https:&#x2F;&#x2F;blog.cr.yp.to&#x2F;20140323-ecdsa.html</a>
wslhabout 2 years ago
I don&#x27;t think the secure enclave is the solution. Identities should be independent than general computation devices with many attack vectors.
评论 #35092769 未加载
encryptluks2about 2 years ago
This is already possible and has been for some time on Linux using TPM. What is different about secure enclave, or is it just Apple lingo?
评论 #35091546 未加载
评论 #35090614 未加载
评论 #35090560 未加载
评论 #35090522 未加载
评论 #35092800 未加载
throwawayacc5about 2 years ago
Practically an anti-pattern nowadays. Get a YubiKey and leverage SSH certificates.
评论 #35090502 未加载