Interview Prep/Git & GitHub/Secrets, Signing and Security

A private repository was made public by mistake for two hours.

IntermediateScenarioSecrets, Signing and Security
Answer

Situation read → Assume it was cloned and scanned.

What I'd do →

  1. Make it private again immediately. Forks created while public stay public; delete them if possible through GitHub Support.
  2. Scan full history for secrets and rotate anything found.
  3. Check the audit log to see who changed visibility and why.
  4. Restrict the "change visibility" permission to org owners.

Why → Visibility changes are reversible, but exposure is not.

Interview tip → Org setting "Repository visibility change" prevents members from doing it.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security