Repository | ned1313 / Getting-Started-Terraform |
Description | Exercise files for my Pluralsight course |
Stars | 520 |
---|---|
Failed Checks |
Security Scanning |
Scan Date | 2023-10-30 17:57:40 |
Security Scanning
This repository failed the Experience Builder Terraform Module's Security Scanning validation. This means that a security scanning tool was not found to be implemented in any of the CICD tool configuration files in the repository.
There is an opportunity to:
- Remediate the findings identified by one of the recommended
Terraform security scanning tools (example
checkov
output found below) - Implement one of the security scanning tools within the CICD framework used by the repository
Checkov Output
2023-10-05 14:45:24,584 [MainThread ] [WARNI] Failed to download module terraform-aws-modules/vpc/aws:4.0.2 (for external modules, the --download-external-modules flag is required)
2023-10-05 14:45:24,683 [MainThread ] [WARNI] Module /home/brett/smallbets/ladoj/gh_scraper/tfcheck/Getting-Started-Terraform/m8_solution/modules/globo-webapp-s3:latest failed to load via
2023-10-05 14:45:24,698 [MainThread ] [WARNI] Unable to load module - source: /home/brett/smallbets/ladoj/gh_scraper/tfcheck/Getting-Started-Terraform/m8_solution/modules/globo-webapp-s3, version: latest, error: /home/brett/smallbets/ladoj/gh_scraper/tfcheck/Getting-Started-Terraform/m8_solution/modules/globo-webapp-s3
terraform scan results:
Passed checks: 148, Failed checks: 129, Skipped checks: 0
Check: CKV_AWS_130: "Ensure VPC subnets do not assign public IP by default"
FAILED for resource: aws_subnet.public_subnet1
File: /base_web_app/main.tf:35-39
Guide: https://docs.paloaltonetworks.com/content/techdocs/en_US/prisma/prisma-cloud/prisma-cloud-code-security-policy-reference/aws-policies/aws-networking-policies/ensure-vpc-subnets-do-not-assign-public-ip-by-default.html
35 | resource "aws_subnet" "public_subnet1" {
36 | cidr_block = "10.0.0.0/24"
37 | vpc_id = aws_vpc.app.id
38 | map_public_ip_on_launch = true
39 | }
Check: CKV_AWS_23: "Ensure every security groups rule has a description"
FAILED for resource: aws_security_group.nginx_sg
File: /base_web_app/main.tf:58-77
Guide: https://docs.paloaltonetworks.com/content/techdocs/en_US/prisma/prisma-cloud/prisma-cloud-code-security-policy-reference/aws-policies/aws-networking-policies/networking-31.html
58 | resource "aws_security_group" "nginx_sg" {
59 | name = "nginx_sg"
60 | vpc_id = aws_vpc.app.id
61 |
62 | # HTTP access from anywhere
63 | ingress {
64 | from_port = 80
65 | to_port = 80
66 | protocol = "tcp"
67 | cidr_blocks = ["0.0.0.0/0"]
68 | }
69 |
70 | # outbound internet access
71 | egress {
72 | from_port = 0
73 | to_port = 0
74 | protocol = "-1"
75 | cidr_blocks = ["0.0.0.0/0"]
76 | }
77 | }
Check: CKV_AWS_260: "Ensure no security groups allow ingress from 0.0.0.0:0 to port 80"
FAILED for resource: aws_security_group.nginx_sg
File: /base_web_app/main.tf:58-77
Guide: https://docs.paloaltonetworks.com/content/techdocs/en_US/prisma/prisma-cloud/prisma-cloud-code-security-policy-reference/aws-policies/aws-networking-policies/ensure-aws-security-groups-do-not-allow-ingress-from-00000-to-port-80.html
58 | resource "aws_security_group" "nginx_sg" {
59 | name = "nginx_sg"
60 | vpc_id = aws_vpc.app.id
61 |
62 | # HTTP access from anywhere
63 | ingress {
64 | from_port = 80
65 | to_port = 80
66 | protocol = "tcp"
67 | cidr_blocks = ["0.0.0.0/0"]
68 | }
69 |
70 | # outbound internet access
71 | egress {
72 | from_port = 0
73 | to_port = 0
74 | protocol = "-1"
75 | cidr_blocks = ["0.0.0.0/0"]
76 | }
77 | }
Check: CKV_AWS_126: "Ensure that detailed monitoring is enabled for EC2 instances"
FAILED for resource: aws_instance.nginx1
File: /base_web_app/main.tf:80-94
Guide: https://docs.paloaltonetworks.com/content/techdocs/en_US/prisma/prisma-cloud/prisma-cloud-code-security-policy-reference/aws-policies/aws-logging-policies/ensure-that-detailed-monitoring-is-enabled-for-ec2-instances.html
80 | resource "aws_instance" "nginx1" {
81 | ami = nonsensitive(data.aws_ssm_parameter.amzn2_linux.value)
82 | instance_type = "t3.micro"
83 | subnet_id = aws_subnet.public_subnet1.id
84 | vpc_security_group_ids = [aws_security_group.nginx_sg.id]
85 |
86 | user_data = <Taco Team Server You did it! Have a 🌮