我刚刚在我的组织内偶然发现了一个 s3 存储桶策略,其中包含多个语句,其中两个是:
{
"Sid": "ReadFromEKS",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:role/redacted"
},
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:DeleteObject",
"s3:GetObjectAcl"
],
"Resource": [
"arn:aws:s3:::bucket-name",
"arn:aws:s3:::bucket-name/*"
]
}
{
"Sid": "ReadFromEKS",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::210987654321:role/redacted"
},
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:DeleteObject",
"s3:GetObjectAcl"
],
"Resource": [
"arn:aws:s3:::bucket-name",
"arn:aws:s3:::bucket-name/*"
]
}
(这些是从 AWS 控制台复制/粘贴的,然后我更改了存储桶和角色 ARN)
我很困惑,因为我的理解是声明 ID (Sids) 在策略中必须是唯一的。显然他们不在这里。
我认为 Sids 在保单中是独一无二的,这是否错误? 如果这种信念没有错,那么这项政策怎么可能存在?