Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Research bucket policies #19

Closed
simonw opened this issue Nov 7, 2021 · 1 comment
Closed

Research bucket policies #19

simonw opened this issue Nov 7, 2021 · 1 comment
Labels

Comments

@simonw
Copy link
Owner

simonw commented Nov 7, 2021

An optional flag for attaching bucket policies to the new s3 bucket. These are just like IAM user policies, but attached to the bucket itself.

Originally posted by @zacaytion in #7 (comment)

I need to research bucket policies to fully understand what kinds of things they are useful for and how they should be supported by this tool.

@simonw
Copy link
Owner Author

simonw commented Nov 8, 2021

The examples in the documentation are useful for understanding what these can do: https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html#example-bucket-policies-use-case-2

This example in particular looks useful:

The following example policy grants the s3:GetObject permission to any public anonymous users

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"PublicRead",
      "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject","s3:GetObjectVersion"],
      "Resource":["arn:aws:s3:::DOC-EXAMPLE-BUCKET/*"]
    }
  ]
}

This will only have an effect if the bucket doesn't have a "block public access setting", see #20.

Two other examples that caught my interest were:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant