Conversation
| resource "aws_instance" "web" { | ||
| ami = data.aws_ami.ubuntu.id | ||
| instance_type = "t2.micro" | ||
| vpc_security_group_ids = [aws_security_group.web-sg.id] | ||
|
|
||
| user_data = <<-EOF | ||
| #!/bin/bash | ||
| apt-get update | ||
| apt-get install -y apache2 | ||
| sed -i -e 's/80/8080/' /etc/apache2/ports.conf | ||
| echo "Hello World" > /var/www/html/index.html | ||
| systemctl restart apache2 | ||
| EOF | ||
| } |
Check failure
Code scanning / defsec
Instance with unencrypted block device.
| resource "aws_instance" "web" { | ||
| ami = data.aws_ami.ubuntu.id | ||
| instance_type = "t2.micro" | ||
| vpc_security_group_ids = [aws_security_group.web-sg.id] | ||
|
|
||
| user_data = <<-EOF | ||
| #!/bin/bash | ||
| apt-get update | ||
| apt-get install -y apache2 | ||
| sed -i -e 's/80/8080/' /etc/apache2/ports.conf | ||
| echo "Hello World" > /var/www/html/index.html | ||
| systemctl restart apache2 | ||
| EOF | ||
| } |
Check failure
Code scanning / defsec
aws_instance should activate session tokens for Instance Metadata Service.
| resource "aws_security_group" "web-sg" { | ||
| name = "${random_pet.sg.id}-sg" | ||
| ingress { | ||
| from_port = 8080 | ||
| to_port = 8080 | ||
| protocol = "tcp" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` | ||
| egress { | ||
| from_port = 0 | ||
| to_port = 0 | ||
| protocol = "-1" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
Check failure
Code scanning / defsec
An egress security group rule allows traffic to /0.
| resource "aws_security_group" "web-sg" { | ||
| name = "${random_pet.sg.id}-sg" | ||
| ingress { | ||
| from_port = 8080 | ||
| to_port = 8080 | ||
| protocol = "tcp" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` | ||
| egress { | ||
| from_port = 0 | ||
| to_port = 0 | ||
| protocol = "-1" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
Check failure
Code scanning / defsec
An ingress security group rule allows traffic from /0.
| resource "aws_security_group" "web-sg" { | ||
| name = "${random_pet.sg.id}-sg" | ||
| ingress { | ||
| from_port = 8080 | ||
| to_port = 8080 | ||
| protocol = "tcp" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` | ||
| egress { | ||
| from_port = 0 | ||
| to_port = 0 | ||
| protocol = "-1" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
Check notice
Code scanning / defsec
Missing description for security group.
| resource "aws_security_group" "web-sg" { | ||
| name = "${random_pet.sg.id}-sg" | ||
| ingress { | ||
| from_port = 8080 | ||
| to_port = 8080 | ||
| protocol = "tcp" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` | ||
| egress { | ||
| from_port = 0 | ||
| to_port = 0 | ||
| protocol = "-1" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
Check notice
Code scanning / defsec
Missing description for security group rule.
| resource "aws_security_group" "web-sg" { | ||
| name = "${random_pet.sg.id}-sg" | ||
| ingress { | ||
| from_port = 8080 | ||
| to_port = 8080 | ||
| protocol = "tcp" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| // connectivity to ubuntu mirrors is required to run `apt-get update` and `apt-get install apache2` | ||
| egress { | ||
| from_port = 0 | ||
| to_port = 0 | ||
| protocol = "-1" | ||
| cidr_blocks = ["0.0.0.0/0"] | ||
| } | ||
| } |
Check notice
Code scanning / defsec
Missing description for security group rule.
No description provided.