-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurity.tf
More file actions
53 lines (53 loc) · 1.24 KB
/
Copy pathsecurity.tf
File metadata and controls
53 lines (53 loc) · 1.24 KB
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
resource "aws_security_group" "sg_netbox" {
name = "sg_netbox"
description = "Created with Terraform - allow all outgoing traffic"
# allow internet access, but block all incoming traffic
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["${var.cidr_block_internet}"]
}
# allow sshd connection
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${var.cidr_block_internet}"]
}
# allow outbound traffic
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
# allow http traffic
ingress {
cidr_blocks = ["0.0.0.0/0"]
from_port = 80
protocol = "tcp"
to_port = 80
}
# allow http traffic
ingress {
cidr_blocks = ["0.0.0.0/0"]
from_port = 8080
protocol = "tcp"
to_port = 8080
}
# allow https traffic
ingress {
cidr_blocks = ["0.0.0.0/0"]
from_port = 443
protocol = "tcp"
to_port = 443
}
# allow netbox traffic
ingress {
cidr_blocks = ["0.0.0.0/0"]
from_port = 2377
protocol = "tcp"
to_port = 2377
}
}