In the previous post I used Trivy to scan container images. But an image is only part of what we ship. The rest is the infrastructure around it: security groups, S3 buckets, databases. If you write that in Terraform, the same tool can check it too.
What does an IaC scan look for?
An image scan looks for known vulnerabilities in software, like an old OpenSSL version.
An IaC scan looks for risky settings in your infrastructure code. Trivy calls these misconfigurations . The code works fine. It just does something you probably don't want, for example:
a security group that allows SSH from anywhere,
an S3 bucket with no public access block,
an RDS instance with unencrypted storage.
Trivy reads your .tf files and checks them against its built-in rules.β¦