2019-06-25 15:33:56 +00:00
|
|
|
provider "aws" {
|
|
|
|
region = var.ec2_region
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_security_group" "tpot" {
|
|
|
|
name = "T-Pot"
|
|
|
|
description = "T-Pot Honeypot"
|
|
|
|
vpc_id = var.ec2_vpc_id
|
|
|
|
ingress {
|
|
|
|
from_port = 0
|
|
|
|
to_port = 64000
|
2019-06-25 15:42:04 +00:00
|
|
|
protocol = "tcp"
|
2019-06-25 15:33:56 +00:00
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
ingress {
|
2019-06-25 15:42:54 +00:00
|
|
|
from_port = 0
|
|
|
|
to_port = 64000
|
|
|
|
protocol = "udp"
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
ingress {
|
2019-06-25 15:33:56 +00:00
|
|
|
from_port = 64294
|
|
|
|
to_port = 64294
|
|
|
|
protocol = "tcp"
|
|
|
|
cidr_blocks = var.admin_ip
|
|
|
|
}
|
|
|
|
ingress {
|
|
|
|
from_port = 64295
|
|
|
|
to_port = 64295
|
|
|
|
protocol = "tcp"
|
|
|
|
cidr_blocks = var.admin_ip
|
|
|
|
}
|
|
|
|
ingress {
|
|
|
|
from_port = 64297
|
|
|
|
to_port = 64297
|
|
|
|
protocol = "tcp"
|
|
|
|
cidr_blocks = var.admin_ip
|
|
|
|
}
|
|
|
|
egress {
|
|
|
|
from_port = 0
|
|
|
|
to_port = 0
|
|
|
|
protocol = "-1"
|
|
|
|
cidr_blocks = ["0.0.0.0/0"]
|
|
|
|
}
|
|
|
|
tags = {
|
|
|
|
Name = "T-Pot"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "aws_instance" "tpot" {
|
|
|
|
ami = var.ec2_ami[var.ec2_region]
|
|
|
|
instance_type = var.ec2_instance_type
|
|
|
|
key_name = var.ec2_ssh_key_name
|
|
|
|
subnet_id = var.ec2_subnet_id
|
|
|
|
tags = {
|
|
|
|
Name = "T-Pot Honeypot"
|
|
|
|
}
|
|
|
|
root_block_device {
|
|
|
|
volume_type = "gp2"
|
|
|
|
volume_size = 128
|
|
|
|
delete_on_termination = true
|
|
|
|
}
|
|
|
|
user_data = "${file("../cloud-init.yaml")} content: ${base64encode(file("../tpot.conf"))}"
|
|
|
|
vpc_security_group_ids = [aws_security_group.tpot.id]
|
2019-10-02 19:34:47 +00:00
|
|
|
associate_public_ip_address = true
|
2019-06-25 15:33:56 +00:00
|
|
|
}
|