A Terraform module is a reusable infrastructure-as-code package that groups Terraform resources, variables, and outputs into a repeatable building block. Teams use modules to define cloud networks, compute, identity, and other services in a consistent way instead of writing every resource from scratch.
Modules matter in cyber security because they sit inside the provisioning path. If a module is trusted, updated, or fetched from a registry without strong integrity controls, attackers may be able to influence what infrastructure gets created or what code runs during setup. In practice, that can expose secrets, alter permissions, or change network boundaries before anyone notices. Defenders reduce this risk by pinning versions, verifying module sources, reviewing module code, limiting automation privileges, and monitoring registry and DNS activity for unexpected changes. In supply-chain attacks, a compromised module can become a fast route from configuration management to cloud compromise.


