secret-shield
secret-shield copied to clipboard
Prompt before pushing to a public repo
secret-shield introduces a layer of protection against accidentally committing secrets to public repos. What if we want to protect against accidentally committing to public repos at all?
Proposal
We should add a pre-push hook to the default secret-shield suites. This hook would:
- Check if the repo is public.
- Check if this user has never committed to this repo before. (optional: make this configurable!)
If both are true, the hook would prompt with a confirmation message.
> git push -u origin foo
WARNING! This repository is PUBLIC, and you have never committed to this repo before.
Are you sure you want to push refs to '[email protected]:mapbox/secret-shield'? y/N
cc/ @mapbox/security-and-compliance @ectrotter @tmpsantos
I would also add a check if it has collab
on the name.
@hcourt Thanks for opening this. Is there any update on progress to get this in place?
@ectrotter FYI, @mapbox/security-and-compliance is triaging this. I don't believe there are any updates right now.