6 ms·
CLI tool that finds secrets accidentally committed to a Git repo (2017)
- packetized 8y agoLooks nifty, but I'd ask: why use this over Trufflehog? https://github.com/dxa4481/truffleHog https://github.com/dxa4481/truffleHog
- techjacker 8y agoAs well as the CLI tool the repository contains code for a server to listen for pushes to repositories in github via webhooks and write any violations found into elasticsearch.
- Cthulhu_ 8y agoIs there a similar tool that can run as a pre-commit hook and prevent it from happening in the first place / after this scan?
- ashurov 8y agogit-secrets from the AWS team: https://github.com/awslabs/git-secrets https://github.com/awslabs/git-secrets
- dewiz 8y agoI don’t know of a tool in particular, but it’s not too hard to scan for patterns and high entropy, blocking the commit
- burdzwastaken 8y agoI wrote one using the same difference library a few months ago: https://github.com/burdzwastaken/git-rid-of-keys https://github.com/burdzwastaken/git-rid-of-keys.
- JWoolfenden 8y agoLook at pre-commit.com, this had lots of supported hooks including preventing secrets being added
- mulrian 8y agoTIL the UK Home Office has over 700 projects on GitHub.
- scarface74 8y agoAnd how to really remove a file from your git history.... https://help.github.com/articles/removing-sensitive-data-from-a-repository/ https://help.github.com/articles/removing-sensitive-data-fro...
- craftyguy 8y ago> And how to really remove a file from your git history.... That's misleading. Once you commit and push it to a remote, you should consider it compromised. You could remove it from the repo and force-push to re-write history, but anyone could have pulled from the same remote since your original push and have the file locally on their system. A better option is to push a new commit to remove the file from the repo (add to .gitignore), then set a new, strong passphrase/whatever and don't ever use the one you pushed again.
- scarface74 8y agoHow is the article misleading? It said the same thing you did in bold.... Warning: Once you have pushed a commit to GitHub, you should consider any data it contains to be compromised. If you committed a password, change it! If you committed a key, generate a new one.
- craftyguy 8y agoYour comment was misleading, not the article, which is why I quoted you comment and not the article...
- scarface74 8y agoFair Enough....
- woodruffw 8y agoMaybe I'm missing something, but doesn't a whitelist (the `.secignore` mentioned in the README) defeat much of the point of a secret-scanning tool? If I whitelist a file now for containing the (benign) string "password," I'm likely to miss a future problem in that file.
- amelius 8y agoI'd like to have some way to prevent certain code from being committed in the first place. E.g. when I have a line saying printf("debug: now at: %d\n", i); /* DONTCOMMIT */ then when I type "git commit ...", a script will be invoked that will recognize the "DONTCOMMIT" string, and it will abort the commit.
- wink 8y agoShould be possible if you create a pre-commit hook, like this one https://gist.github.com/guilherme/9604324 https://gist.github.com/guilherme/9604324
- amelius 8y agoHmm, it uses "git diff" but in my case, this shows a few lines of context. So if the context contains "console.log" (and not the change itself), the script would still complain.
- nextlevelwizard 8y agoLiterally what client side pre-commit and on server end post-commit scripts are for
- terhechte 8y agohttps://appventure.me/2016/04/04/prevent-accidental-test-code-commits/ https://appventure.me/2016/04/04/prevent-accidental-test-cod...
- deleted 8y ago[deleted]
- jsd1982 8y agoI read that as "CLI tool ... accidentally committed to a Git repo," as in the CLI tool itself committed to a Git repo by accident, and that the CLI tool finds secrets. Title as of my reading was "CLI tool that finds secrets accidentally committed to a Git repo (2017)".
- lthemick 8y agoI read it the same way
- zricethezav 8y agoI made a similar tool https://github.com/zricethezav/gitleaks https://github.com/zricethezav/gitleaks Reasons why you might want to use gitleaks over this: * performance (powered by go-git) * scan github orgs/users * ref targeting
- quiq 8y agoNow if only there was a CLI tool to convince my coworkers that storing secrets in git is a bad idea.
- 0xdeadbeefbabe 8y agoI'm guessing such people have little interest in new CLI tools, since CLI is for old tools, etc.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- zapita 8y agoThis reminds me of gitguardian.
- marataziat 8y agoThere are backdoor for SMTP credentials in django projects: https://searchcode.com/?q=EMAIL_HOST_PASSWORD%3D&p=1&loc=0&loc2=10000&lan=19 https://searchcode.com/?q=EMAIL_HOST_PASSWORD%3D&p=1&loc=0&l...
- the_new_guy_29 8y ago*There are backdoors in Django everywhere - ftfy