Skip to content

Commit 3e94d28

Browse files
committed
fix whitelisting
1 parent 3c843ce commit 3e94d28

File tree

5 files changed

+21
-33
lines changed

5 files changed

+21
-33
lines changed

cloudformation/60_databases.yml.j2

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ Resources:
88
GroupDescription: Security group for Postgres Metadata DB. Public access
99
GroupName: "{{ serviceName }}-{{ ENVIRONMENT }}-metadata-db-public-security-group"
1010
SecurityGroupEgress:
11+
- CidrIp: 0.0.0.0/0
12+
FromPort: 0
13+
IpProtocol: -1
14+
ToPort: 0
15+
SecurityGroupIngress:
1116
{% for ip in whitelistedIPs %}
1217
- CidrIp: "{{ ip }}"
1318
FromPort: "{{ metadataDb.port }}"
1419
IpProtocol: tcp
1520
ToPort: "{{ metadataDb.port }}"
1621
{% endfor %}
17-
SecurityGroupIngress:
18-
- CidrIp: 0.0.0.0/0
19-
FromPort: "{{ metadataDb.port }}"
20-
IpProtocol: tcp
21-
ToPort: "{{ metadataDb.port }}"
2222
- CidrIp: "{{ service.cidrBlock }}/16"
2323
FromPort: "{{ metadataDb.port }}"
2424
IpProtocol: tcp

cloudformation/70_redis.yml.j2

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ Resources:
1717
GroupDescription: Security group for Redis
1818
GroupName: "{{ serviceName }}-{{ ENVIRONMENT }}-redis-security-group"
1919
SecurityGroupEgress:
20-
{% for ip in whitelistedIPs %}
21-
- CidrIp: "{{ ip }}"
22-
FromPort: "{{ celeryBackend.port }}"
23-
IpProtocol: tcp
24-
ToPort: "{{ celeryBackend.port }}"
25-
{% endfor %}
20+
- CidrIp: 0.0.0.0/0
21+
FromPort: 0
22+
IpProtocol: -1
23+
ToPort: 0
2624
SecurityGroupIngress:
2725
- CidrIp: "{{ service.cidrBlock }}/16"
2826
FromPort: "{{ celeryBackend.port }}"

cloudformation/83_airflow-flower.yml.j2

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@ Resources:
77
GroupDescription: Security group for Airflow Flower. Allow all inbound traffic.
88
GroupName: "{{ serviceName }}-{{ ENVIRONMENT }}-flower-external-security-group"
99
SecurityGroupEgress:
10+
- CidrIp: 0.0.0.0/0
11+
FromPort: 0
12+
IpProtocol: -1
13+
ToPort: 0
14+
SecurityGroupIngress:
1015
{% for ip in whitelistedIPs %}
1116
- CidrIp: "{{ ip }}"
12-
FromPort: 80
13-
IpProtocol: tcp
14-
ToPort: 80
15-
- CidrIp: "{{ ip }}"
16-
FromPort: 443
17-
IpProtocol: tcp
18-
ToPort: 443
19-
{% endfor %}
20-
SecurityGroupIngress:
21-
- CidrIp: 0.0.0.0/0
2217
FromPort: "{{ service.port }}"
2318
IpProtocol: tcp
2419
ToPort: "{{ service.port }}"
20+
{% endfor %}
2521
VpcId: !ImportValue network-VpcId
2622
Tags:
2723
- Key: Name

cloudformation/85_airflow-webserver.yml.j2

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,17 @@ Resources:
77
GroupDescription: Security group for Airflow webserver. Allow all inbound traffic.
88
GroupName: "{{ serviceName }}-{{ ENVIRONMENT }}-webserver-security-group"
99
SecurityGroupEgress:
10+
- CidrIp: 0.0.0.0/0
11+
FromPort: 0
12+
IpProtocol: -1
13+
ToPort: 0
14+
SecurityGroupIngress:
1015
{% for ip in whitelistedIPs %}
1116
- CidrIp: "{{ ip }}"
12-
FromPort: 80
13-
IpProtocol: tcp
14-
ToPort: 80
15-
- CidrIp: "{{ ip }}"
16-
FromPort: 443
17-
IpProtocol: tcp
18-
ToPort: 443
19-
{% endfor %}
20-
SecurityGroupIngress:
21-
- CidrIp: 0.0.0.0/0
2217
FromPort: "{{ service.port }}"
2318
IpProtocol: tcp
2419
ToPort: "{{ service.port }}"
20+
{% endfor %}
2521
VpcId: !ImportValue network-VpcId
2622
Tags:
2723
- Key: Name

service.yml

-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ publicSubnet:
8181
cidrBlock: 10.0.3.0/24
8282
availabilityZone: c
8383

84-
# List of SecurityGroupEgress.
85-
# Will be used to whitelist IPs for webserver, flower, workers and scheduler
8684
whitelistedIPs:
8785
- 0.0.0.0/0
8886

0 commit comments

Comments
 (0)