Is there an S3 policy for limiting access to only see/access one bucket?

前端 未结 23 796
孤城傲影
孤城傲影 2020-11-29 15:08

I have a simple bucket that looks like images.mysite.com on my S3 and other buckets containing backups, etc.

I want to allow a specific user to be able

23条回答
  •  孤独总比滥情好
    2020-11-29 15:46

    This worked perfect for me . User can upload, Download and get list of files but will not able to see files from other bucket.

     {    
    
    "Statement": [    
    
    {
        "Effect": "Allow",
        "Action": [
            "s3:GetObject",
            "s3:PutObject",
            "s3:GetObjectAcl",
            "s3:PutObjectAcl",
            "s3:ListBucket",
            "s3:GetBucketAcl",
            "s3:PutBucketAcl",
            "s3:GetBucketLocation"
        ],
        "Resource": "arn:aws:s3:::mybucketname/*",
        "Condition": {}
    },
    {
        "Effect": "Allow",
        "Action": "s3:ListAllMyBuckets",
        "Resource": "*",
        "Condition": {}
    },
    {
        "Effect": "Deny",
        "Action": [
            "s3:DeleteBucket",
            "s3:DeleteBucketPolicy",
            "s3:DeleteBucketWebsite",
            "s3:DeleteObject",
            "s3:DeleteObjectVersion"
        ],
        "Resource": "arn:aws:s3:::mybucketname/*",    
    
        "Condition": {}    
    
    }
    ]
    }      
    

提交回复
热议问题