Skip to main content
senior
advanced
Security

Compliance and Governance in Cloud

Question

How do you implement compliance and governance controls in a cloud-native environment?

Answer

Cloud compliance involves policies, automation, and audit capabilities. Key components: 1) Policy-as-code (OPA/Gatekeeper, AWS SCPs) to enforce rules automatically. 2) Tagging standards for resource ownership/cost tracking. 3) Centralized logging and audit trails. 4) Network segmentation and least-privilege IAM. 5) Encryption at rest and in transit. 6) Regular compliance scanning (Prowler, ScoutSuite). 7) Change management processes. Frameworks to consider: SOC2, HIPAA, PCI-DSS, GDPR depending on industry. Shift compliance left - catch violations before deployment.

Why This Matters

Compliance isn't just checkbox exercises - it's about building secure, auditable systems. Cloud makes compliance both easier (APIs for everything) and harder (velocity of change). Modern approaches embed compliance into CI/CD: policy checks in pipelines, infrastructure scanning, and continuous monitoring. The goal is making compliant the default, not an afterthought.

Code Examples

OPA Gatekeeper policy

yaml

AWS Service Control Policy

hcl
Common Mistakes
  • Treating compliance as a one-time project instead of continuous process
  • Relying solely on manual reviews that can't scale
  • Not documenting exceptions and their justifications
Follow-up Questions
Interviewers often ask these as follow-up questions
  • How do you handle compliance in a rapidly changing environment with frequent deployments?
  • What is the difference between preventive and detective controls?
  • How do you prepare for and conduct compliance audits?
Tags
compliance
governance
security
policy
cloud