Interview Prep/Git & GitHub/Protection, Hooks and Policy

Compliance (SOC 2) requires two approvals, no self-merge and traceable changes.

AdvancedScenarioProtection, Hooks and Policy
Answer

Situation read → You need technical controls that map to the written policy.

What I'd do →

  1. Ruleset: 2 required approvals, dismiss stale approvals, require last-push approval, code owners for critical paths.
  2. Required checks and signed commits; no bypass except a break-glass team.
  3. Manage rules as code and export evidence (ruleset JSON, audit-log events, PR history).
  4. Review bypass events monthly.

Why → Auditors want evidence that the control is enforced, not just documented.

Interview tip → Say that the PR is the unit of change evidence: approvals, checks and the merge are all recorded.

All Git & GitHub questions Roadmap: Git & GitHub

More on Protection, Hooks and Policy