What branch protection settings do you consider the minimum for production repositories?
IntermediateScenarioSupply Chain Security
Answer
Situation read → The repo is the root of trust for everything built from it.
What I'd do →
- Require pull requests with at least one approval, and dismiss stale approvals on new commits.
- Require code owner review for sensitive paths (
.github/workflows/,terraform/). - Require status checks: tests, SAST, secrets, SCA.
- Disallow force pushes and deletions; include administrators.
- Require signed commits or verified tags for releases where policy needs it.
- Use rulesets and protected environments for deploy approval.
Why → One person alone cannot push code to production.
Interview tip → Protect the workflow files with CODEOWNERS; they are code that holds secrets.
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner