Open
Conversation
Comment on lines
+45
to
+58
| 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.
Comment on lines
+45
to
+58
| 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.
Comment on lines
60
to
75
| 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.
Comment on lines
60
to
75
| 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.
Comment on lines
60
to
75
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.