Testing Azure infrastructure compliance with Chef InSpec
One of the important practices of DevOps culture is IaC, detailed in Chapter 1, The DevOps Culture and Infrastructure as Code Practices, which consists of coding the configuration of an infrastructure and then being automatically deployed via CI/CD pipelines. IaC allows cloud infrastructure to be deployed and provisioned very quickly, but the question that often arises is: Does the automatically provisioned infrastructure meet functional compliance and security requirements?
To answer this question, we'll have to write and automate infrastructure tests that will verify the following:
- The infrastructure deployed corresponds well to the application and enterprise architecture specifications.
- The company's security policies are properly applied to the infrastructure.
These tests can be written in any scripting language that can interact with our cloud provider, and if we have an Azure subscription...