Skip to content

Commit 8de5933

Browse files
committed
preparatory refactor before module is submitted into the terraform registry
1 parent 5acc8ac commit 8de5933

10 files changed

+11
-40568
lines changed

Dockerfile

-38
This file was deleted.

IANA-port-numbers-list.csv

-14,963
This file was deleted.

IANA-port-numbers-list.txt

-24,158
This file was deleted.

Jenkinsfile

-37
This file was deleted.
File renamed without changes.

security.group-known.ports.md

-1,220
This file was deleted.

security.group-outputs.tf

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
################ ################################################## ########
3-
################ Module [[[security group]]] Output Variables List. ########
4-
################ ################################################## ########
5-
6-
72
/*
83
| --
94
| -- Return the ID of the rule aggregating security goup bucket.
@@ -13,4 +8,5 @@ output out_security_group_id {
138

149
description = "The string ID of either the default security group or the just created new one."
1510
value = "${ aws_security_group.new.id }"
11+
type = string
1612
}

security.group-rules.tf

+4-142
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
11

2-
# -- ############################ -- #
3-
# -- How to Add New Traffic Rules -- #
4-
# -- ############################ -- #
5-
6-
# -- In order to add new rules be informed that
7-
# --
8-
# -- - lists are in the form [ port-from, port-to, protocol, description ]
9-
# -- - the first two elements are integers and the final two are strings
10-
# -- - it pays to be conservative with the description characters and length
11-
# -- - ports can range from 0 to one less than 2^16 (which is 65,535)
12-
# -- - a -1 port signals that all ports are to be allowed (disallowed)
13-
# -- - the protocol can be one of [ tcp, udp, icmp, all ]
14-
# -- - the protocol can also be one of a small set of numbers
15-
16-
# -- Note that if you create an all traffic egress rule and you have an
17-
# -- IPV6 Cidr block another will be created to ::/0 in addition to the
18-
# -- one with the 0.0.0.0/0 (IPV4) notation.
19-
202
/*
21-
type = object({
22-
http = list(string)
23-
all-traffic = list(string)
24-
ecs = list(string)
25-
docker = list(string)
26-
java = list(string)
27-
jenkins = list(string)
28-
sonar = list(string)
29-
postgres = list(string)
30-
})
3+
| --
4+
| -- This list of security group rules can be overriden and you can provide
5+
| -- your own rule port number mappings.
6+
| --
317
*/
32-
338
variable rules {
349

3510
type = map( list( string ) )
@@ -47,116 +22,3 @@ variable rules {
4722
"postgres" = [ "5432", "5432", "tcp", "postgresql db" ]
4823
}
4924
}
50-
51-
52-
/*
53-
default = {
54-
"https" = [ 443, 443, "tcp", "http secured" ]
55-
"http" = [ 80, 80, "tcp", "http plaintext" ]
56-
"all-traffic" = [ -1, -1, "-1", "All protocols" ]
57-
"ecs" = [ 32768, 61000, "tcp", "cluster comms" ]
58-
"docker" = [ 5000, 5000, "tcp", "docker registry" ]
59-
"java" = [ 8080, 8080, "tcp", "java port" ]
60-
"jenkins" = [ 8080, 8080, "tcp", "jenkins ci" ]
61-
"sonar" = [ 9000, 9000, "tcp", "sonarqube metrics" ]
62-
"postgres" = [ 5432, 5432, "tcp", "postgresql db" ]
63-
}
64-
*/
65-
66-
67-
/*
68-
variable rules {
69-
70-
description = "Modular rules allowing either TCP or UDP traffic."
71-
type = any
72-
73-
default = {
74-
75-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
76-
# < ~~~ the most common traffic types ~~~ >
77-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
78-
ssh = [ 22, 22, "tcp", "secure shell" ]
79-
http = [ 80, 80, "tcp", "http plaintext" ]
80-
https = [ 443, 443, "tcp", "http secured" ]
81-
ahttp = [ 8888, 8888, "tcp", "alternate http" ]
82-
83-
84-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
85-
# < ~~~ Rules for all ports & protocols ~~~ >
86-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
87-
all-traffic = [ -1, -1, "-1", "All protocols" ]
88-
all-tcp = [ 0, 65535, "tcp", "All TCP ports" ]
89-
all-udp = [ 0, 65535, "udp", "All UDP ports" ]
90-
all-icmp = [ -1, -1, "icmp", "All IPV4 ICMP" ]
91-
all-ipv6-icmp = [ -1, -1, 58, "All IPV6 ICMP" ]
92-
93-
94-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
95-
# < ~~~ message queue related protocols ~~~ >
96-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
97-
rmq-admin = [ 15672, 15672, "tcp", "rabbitmq admin cli" ]
98-
rmq-tls = [ 25672, 25672, "tcp", "rabbitmq admin tls" ]
99-
rmq-comms = [ 35672, 35682, "tcp", "rabbit comm ports" ]
100-
amqp = [ 5672, 5672, "tcp", "msg queue protocol" ]
101-
amqp-tls = [ 5671, 5671, "tcp", "msg queue secure" ]
102-
epmd = [ 4369, 4369, "tcp", "erlang port mapper" ]
103-
stomp = [ 61613, 61613, "tcp", "stomp plain text" ]
104-
stomp-tls = [ 61614, 61614, "tcp", "stomp secure ssl" ]
105-
mqtt = [ 1883, 1883, "tcp", "mq series telemetry" ]
106-
107-
108-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
109-
# < ~~~ Containerized Services Suite ~~~ >
110-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
111-
kubernetes = [ 6443, 6443, "tcp", "kubernetes api" ]
112-
kubelet-api = [ 10250, 10250, "tcp", "kubelet api" ]
113-
kube-sched = [ 10251, 10251, "tcp", "kube scheduler" ]
114-
kube-control = [ 10252, 10252, "tcp", "kube controller" ]
115-
kube-read = [ 10255, 10255, "tcp", "kube read only" ]
116-
ecs = [ 32768, 61000, "tcp", "cluster comms" ]
117-
docker = [ 5000, 5000, "tcp", "docker registry" ]
118-
119-
120-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
121-
# < ~~~ etcd client server api ~~~ >
122-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
123-
etcd-client = [ 2379, 2379, "tcp", "etcd client" ]
124-
etcd-server = [ 2380, 2380, "tcp", "etcd server" ]
125-
etcd-listen = [ 4001, 4001, "tcp", "etcd listen" ]
126-
127-
128-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
129-
# < ~~~ logging and elasticsearch stack tools ~~~ >
130-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
131-
fluentd = [ 24224, 24224, "tcp", "fluentd logs" ]
132-
kibana = [ 5601, 5601, "tcp", "kibana portal" ]
133-
elastic = [ 9200, 9200, "tcp", "elasticsearch" ]
134-
135-
136-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
137-
# < ~~~ Java EcoSystem Tooling ~~~ >
138-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
139-
java = [ 8080, 8080, "tcp", "java port" ]
140-
tomcat = [ 8080, 8080, "tcp", "tomcat server" ]
141-
jenkins = [ 8080, 8080, "tcp", "jenkins ci" ]
142-
hudson = [ 8080, 8080, "tcp", "hudson ci" ]
143-
nexus = [ 8080, 8080, "tcp", "nexus dir" ]
144-
sonar = [ 9000, 9000, "tcp", "sonarqube metrics" ]
145-
146-
147-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
148-
# < ~~~ gollum's webrick http server ~~~ >
149-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
150-
gollum = [ 4567, 4567, "tcp", "gollum wiki" ]
151-
152-
153-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
154-
# < ~~~ Database Management Systems ~~~ >
155-
# < ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ >
156-
postgres = [ 5432, 5432, "tcp", "postgresql db" ]
157-
158-
159-
}
160-
161-
}
162-
*/

