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 →
- Run Checkov or Trivy config scanning in PR builds; both flag
0.0.0.0/0on 22/3389 - Make the check required in branch policies
- Azure Policy deny for management ports from Internet as a backstop
- 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."
More on CI/CD and IaC
Design a GitHub Actions pipeline that builds an image, pushes to ACR and deploys to AKS with no secrets.IntermediateYour organisation uses Azure DevOps. Set up a secure deployment pipeline to AKS.IntermediateYou need to promote the same image from dev to staging to prod. How do you design it?IntermediateTerraform state for prod is in a storage account accessible with account keys. Harden it.IntermediateYour team wants to move from ARM JSON templates to Bicep. How do you migrate?BeginnerA pipeline needs to deploy to dev, test and prod in different subscriptions. How do you handle identities?Advanced