|
@@ -3,34 +3,34 @@
|
|
|
###################
|
|
|
# HoneyPot Instance
|
|
|
resource "aws_instance" "honeypot" {
|
|
|
- ami = "${data.aws_ami.ubuntu.id}"
|
|
|
+ ami = data.aws_ami.ubuntu.id
|
|
|
# ami = "${data.aws_ami.centos7.id}"
|
|
|
- instance_type = "${var.Honeypot-Instance-Type}"
|
|
|
- availability_zone = "${data.aws_availability_zones.available.names[0]}"
|
|
|
- subnet_id = "${aws_subnet.subnet_Honeypot.id}"
|
|
|
- private_ip = "${var.Honeypot-IP-Secured}"
|
|
|
- ebs_optimized = "${var.EBS-Optimized}"
|
|
|
+ instance_type = var.Honeypot-Instance-Type
|
|
|
+ availability_zone = data.aws_availability_zones.available.names[0]
|
|
|
+ subnet_id = aws_subnet.subnet_Honeypot.id
|
|
|
+ private_ip = var.Honeypot-IP-Secured
|
|
|
+ ebs_optimized = var.EBS-Optimized
|
|
|
disable_api_termination = false
|
|
|
associate_public_ip_address = true
|
|
|
instance_initiated_shutdown_behavior = "terminate"
|
|
|
- key_name = "${var.AWS-Key-Pair-Name}"
|
|
|
- vpc_security_group_ids = ["${aws_security_group.sg_honeypot_secured_access.id}"]
|
|
|
- depends_on = ["aws_internet_gateway.gw_primary"]
|
|
|
+ key_name = var.AWS-Key-Pair-Name
|
|
|
+ vpc_security_group_ids = [ aws_security_group.sg_honeypot_secured_access.id ]
|
|
|
+ depends_on = [ aws_internet_gateway.gw_primary ]
|
|
|
|
|
|
- tags {
|
|
|
+ tags = {
|
|
|
Name = "honeypot"
|
|
|
}
|
|
|
|
|
|
root_block_device {
|
|
|
- volume_type = "${ var.Default-Volume-Type }"
|
|
|
- volume_size = "${ var.Honeypot-Volume-Size }" # Gigabytes
|
|
|
+ volume_type = var.Default-Volume-Type
|
|
|
+ volume_size = var.Honeypot-Volume-Size # Gigabytes
|
|
|
delete_on_termination = true
|
|
|
}
|
|
|
|
|
|
ebs_block_device {
|
|
|
device_name = "/dev/sdd"
|
|
|
- volume_size = "${var.Swap-Volume-Size}"
|
|
|
- volume_type = "${var.Swap-Volume-Type}"
|
|
|
+ volume_size = var.Swap-Volume-Size
|
|
|
+ volume_type = var.Swap-Volume-Type
|
|
|
delete_on_termination = true
|
|
|
}
|
|
|
|
|
@@ -77,12 +77,12 @@ EOF
|
|
|
|
|
|
# Create the "bad" network interface
|
|
|
resource "aws_network_interface" "honeypot_if" {
|
|
|
- subnet_id = "${aws_subnet.subnet_Honeypot.id}"
|
|
|
- security_groups = ["${aws_security_group.sg_all_open.id}"]
|
|
|
- private_ips = ["${var.Honeypot-IP-Unsecured}"]
|
|
|
+ subnet_id = aws_subnet.subnet_Honeypot.id
|
|
|
+ security_groups = [aws_security_group.sg_all_open.id]
|
|
|
+ private_ips = [var.Honeypot-IP-Unsecured]
|
|
|
|
|
|
attachment {
|
|
|
- instance = "${aws_instance.honeypot.id}"
|
|
|
+ instance = aws_instance.honeypot.id
|
|
|
device_index = 1
|
|
|
}
|
|
|
}
|
|
@@ -90,35 +90,35 @@ resource "aws_network_interface" "honeypot_if" {
|
|
|
# Give bad interface an EIP
|
|
|
resource "aws_eip" "eip_honeypot" {
|
|
|
vpc = true
|
|
|
- network_interface = "${aws_network_interface.honeypot_if.id}"
|
|
|
+ network_interface = aws_network_interface.honeypot_if.id
|
|
|
}
|
|
|
|
|
|
|
|
|
# Give me the IP Addresses
|
|
|
output "honeypot_mgmt_ip" {
|
|
|
- value = "${aws_instance.honeypot.public_ip}"
|
|
|
+ value = aws_instance.honeypot.public_ip
|
|
|
}
|
|
|
|
|
|
output "honeypot_untrusted_ip" {
|
|
|
- value = "${aws_eip.eip_honeypot.public_ip}"
|
|
|
+ value = aws_eip.eip_honeypot.public_ip
|
|
|
}
|
|
|
|
|
|
# Give me DNS entries
|
|
|
resource "aws_route53_record" "honeypot" {
|
|
|
- zone_id = "${var.Domain-Zone-ID}"
|
|
|
+ zone_id = var.Domain-Zone-ID
|
|
|
name = "honeypot.lab.${var.Domain-Name}"
|
|
|
type = "A"
|
|
|
ttl = "300"
|
|
|
- records = ["${aws_instance.honeypot.public_ip}"]
|
|
|
+ records = [ aws_instance.honeypot.public_ip ]
|
|
|
}
|
|
|
resource "aws_route53_record" "honeypot_pvt" {
|
|
|
- zone_id = "${var.Domain-Zone-ID}"
|
|
|
+ zone_id = var.Domain-Zone-ID
|
|
|
name = "honeypot_pvt.lab.${var.Domain-Name}"
|
|
|
type = "A"
|
|
|
ttl = "300"
|
|
|
- records = ["${aws_instance.honeypot.private_ip}"]
|
|
|
+ records = [aws_instance.honeypot.private_ip]
|
|
|
}
|
|
|
output "honeypot_dns" {
|
|
|
- value = "${aws_route53_record.honeypot.name}"
|
|
|
+ value = aws_route53_record.honeypot.name
|
|
|
}
|
|
|
|