3 ms·
Stop using any passwords that get checked in. Set expiry dates for access tokens. Set up git commit hooks that scan for password or API key prefixes and block t
by lstamour 4y ago
Stop using any passwords that get checked in. Set expiry dates for access tokens. Set up git commit hooks that scan for password or API key prefixes and block the commit. Set up appropriate .gitignore files, you can place them in subfolders to keep them simple.
If possible, switch from using passwords or tokens without expiry to using ephemeral or time-limited tokens such as machine or pod identities, JWT tokens, IAM service accounts, public/private key pairs (if you can get by with only a public key in the repo) or two-factor authentication. Consider distributing time-limited passwords with Hashicorp Vault.
Some teams might use a cloud-hosted secrets manager or password manager like 1password to distribute passwords and then have code load the password as it runs on a developer machine. GitHub has a secrets scanner, if you pay them enough money for “Advanced Security” such that secrets can never be pushed upstream if recognized as such.
Also, converting from any repo format to another repo format requires care and multiple repeated attempts. A lot can go wrong. Reposurgeon (from a sibling comment) is highly recommended but also not easy to use. It takes a lot of attention to detail to really get the details right.
- User23 4y agoGit filter-branch will erase your shame. But as others have said, those credentials are burnt and need to be treated accordingly.
- CrazyPyroLinux 4y agoThese days https://github.com/newren/git-filter-repo https://github.com/newren/git-filter-repo is superior.
- chasil 4y agoJust kill me now. We had the same problem in TFS. I found them, I warned them, my riot got us kicked off our shared server. We migrated to our corporate TFS cloud, and they kicked us off for precisely the same reason. This just won't/can't stop.