Score:0

S3 Security Policy for Bucket while allowing signed urls

br flag

ugh, bucket policies.

I am trying to write a bucket security policy that would keep an outsider from listing the structure and data in the bucket but at the time my AWS users needs to be able to pull/put objects and create signed URLs to media files (some of these are audio files which need to be streamed).

I have turned off public access to the bucket and created a bucket policy that looks like this:

{
        "Sid": "Stmt1625604135648",
        "Effect": "Allow",
        "Principal": "*",
        "Action": [
            "s3:GetObject",
            "s3:PutObject",
            "s3:GetObjectAcl",
            "s3:PutObjectAcl"
        ],
        "Resource": "arn:aws:s3:::mediaBucket/*"
    }

but every time I try to use the AWS PHP library to push an object into a bucket or create a signed URL for a specific resource I am getting access denied errors.

What am I doing wrong here?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.