1. What is the purpose of Policy as Code in IaC security?
Policy as Code ensures that security and compliance requirements are automated and consistent. Tools like HashiCorp Sentinel or Open Policy Agent evaluate infrastructure plans against organizational rules, such as enforcing encryption, disallowing public buckets, or requiring tags. This helps prevent misconfigurations before reaching production.