network_acl.j 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {% import 'variables.include' as var %}
  2. ##########
  3. # Network ACLs enforce the basic rules of the topology, and are
  4. # further refined by security groups on instances.
  5. #
  6. # Topology has two "public" subnets (in different AZs) for
  7. # servers such as searchheads and HECs that are accessible publicly.
  8. #
  9. # It was two "private" subnets (in different AZs) for
  10. # servers such as indexers that aren't publicly available.
  11. #
  12. # The two AZ's can talk to each other.
  13. # The public subnets can be accessed by any service/source
  14. # allowed by the security group.
  15. # The private subnets are only accessible by the public
  16. # subnets, and port 22 from anywhere.
  17. #
  18. # Network ACLs allow all outbound. This should be restricted
  19. # via security groups to only those ports needed.
  20. resource "aws_network_acl" "acl_public" {
  21. vpc_id = "${aws_vpc.vpc_primary.id}"
  22. subnet_ids = ["${aws_subnet.subnet_Splunk.id}", "${aws_subnet.subnet_Honeypot.id}"]
  23. egress {
  24. protocol = "-1"
  25. rule_no = 10
  26. action = "allow"
  27. cidr_block = "0.0.0.0/0"
  28. from_port = 0
  29. to_port = 0
  30. }
  31. ingress {
  32. protocol = "-1"
  33. rule_no = 10
  34. action = "allow"
  35. cidr_block = "0.0.0.0/0"
  36. from_port = 0
  37. to_port = 0
  38. }
  39. tags = {
  40. Name = "Public Subnets"
  41. }
  42. }
  43. #resource "aws_network_acl" "acl_private" {
  44. # vpc_id = "${aws_vpc.vpc_primary.id}"
  45. # subnet_ids = ["${aws_subnet.subnet_private_a.id}", "${aws_subnet.subnet_private_b.id}"]
  46. # egress {
  47. # protocol = "-1"
  48. # rule_no = 10
  49. # action = "allow"
  50. # cidr_block = "0.0.0.0/0"
  51. # from_port = 0
  52. # to_port = 0
  53. # }
  54. #
  55. # ingress {
  56. # protocol = "-1"
  57. # rule_no = 10
  58. # action = "allow"
  59. # cidr_block = "${var.VPC-Subnet}"
  60. # from_port = 0
  61. # to_port = 0
  62. # }
  63. #
  64. # ingress {
  65. # protocol = "icmp"
  66. # rule_no = 20
  67. # action = "allow"
  68. # cidr_block = "0.0.0.0/0"
  69. # icmp_type = 8
  70. # from_port = 0
  71. # to_port = 0
  72. # }
  73. #
  74. # ingress {
  75. # protocol = "tcp"
  76. # rule_no = 30
  77. # action = "allow"
  78. # cidr_block = "0.0.0.0/0"
  79. # from_port = 22
  80. # to_port = 22
  81. # }
  82. #
  83. # tags {
  84. # Name = "Private Subnets"
  85. # }
  86. #}
  87. #