I am able to access AWS RDS from gitlabci pipeline using 0.0.0.0/0 CidrIp but it is widely opened.
This is my SecurityGroupIngress definition in cloudformation file:
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 5432
ToPort: 5432
IpProtocol: TCP
Description: Allows traffic from gitlb ci
It works fine.
I have no idea how to set gitlabci's ip address range to make AWS RDS more secure.
I found this docs: gitlab ip range
There is link to all possible ip addresses on google cloud cloude.josn
Here is similar topic on stackoverflow
I need ip and mask.
For outgoing connections from CI/CD runners, we are not providing static IP addresses. All GitLab.com shared runners are deployed into Google Cloud Platform (GCP) in us-east1
Here is a list of all GCP CIDR blocks in us-east1
, assuming you are using Gitlab runners.
"34.23.0.0/16"
"34.24.0.0/15"
"34.26.0.0/16"
"34.73.0.0/16"
"34.74.0.0/15"
"34.98.128.0/21"
"34.118.250.0/23"
"34.138.0.0/15"
"34.148.0.0/16"
"35.185.0.0/17"
"35.190.128.0/18"
"35.196.0.0/16"
"35.207.0.0/18"
"35.211.0.0/16"
"35.220.0.0/20"
"35.227.0.0/17"
"35.229.16.0/20"
"35.229.32.0/19"
"35.229.64.0/18"
"35.231.0.0/16"
"35.237.0.0/16"
"35.242.0.0/20"
"35.243.128.0/17"
"104.196.0.0/18"
"104.196.65.0/24"
"104.196.66.0/23"
"104.196.68.0/22"
"104.196.96.0/19"
"104.196.128.0/18"
"104.196.192.0/19"
"162.216.148.0/22"
"2600:1900:4020::/44"
Methodology:
curl https://www.gstatic.com/ipranges/cloud.json | jq '.prefixes[] | select(.scope=="us-east1") | .ipv4Prefix // .ipv6Prefix'