开发者的 AWS 安全实践
Rahul Singh
Technical Product Manager
{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::reports/*",
"Condition": {
"Bool": {
"aws:SecureTransport": "true"
},
"IpAddress": {
"aws:SourceIp": "203.0.113.0/24"
}
}
}

{
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::reports/*",
"Condition": {
"Bool": {
"aws:SecureTransport": "true"
},
"IpAddress": {
"aws:SourceIp": "203.0.113.0/24"
}
}
}

问题
答案


基于身份


基于身份
基于资源
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
请求: s3:DeleteObject 的结果:Denied。
显式拒绝优先于任何允许,再宽也无效


{"Effect": "Allow", "Action": "s3:*",
"Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject",
"Resource": "*"}
s3:GetObject → 允许:广泛的允许已覆盖s3:DeleteObject → 显式拒绝:有语句明确拒绝kms:Decrypt、dynamodb:GetItem → 隐式拒绝:此策略未涉及这些服务同样错误,两个原因
显式拒绝
隐式拒绝

开发者的 AWS 安全实践