ストーリー: 「払い戻しの発行を担当するユーザーとして、「New Sales File」という名前を含む任意の AWS s3 フォルダーからダウンロードできるようにしたいと考えています」
プレフィックスの開始時にワイルドカードを使用する必要が生じたのはこれが初めてです。このプレフィックス行は次のようになります: "s3:prefix": " / /New Sales File/*"
完全なポリシーは以下のとおりです。[DELETED は削除した機密情報を表します -- 値がパターンと一致しません]
{
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::*"
]
},
{
"Action": [
"s3:ListBucket"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::DELETED"
]
},
{
"Action": [
"s3:Get*"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::DELETED"
],
"Condition" : {
"StringLike": {
"s3:prefix": "*/*/New Sales File/*"
},
"StringEquals": {
"s3:delimeter": "/"
}
}
},
{
"Action": [
"s3:*"
],
"Effect": "Deny",
"Resource": [
"arn:aws:s3:::DELETED"
],
"Condition": {
"StringLike": {
"s3:prefix": "*/*/DELETED/"
},
"StringEquals": {
"s3:delimiter": "/"
}
}
},
{
"Action": [
"s3:*"
],
"Effect": "Deny",
"Resource": [
"arn:aws:s3:::DELETED"
],
"Condition": {
"NotIpAddress": {
"aws:SourceIp": "DELETED"
}
}
}
] }