Menu

Passing terraform validate Doesn't Mean Your Infrastructure Is Secure
📰

Passing terraform validate Doesn't Mean Your Infrastructure Is Secure

DEV Community: terraform·Guilherme Marochio·7 days ago
#spICkuss
Reading 0:00
15s threshold

Terraform makes infrastructure provisioning repeatable, consistent, and easier to manage.

But there is an important distinction that infrastructure teams should keep in mind:

A Terraform configuration can be syntactically valid and still introduce serious security risks.

terraform fmt helps keep configurations properly formatted, and terraform validate checks whether the configuration is structurally valid. Neither one is designed to perform a complete security review of your infrastructure.

Here are a few examples worth checking before deploying.

1. Security groups exposing sensitive ports

Consider this Terraform configuration:

resource "aws_security_group_rule" "ssh" { type = "ingress" from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = [ "0.0.0.0/0" ] security_group_id = aws_security_group . example .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.