-
Notifications
You must be signed in to change notification settings - Fork 0
/
unused_public_security_group.tf
153 lines (130 loc) · 4 KB
/
unused_public_security_group.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# Security group for the public networks
resource "aws_security_group" "public" {
name = "public ACL"
vpc_id = module.network.vpc_id
description = "Sec group for the public subnets"
tags = {
Name = "public_acl"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_http_all" {
security_group_id = aws_security_group.public.id
description = "Allow HTTP"
from_port = 80
to_port = 80
ip_protocol = "tcp"
cidr_ipv4 = "0.0.0.0/0"
tags = {
Name = "public_allow_http_all"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_https_all" {
security_group_id = aws_security_group.public.id
description = "Allow HTTPS"
from_port = 443
to_port = 443
ip_protocol = "tcp"
cidr_ipv4 = "0.0.0.0/0"
tags = {
Name = "public_allow_https_all"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_ssh_epfl" {
security_group_id = aws_security_group.public.id
description = "Allow SSH from EPFL"
from_port = 22
to_port = 22
ip_protocol = "tcp"
cidr_ipv4 = var.epfl_cidr
tags = {
Name = "public_allow_ssh_epfl"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_ssh_internal" {
security_group_id = aws_security_group.public.id
description = "Allow SSH from internal"
from_port = 22
to_port = 22
ip_protocol = "tcp"
cidr_ipv4 = module.network.vpc_cidr_block
tags = {
Name = "public_allow_ssh_internal"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_ssh_bbpproxy" {
security_group_id = aws_security_group.public.id
description = "Allow SSH from bbpproxy"
from_port = 22
to_port = 22
ip_protocol = "tcp"
cidr_ipv4 = var.bbpproxy_cidr
tags = {
Name = "public_allow_ssh_bbpproxy"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_brayns_epfl" {
security_group_id = aws_security_group.public.id
description = "Allow Brayns on port 5000 from EPFL"
from_port = 5000
to_port = 5000
ip_protocol = "tcp"
cidr_ipv4 = var.epfl_cidr
tags = {
Name = "public_allow_5000_epfl"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_bcsb_epfl" {
security_group_id = aws_security_group.public.id
description = "Allow BCSB on port 8000 from EPFL"
from_port = 8000
to_port = 8000
ip_protocol = "tcp"
cidr_ipv4 = var.epfl_cidr
tags = {
Name = "public_allow_8000_epfl"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_vsm_epfl" {
security_group_id = aws_security_group.public.id
description = "Allow VSM on port 4444 from EPFL"
from_port = 4444
to_port = 4444
ip_protocol = "tcp"
cidr_ipv4 = var.epfl_cidr
tags = {
Name = "public_allow_4444_epfl"
}
}
resource "aws_vpc_security_group_ingress_rule" "public_allow_vsm_proxy_epfl" {
security_group_id = aws_security_group.public.id
description = "Allow VSM-Proxy on port 8888 from EPFL"
from_port = 8888
to_port = 8888
ip_protocol = "tcp"
cidr_ipv4 = var.epfl_cidr
tags = {
Name = "public_allow_8888_epfl"
}
}
/* Was used during debugging network issues
resource "aws_vpc_security_group_ingress_rule" "public_allow_everything" {
security_group_id = aws_security_group.public.id
description = "Allow everything - not recommended"
from_port = 0
to_port = 0
ip_protocol = -1
cidr_ipv4 = ["0.0.0.0/0"]
tags = {
Name = "public_allow_ssh_internal"
}
}
*/
resource "aws_vpc_security_group_egress_rule" "public_allow_everything_outgoing" {
security_group_id = aws_security_group.public.id
description = "Allow everything outgoing"
ip_protocol = -1
cidr_ipv4 = "0.0.0.0/0"
tags = {
Name = "public_allow_everything_outgoing"
}
}