News for hackers. Stuff that matters.
Re:What will happen when you commit secrets to a public Git ... by jakub_g on Saturday November 07, 2020 @08:04AM (#25014840)
Why secret scanning is enabled only for public repos but not for private ones?
Re:What will happen when you commit secrets to a public Git ... by greysteil on Saturday November 07, 2020 @09:05AM (#25015133)
Private repos need a different approach, but committing secrets to them can still be a problem.

If a secret is committed to a private repo then anyone with read access to that repo could use it. That might give those users more permissions than they're supposed to have. It's particularly a problem in large organisations, where thousands of developers may have access to a private repo, but should not necessarily have direct access to production infrastructure.

That said, the risk tradeoff when a secret is found in a private repo is different to when one is found in a public repo. If it's a personal private repo that no-one else has access to, the risk may be limited. If it's a corporate repo with hundreds of contributors, someone almost certainly wants to be aware of it. Even then, each organisation will want to respond in different ways, perhaps depending on who has access to the repo, and what access the leaked secret granted.

I'd be remiss not to say that GitHub has a beta offering for private repo secret scanning that we launched in May. It's a paid feature, targeted at large, security-conscious organisations, that scans your git history and each new commit for secrets and displays them in the GitHub UI.

Re:What will happen when you commit secrets to a public Git ... by jakub_g on Saturday November 07, 2020 @10:22AM (#25015551)
Re:What will happen when you commit secrets to a public Git ... by Lex-2008 on Saturday November 07, 2020 @08:24AM (#25014928)
Because it should be OK to commit secrets to private repos - that's why they're _private_, after all, right?
Re:What will happen when you commit secrets to a public Git ... by dorfsmay on Saturday November 07, 2020 @09:07AM (#25015141)
No, that's not not why.

If you have secrets, encrypt them.

Private repos can be turned public, intentionally or by mistake. Repos can be exported to give software to third parties. Also, git users clone repos, which means that those secrets are copied every where. Can you make sure those stay private too? Do you make your developers encrypt their laptops or delete repos from them before they leave their house or office?

Re:What will happen when you commit secrets to a public Git ... by jakub_g on Saturday November 07, 2020 @10:26AM (#25015576)
Also, it's possible that when you have a secret in a private repo, it accidentally leaks when you deploy that repo to a public server. And it's easier to do this than you'd think, e.g. by a mix of a few unrelated changes by different developers.

Also, when an attacker gets access to one private repo by some means, you don't want him to pwn your whole organization.