forked from dockersamples/example-voting-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbad_code.tf
43 lines (35 loc) · 831 Bytes
/
bad_code.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
provider "aws" {
region = "us-west-2"
}
resource "aws_security_group" "bad_sg" {
name = "bad_security_group"
description = "Security group with overly permissive rules"
vpc_id = "vpc-123456"
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_s3_bucket" "bad_bucket" {
bucket = "bad-bucket"
acl = "public-read" # S3 bucket with public read access
}
resource "aws_instance" "bad_instance" {
ami = "ami-123456"
instance_type = "t2.micro"
user_data = <<-EOF
#!/bin/bash
echo "This is a test" > /tmp/test.txt
EOF
tags = {
Name = "BadInstance"
}
}