Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it considered good practice to store passwords in a private Github repository?

Tags:

security

Is it considered good practice to store passwords in a Github private repository?

[Related to, but very different from, this question]

like image 301
julien_c Avatar asked Jan 12 '12 17:01

julien_c


People also ask

Is it safe to store passwords in GitHub?

In short, don't store your secrets in Git! This applies to both secrets that are hardcoded into your application (such as putting the database password directly in the source code, which should be avoided at any cost), as well as keeping configuration files with secrets alongside your source code (such as .

What is the best practice for dealing with passwords in git repositories?

Encrypt the sensitive data (purpose of this reply) If you want to store your config files containing sensitive information (like passwords) in a public location then it needs to be encrypted. The files could be decrypted when recovered from the repository, or even used straight from their encrypted form.

Are private GitHub repositories safe?

Private repositories are intriguing because they offer security protections that public repositories don't, such as ensuring that sensitive data like passwords, SSH keys, API keys and other information isn't accidently exposed.

What kind of data should you never store in a remote git repository?

Never store credentials as code/config in GitHub.


3 Answers

I'd like to break this question into two parts:

  • Is it a good practice to store passwords in source control? No. Credentials are not versioned in the same way. For example, you should be able to change your password without releasing a new build of your software.
  • Is it a good practice to store passwords in the cloud? That's really up to your tolerance for security and reliability. In this case, you're outsourcing both to GitHub. If GitHub loses your data, do you have a backup elsewhere? If GitHub gets hacked (e.g. your private repo briefly becomes public) or if they don't securely destroy old drives, what's the impact if an unauthorized person has your credentials?

Also, when you store credentials, encrypt them and store the key elsewhere.

like image 93
aingram Avatar answered Nov 16 '22 03:11

aingram


I don't believe it's ever a good practice to store passwords anywhere else than where absolutely necessary. GitHub doesn't strike me as meeting such conditions.

like image 40
Julio Santos Avatar answered Nov 16 '22 04:11

Julio Santos


It's certainly not 'good practice'.

Whether it's tolerable depends on your security requirements. For SCI clearance type work that ** won't fly.

For a private fun project its probably ok. But putting sensitive passwords anywhere on the cloud is probably not a good idea.

Projects that are serious about security usually don't keep plaintext passwords in their security files.

like image 25
hvgotcodes Avatar answered Nov 16 '22 03:11

hvgotcodes