Using AWS Security for Developers
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"
}
}
}

The question
The answer


Identity-based


Identity-based
Resource-based
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
Request: s3:DeleteObject results in: Denied.
An explicit deny beats any allow, however broad


{"Effect": "Allow", "Action": "s3:*",
"Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject",
"Resource": "*"}
s3:GetObject → allow: the broad allow covers its3:DeleteObject → explicit deny: a statement says nokms:Decrypt, dynamodb:GetItem → implicit deny: this policy never mentions those servicesSame error, two causes
Explicit deny
Implicit deny

Using AWS Security for Developers