![](/img/trans.png)
[英]Add a Security Group to the Inbound Rule of another Security Group as a Source with Terraform (AWS)
[英]Set AWS Security Group inbound rule to let Gilabci pipeline make changes in RDS
我可以使用 0.0.0.0/0 CidrIp 从 gitlabci 管道访问 AWS RDS,但它已被广泛开放。
这是我在 cloudformation 文件中的 SecurityGroupIngress 定义:
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
FromPort: 5432
ToPort: 5432
IpProtocol: TCP
Description: Allows traffic from gitlb ci
它工作正常。
我不知道如何设置 gitlabci 的 ip 地址范围以使 AWS RDS 更安全。
我找到了这个文档: gitlab ip 范围
谷歌云cloude.josn上有指向所有可能的 ip 地址的链接
这是关于stackoverflow的类似主题
我需要 ip 和口罩。
对于来自 CI/CD 运行器的传出连接,我们不提供 static IP 地址。 所有 GitLab.com 共享运行器都部署到 us-east1 的谷歌云平台 (GCP)
这是us-east1
中所有 GCP CIDR 块的列表,假设您使用的是 Gitlab 跑步者。
"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"
方法:
curl https://www.gstatic.com/ipranges/cloud.json | jq '.prefixes[] | select(.scope=="us-east1") | .ipv4Prefix // .ipv6Prefix'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.