![](/img/trans.png)
[英]How can I generate a list of all my IAM roles and the services using those roles on AWS
[英]How can i restrict all regions except one for all services using SCP in aws
对于在 aws 中使用 SCP 的所有服务和操作,我如何限制除一个区域以外的所有区域。 下面的 SCP 不工作。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": "eu-west-1"
}
}
}
]
}
您可以使用 AWS 服务控制策略 (SCP) 来允许或禁止操作和资源。 以下是将服务限制在指定区域的策略(注意 - 根据需要更改区域)
首先,指定允许在您希望使用的区域中执行操作的策略。
其次,指定 DENY 策略拒绝所有其他区域的所有操作。 (注意 StringNotEquals)
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:RequestedRegion": "us-east-1"
}
}
},
{
"Effect": "Deny",
"Action": "*",
"NotAction": "*",
"Resource": "*",
"NotResource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": "us-east-1"
}
}
}
]
}
注意,以上是一个非常严格的规则。 您应该包括允许操作员/管理员访问其他区域的策略。
AWS 提供了一些可用于自定义策略的示例 SCP 策略: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_general.html#example-scp-deny-region
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.