Interview Prep/DevSecOps/Incident Response and Governance

A developer's GitHub account was compromised and the attacker pushed a commit to `main` that adds a postinstall script. What now?

AdvancedScenarioIncident Response and Governance
Answer

Situation read → Source compromise. The malicious code may have been built, published and deployed already.

What I'd do →

  1. Suspend the user in the org, revoke their sessions, PATs, SSH keys and OAuth app grants.
  2. Revert the commit, and stop CI and deployments for affected repos.
  3. Identify every artifact built from the bad commit (CI run logs, image digests, published packages) and block or unpublish them.
  4. Roll back deployments to the last known good digest; rotate secrets that the CI job could read.
  5. Review the org audit log for other actions by that account (new deploy keys, webhooks, branch protection changes).
  6. Close the gap: require PRs with review on main, signed commits, and phishing-resistant MFA (passkeys).

Why → The commit is the smallest part; the artifacts it produced and the access it used are the real exposure.

Interview tip → Mention auditing the GitHub org audit log for persistence.

All DevSecOps questions

More on Incident Response and Governance