When infrastructure is described in code, its security properties are visible in a file before anything exists. An IaC scanner parses those files and evaluates each declared resource against a catalog of rules: a storage bucket with a public ACL, a security group open to 0.0.0.0/0 on SSH, a container that runs as root or with privileged: true, a database without encryption at rest. Rules are typically written in a policy language and identified by stable IDs, and many map to published hardening guidance such as CIS Benchmarks.
How it is used in practice
IaC scanning is one of the cheapest controls in a shift-left programme. It runs in pull requests and CI against the repository that holds the infrastructure definitions, and its findings name a file, a line range and a resource, so the fix is a code change reviewed like any other. It complements CSPM, which inspects what is actually deployed in the cloud, and admission control, which judges a workload at the moment a cluster is asked to run it. Organizations often keep an approved set of rule overrides for risks they have mitigated elsewhere.
Common pitfalls
- Silent gaps in coverage. A scanner with no analyzer for a file type reports nothing for it, which reads exactly like "clean". Know which formats your tool actually parses.
- Templated configuration. Helm values, Terraform modules and variables can change the rendered result; scanning only the template can miss what is deployed.
- Drift. IaC describes intent. Someone changing a resource in the console means the code and the cloud disagree, which only runtime posture checks see.
- Suppressing instead of overriding. Silencing a finding hides its recurrences; changing a rule's severity for a documented reason keeps them visible.
- Line-number identity. If a finding's identity includes its line number, inserting a line above it creates a "new" finding and loses its history.
How TrustIvan relates to it
TrustIvan's misconfiguration scanning is opt-in per scan against a repository or filesystem target. It embeds an open-source misconfiguration engine as a library and runs offline against that engine's bundled rule set, which the IaC scanning documentation names. Dockerfiles, Terraform, Kubernetes manifests, Helm charts and CloudFormation are each proven by a fixture test that also requires a clean file to produce nothing, and Azure ARM templates and Ansible playbooks each have their own fixture test with an insecure and a fixed file. docker-compose files are not a supported target, and the docs say so. Each finding carries the file, line range, resolved resource, rule ID and a written resolution. Severity overrides are set per organization with a recorded reason, and finding identity uses the rule and resource, never the line. See IaC scanning.
Related terms
- CSPM (cloud security posture management) Cloud security posture management (CSPM) is the continuous inspection of deployed cloud accounts, through the providers' own APIs, for misconfigurations and risky settings such as public storage, open network rules and over-broad IAM grants.
- CIS Benchmarks CIS Benchmarks are consensus-developed secure configuration guidelines, published by the Center for Internet Security, for operating systems, cloud platforms, Kubernetes, databases and other technologies.
- Policy as code Policy as code is the practice of expressing security, compliance and operational rules as machine-readable definitions that are versioned, reviewed and evaluated automatically, rather than as prose in a document.
- Admission control (Kubernetes) Admission control is the stage of the Kubernetes API server that intercepts a request to create or change an object, after authentication and authorization, and can accept, modify or reject it before it is stored.
- Shift left Shift left is the practice of moving security checks earlier in the software delivery process, into design, coding, pull requests and CI, so that problems are found when they are cheapest and quickest to fix.
Guides on IaC scanning
- Finding and Rotating Secrets Leaked into Git History A secret deleted in a later commit is still leaked. Scan the whole git history, rotate in the right order, check for use, and know when a rewrite helps.
- TrustIvan vs. Running Trivy Yourself TrustIvan’s detection is Trivy, the same open-source engine anyone can run free. What TrustIvan adds on top, and when running Trivy alone is the right call.
- Policy as Code for Release Gates: Fail Builds on What Matters A release gate that fails on every critical gets switched off. Write a policy that blocks exploited, fixable risk, warns on the rest and explains itself.
On the platform: Container scanning. All glossary terms