Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File encryption in Git Repository

Tags:

Is there any way (in built or add-on) to encrypt individual files in a repository, accessible by limited people. Files when checked in by those folks will auto encrypt and decrypt when checked out. They will stay encrypted if tried to be accessed by other people.

like image 347
sunny24365 Avatar asked Jan 18 '18 21:01

sunny24365


People also ask

How do I encrypt a file?

Right-click (or press and hold) a file or folder and select Properties. Select the Advanced button and select the Encrypt contents to secure data check box. Select OK to close the Advanced Attributes window, select Apply, and then select OK.

Should you store secrets in git?

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 .


1 Answers

I know my answer is late but there is plenty of alternatives for storing secrets in git repos:

  1. Git-crypt
  2. BlackBox
  3. SOPS
  4. Transcrypt

Most of them use GNU Privacy Guard (GPG), symmetric key encryption, and/or cloud key services (SOPS). If you just want a simple encryption mechanism with password you can also take a look at ansible vault, which doesn't require generating keys for each account.

like image 140
hungneox Avatar answered Oct 26 '22 23:10

hungneox