Last Updated: February 25, 2016
·
1.554K
· simeonwillbanks

Dotfiles Meet Security

Dotfiles added to version control? Check.
Signed up for website requiring authentication? Check.
Use a command line tool to connect with said website? Check.
Running OS X? Check.

Authentication credentials should not be checked into version control. Use Security.

https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/security.1.html

Add password to keychain

$ security add-generic-password -a YOUR_LOCAL_OSX_USER -s github.password -w YOUR_GITHUB_PASSWORD

Export environment variable with value from key

$ export GITHUB_PASSWORD=$(security 2>&1 >/dev/null find-generic-password -gs github.password | sed 's/password: "\(.*\)"/\1/')

Automate export from dotfile

https://github.com/simeonwillbanks/dotfiles/blob/master/oh-my-zsh/custom/simeon.zsh#L8-L9

Stay safe my friends.

2 Responses
Add your response

The link you posted to your dotfiles is unavailable.

over 1 year ago ·