Back to all lessons
Awareness Lessons
last month

500,000 Active Credentials Exposed in Public GitHub Repos

Written by AI from the linked story. Not reviewed by an editor. How this works

Developers inadvertently pushed sensitive credentials — including Google Cloud service account keys and MongoDB connection strings — into public GitHub repositories, leaving them discoverable by anyone. Even after GitHub introduced default push protection controls, thousands of secrets continued to be exposed, suggesting developers bypassed or ignored the safeguards. The credentials remained active because neither developers nor service providers enforced mandatory revocation upon discovery. This matters because exposed credentials are a direct pathway for attackers to access cloud infrastructure, databases, and sensitive data at scale, often within minutes of a secret being posted publicly.

Tactical Insight

Immediate actions

  • Audit all public and private repositories now using secret scanning tools (e.g., Trufflehog, GitHub Advanced Security) and revoke any discovered credentials immediately.
  • Rotate all potentially exposed API keys, service account credentials, and connection strings as an emergency measure, even if exposure is unconfirmed.

Long-term improvements

  • Enforce pre-commit hooks (e.g., git-secrets, detect-secrets) in developer pipelines to block credential commits before they reach any remote repository.
  • Implement a secrets management solution (e.g., HashiCorp Vault, AWS Secrets Manager) so credentials are never stored in source code.
  • Establish a mandatory developer training program covering secure coding practices, with specific focus on credential and secrets hygiene.

Detection & response measures

  • Enable GitHub's native push protection and secret scanning alerts organization-wide and configure them to block — not just warn — on detected secrets.
  • Set up continuous monitoring with automated alerts that trigger credential revocation workflows the moment a secret is detected in a public repository.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.