-
Notifications
You must be signed in to change notification settings - Fork 644
Optionally encrypt cargo credentials under a passphrase #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would prefer to just re-use GPG for this, as Leiningen does. No need to reinvent the wheel and you get the benefit of |
gpg would also let you encrypt to a private key stored on a CCID card. gpg1 is a bit odd about symmetric encryption though... it defaults to CAST5 o_O This could also be done with PKCS#8 using a password derived via PBKDF2 using rust-openssl |
Does this belong hear or does it belong on cargo? |
Yeah, I think this should be in cargo's issues. Mind moving it over there @tarcieri ? |
Done: rust-lang/cargo#3749 |
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
It would be nice if you could encrypt the cargo registry token under a key derived from a passphrase, much like ssh supports for private keys.
It's fairly common for developers to be running a large number of incorrectly firewalled services under their own user and have them listening on all network interfaces, and unless there's some sort of additional protection beyond filesystem perms, if any of these services are vulnerable to a directory traversal attack (such as the one all Rails apps were vulnerable to recently) files like
~/.cargo/config
(or~/.ssh/id_rsa
) are easy to steal if someone is on public WiFi or are otherwise directly connectable. Firewalls help, but sometimes people spin up VMs and bridge them to their external interfaces without thinking about the security ramifications (and stick their credentials inside so they can develop inside a VM)The
rust-openssl
orsodiumoxide
libraries would provide what you need to do this. sodiumoxide in particular provides both scrypt (which can be used as a KDF) and modern authenticated symmetric ciphers like secretbox (xsalsa20+poly1305) and also a chacha20+poly1305 AEAD mode, while also being widely ported (Windows, *IX, Mac, iOS, Android at least to my knowledge)I imagine this working by prompting a user for a passphrase after
cargo login
, or allowing them to just hit enter for no passphrase.The text was updated successfully, but these errors were encountered: