-
Notifications
You must be signed in to change notification settings - Fork 1
/
security_groups.tf
107 lines (97 loc) · 3.19 KB
/
security_groups.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
resource "aws_security_group" "splunk_ent" {
name = "splunk-ent-automate-sg-${random_id.random.hex}"
vpc_id = aws_vpc.splunk_vpc.id
tags = merge(
local.common_tags,
{
"Name" = "splunk-ent-automate-sg-${random_id.random.hex}"
}
)
}
resource "aws_security_group_rule" "splunk_ent_ingress_allow_22_tcp" {
type = "ingress"
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk Rules
resource "aws_security_group_rule" "splunk_ent_ingress_allow_80_tcp" {
type = "ingress"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
resource "aws_security_group_rule" "splunk_ent_ingress_allow_443_tcp" {
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk Kv Store
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8191_tcp" {
type = "ingress"
from_port = 8191
to_port = 8191
protocol = "tcp"
security_group_id = aws_security_group.splunk_ent.id
source_security_group_id = aws_security_group.splunk_ent.id
}
# Splunk App Svr
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8065_tcp" {
type = "ingress"
from_port = 8065
to_port = 8065
protocol = "tcp"
security_group_id = aws_security_group.splunk_ent.id
source_security_group_id = aws_security_group.splunk_ent.id
}
resource "aws_security_group_rule" "splunk_ent_egress_allow_all" {
type = "egress"
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk Mgmt Port
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8089_tcp" {
type = "ingress"
from_port = 8089
to_port = 8089
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk Web UI
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8000_tcp" {
type = "ingress"
from_port = 8000
to_port = 8000
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk H
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8080_tcp" {
type = "ingress"
from_port = 8080
to_port = 8080
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}
# Splunk HEC
resource "aws_security_group_rule" "splunk_ent_ingress_allow_8088_tcp" {
type = "ingress"
from_port = 8088
to_port = 8088
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.splunk_ent.id
}