๐บCode Like Hacker : Secure Terraform Practices
This contains cloud Native Meetup code snippets
Admin access should be restricted from the specific IP
An ingress rule allowing all inbound SSH traffic for AWS:
// Non-compliant code
resource "aws_security_group" "noncompliant" {
name = "allow_ssh_noncompliant"
description = "allow_ssh_noncompliant"
vpc_id = aws_vpc.main.id
ingress {
description = "SSH rule"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"] # Noncompliant
}
}A security rule allowing all inbound SSH traffic for Azure
Compliant Solution
An ingress rule allowing inbound SSH traffic from specific IP addresses for AWS:
A security rule allowing inbound SSH traffic from specific IP addresses for Azure
Last updated