Interview Prep/Azure/CI/CD and IaC

A PR changes an NSG to open port 22 to the internet. How do you catch it automatically?

BeginnerScenarioCI/CD and IaC
Answer

Situation read → Static analysis in PR, policy at deploy.

What I'd do →

  1. Run Checkov or Trivy config scanning in PR builds; both flag 0.0.0.0/0 on 22/3389
  2. Make the check required in branch policies
  3. Azure Policy deny for management ports from Internet as a backstop
  4. Defender for Cloud recommendation alerts if anything slips through

Why → Shift left for fast feedback, enforce at ARM for certainty.

Interview tip → "Defence in depth for IaC: PR scan, policy, runtime detection."

Azure All Azure questions Roadmap: AKS & Azure DevOps

More on CI/CD and IaC