2016-11-20 2 views
0

특정 사용자에 대한 정책을 정의하려고합니다. S3에 여러 버킷이 있지만 사용자에게 일부 버킷에 대한 액세스 권한을 부여하고 싶습니다. 나는이 같은 자원의 목록을 추가 할 때Amazon s3 사용자 정책

{ 
    "Version":"2012-10-17", 
    "Statement":[ 
    { 
    "Sid":"AddPerm", 
    "Effect":"Allow", 
    "Principal": "*", 
    "Action":["s3:GetObject", 
      "s3:ListBucket", 
      "s3:ListAllMyBuckets", 
      "s3:GetBucketLocation", 
      "s3:PutObject"], 
    "Resource":["arn:aws:s3:::examplebucket"] 
} 

:

"Resource":["arn:aws:s3:::examplebucket1","arn:aws:s3:::examplebucket2"] 

내가 액세스

(나를 위해 I 작동 유일한 옵션을 거부 얻을 나는 다음과 같은 정책을 만든 버킷 목록 가져 오기) :

"Resource": ["arn:aws:s3:::*"] 

무엇이 문제인가? 일부는 객체 - 레벨에서 작동하는 동안

+0

'ARN : AWS를 : S3 ::: examplebucket1'는 버킷의 리소스 식별자입니다; 'arn : aws : s3 ::: examplebucket1/*'은 버킷 안의 오브젝트에 대한 와일드 카드 식별자입니다. 버킷에 대한 권한! = 개체에 대한 사용 권한. 변경해보십시오. –

답변

0

일부 아마존 S3 API 호출은 버킷 - 레벨에서 작동합니다.

{ 
    "Version": "2012-10-17", 
    "Statement": [ 
    { 
     "Effect": "Allow", 
     "Action": ["s3:ListBucket"], 
     "Resource": ["arn:aws:s3:::test"] 
    }, 
    { 
     "Effect": "Allow", 
     "Action": [ 
     "s3:PutObject", 
     "s3:GetObject", 
     "s3:DeleteObject" 
     ], 
     "Resource": ["arn:aws:s3:::test/*"] 
    } 
    ] 
} 

참조 : 따라서,이 같은 정책이 필요합니다 AWS 보안 블로그 - Writing IAM Policies: How to Grant Access to an Amazon S3 Bucket

0

나는 자사의 AWS 제한을 발견했다. 필터링 된 필터링 된 버킷 목록이 없습니다. 이 같은 ListAllMyBuckets에 권한을 부여하면 :

{ 
    "Sid": "AllowUserToSeeBucketListInTheConsole", 
    "Action": ["s3:GetBucketLocation", "s3:ListAllMyBuckets"], 
    "Effect": "Allow", 
    "Resource": ["arn:aws:s3:::*"] 

}

당신이 (당신이 그것에 권한이없는 버킷 포함) 모든 버킷의 목록을 가져옵니다.

더 많은 정보는 여기에서 볼 수 있습니다 : https://aws.amazon.com/blogs/security/writing-iam-policies-grant-access-to-user-specific-folders-in-an-amazon-s3-bucket/

거의 해결 여기에 볼 수 있습니다 : Is there an S3 policy for limiting access to only see/access one bucket?