security.group-variables.tf

+6-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
variable in_ingress {
1111

1212
description = "4 element list defining traffic to allow in (see traffic-rules.tf)"
13-
type = "list"
13+
type = list
1414
default = [ "ssh" ]
1515
}
1616

@@ -22,7 +22,7 @@ variable in_ingress {
2222
variable in_egress {
2323

2424
description = "4 element list defining traffic to allow out (see traffic-rules.tf)"
25-
type = "list"
25+
type = list
2626
default = [ "all-traffic" ]
2727
}
2828

@@ -33,7 +33,8 @@ variable in_egress {
3333

3434
variable in_vpc_id {
3535

36-
description = "umbrella vpc the security group falls under which reverts to the default VPC if not set."
36+
description = "Mandatory umbrella vpc the security group falls under which reverts to the default VPC if not set."
37+
type = string
3738
}
3839

3940

@@ -44,7 +45,7 @@ variable in_vpc_id {
4445
variable in_ingress_cidr_blocks {
4546

4647
description = "The IPv4 CIDR ranges from which traffic is allowed to originate."
47-
type = "list"
48+
type = list
4849
default = [ "0.0.0.0/0" ]
4950
}
5051

@@ -56,7 +57,7 @@ variable in_ingress_cidr_blocks {
5657
variable in_egress_cidr_blocks {
5758

5859
description = "List of IPv4 CIDR ranges to use on all egress rules"
59-
type = "list"
60+
type = list
6061
default = [ "0.0.0.0/0" ]
6162
}
6263

0 commit comments

Comments
 (0)