Oops! I Committed My
Password to GitHub!
Miguel Grinberg
Slide 2
Slide 2 text
About Me
● Flask Web Development
● The Flask Mega-Tutorial
● The Flask Webcast
● Software Dev @ Rackspace
● APIs, Microservices, Security
● blog.miguelgrinberg.com
● github.com/miguelgrinberg
● @miguelgrinberg
Slide 3
Slide 3 text
Did you ever commit a password to source control?
“Yeah, but it was by
accident”
“Yeah, but it’s fine
because...”
Slide 4
Slide 4 text
How (not) to fix a password leak accident
Make a new commit with
the password removed
Rebase the commit
Slide 5
Slide 5 text
How to fix a compromised password for real
REVOKE IT!
Adding secrets to the environment
.profile, .bashrc or other user config files
.env file for your project (add it to .gitignore)
Do not type passwords in your shell!
Slide 8
Slide 8 text
Demonstration
Slide 9
Slide 9 text
If the environment is not enough
Vault (Hashicorp)
Parameter Store (AWS)
Secret object (Kubernetes)
Ansible Vault
Slide 10
Slide 10 text
DO NOT write passwords or tokens in your code
DO import secrets from the environment or a secrets store
DO revoke any secrets that might have been compromised
DO NOT use services that don’t offer easy revocation
DO NOT use the same password for more than one service
DO NOT use the same credentials for all users
DO’s and DON’Ts