logoalt Hacker News

LeBit • today at 6:23 AM • 2 replies • view on HN

Why not use PAT?

I’ve grown to appreciate ssh should only be used with git for signing commits and as a deploy key (eg in a CI system).

I always use https for day to day git operations. My keys reside in gopass and are extracted by gopass-git-credential when needed by git.

I use that within devcontainers

https://github.com/gopasspw/git-credential-gopass


Replies

Jakob • today at 6:50 AM

PAT are vulnerable, once stolen they can be used from anywhere until their (usually) long term expiry.

Better use short lived tokens with auto refresh. For example OAuth tokens. They can be used for the same use cases like PAT, but they expire after a max of 2 hours.

➕ show 1 reply
Gigachad • today at 6:43 AM

Those access token can still be stolen just the same. The Secure Enclave is better because you can ask it to authorise the action, but you can never get the key out of it, so the latest malicious npm package can’t send off your access tokens or ssh keys.

➕ show 1 reply