Setting Up SSH Keys with macOS Secure Enclave
The author explored methods to protect SSH keys from filesystem-level compromise, evaluating native macOS Secure Enclave, the Secretive app, YubiKey hardware tokens, and password managers. Seeking hardware-backed security, they implemented the native Secure Enclave approach available in macOS Sequoia and Tahoe. While fully functional, the solution proved unsuitable for regular use due to user experience issues.
Secure Enclave SSH stores private keys on an isolated hardware subsystem from which they cannot be extracted. Implementation uses the sc_auth command to create a non-exportable p-256 key with biometric approval required for each SSH operation. Configuration requires exporting a key handle via ssh-keygen, setting the SSH_SK_PROVIDER environment variable, and explicitly registering the key in SSH config since SSH doesn’t automatically discover files named id_ecdsa_sk_rk. The author encountered several obstacles: Touch ID enrollment failures, widespread outdated guides recommending deprecated ssh-add commands, and SSH key discovery issues.
The primary drawback was the biometric authentication prompt displaying a generic system message (“ctccardtoken needs to authenticate”) rather than SSH-specific context. Additionally, Secure Enclave keys are permanently tied to a single machine and cannot be backed up. The author recommends using biometric protection for all keys to maintain visibility of usage and maintaining supplementary keys on other devices as fallback access. Despite confirming the approach provides genuine security benefits, the author opted against using it due to interface polish concerns.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.