Sử dụng AWS Security dành cho Developer
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"
}
}
}

Câu hỏi
Câu trả lời


Dựa trên danh tính (Identity-based)


Dựa trên danh tính (Identity-based)
Dựa trên tài nguyên (Resource-based)
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject", "Resource": "*"}
Yêu cầu: s3:DeleteObject cho kết quả: Bị từ chối.
Deny tường minh luôn thắng mọi allow, dù allow đó rộng đến đâu


{"Effect": "Allow", "Action": "s3:*",
"Resource": "*"}
{"Effect": "Deny", "Action": "s3:DeleteObject",
"Resource": "*"}
s3:GetObject → allow: allow rộng bao phủs3:DeleteObject → deny tường minh: có câu lệnh nói khôngkms:Decrypt, dynamodb:GetItem → deny ngầm: policy này không nhắc tới các dịch vụ đóCùng lỗi, hai nguyên nhân
Deny tường minh
Deny ngầm

Sử dụng AWS Security dành cho Developer