Live data from Hacker News

I scanned all of GitHub's "oops commits" for leaked secrets

trufflesecurity.com

21–30 of 117 posts

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#21
Maybe I missed it but the article doesn't mention the even easier way to see this: the activity tab.

It has everything. Any force push to hide ugly prototype code is kept forever which annoys me. I wish we were able to remove stuff from there but the only way to do it is to email support it seems?

Here it is for the test repo mentioned

https://github.com/SharonBrizinov/test-oops-commit/activity

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#22
post #14
post #6

Maybe a default secure delete option could be made a lower bar event? Checkout to event, commit in clean state with prior log history, overlay the state after the elision and replace git repo? When I had to retain log and elide state I did things like this in RCS. Getting date/time info right was tricky.

If something got out to the internet, you won't get it back. There is little point in rewriting repo history if you have already made a secret public. Just change the secret as soon as you can.

Yet people complain that Netflix/Youtube pull certain content ;)

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#23
All devs should run open-source trufflehog as a precommit hook for all repositories on their local system. It’s not a foolproof solution, but it’s a small time investment to get set up and gives me reasonable assurance that I will not accidentally commit a secret. I’m unsure why this is not more widely considered standard practice.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#24
post #18

Daily reminder: - Once it is on the internet - it is always there so Rotate the key/secrets FIRST. - Never think secrets are gone because of you have recommited . - Deleting a commit is not enough , use BFG Cleaner - https://rtyley.github.io/bfg-repo-cleaner/ , and force commit to change history. Edit- Forget to add most important thing - rotating the key.

I think you mean "rotate the keys"

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#25

Git never forgets, this isn't really a shocking revelation.

Git is not point in time backups. It is versioning. You are free to organize your version history as you fit, and you can certainly rewrite history. The only issue you might have is signed commits from collaborators, that you can not resign.

> and you can certainly rewrite history.

But you can't coerce everyone in the world to remove all traces of the alternate history that was a thing before being rewritten.

So while you can make git forget something in your local repo, you can't make git forget across the decentralised set of repos, which is part of git's core design.

So in that sense, yes, git never forgets, by design.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#26

Git never forgets, this isn't really a shocking revelation.

Git is not point in time backups. It is versioning. You are free to organize your version history as you fit, and you can certainly rewrite history. The only issue you might have is signed commits from collaborators, that you can not resign.

[deleted]

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#28
post #18

Daily reminder: - Once it is on the internet - it is always there so Rotate the key/secrets FIRST. - Never think secrets are gone because of you have recommited . - Deleting a commit is not enough , use BFG Cleaner - https://rtyley.github.io/bfg-repo-cleaner/ , and force commit to change history. Edit- Forget to add most important thing - rotating the key.

Had it correct in the first two points, then contradicted yourself with the last. Rotate your secrets.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#29

What I've never understood is, how is this an issue with private repos? Aside from open source projects I can't see the problem with accidentally doing this, even though it is a smell.

It's called private but actually shared with a very large corporation you don't control, likely running on infrastructure they don't control. Due to the CLOUD Act it's also shared with the US government.

Re: I scanned all of GitHub's "oops commits" for leaked secrets

#30
> GitHub keeps these dangling commits, from what we can tell, forever.

Not if you contact customer support and ask them to garbage collect your repo.

What I do when I accidentally push something I don’t want public:

- Force push;

- Immediately rotate if it’s something like a secret key;

- Contact customer support to gc the repo (and verify the commit is gone afterwards).

(Of course you should consider the damage done the moment you pushed it. The above steps are meant to minimize potential further damage.)

Post reply on HN