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

s3 bucket - support switch for: PutPublicAccessBlock #427

Closed
HerrmannHinz opened this issue Nov 13, 2020 · 9 comments · Fixed by #648
Closed

s3 bucket - support switch for: PutPublicAccessBlock #427

HerrmannHinz opened this issue Nov 13, 2020 · 9 comments · Fixed by #648
Assignees
Labels
enhancement New feature or request

Comments

@HerrmannHinz
Copy link
Contributor

HerrmannHinz commented Nov 13, 2020

INFO

just trying out the example at:

https://github.com/crossplane/provider-aws/blob/master/examples/s3/bucket.yaml
in general this works fine, i did set the following acl permission:

spec:
  forProvider:
    acl: private

i expected the bucket to be not public, but when checking the aws console:
(see Block Public Access)

Screenshot 2020-11-13 at 21 52 43

read more about this here:
https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#console-block-public-access-options

@hasheddan mentioned (on slack) it could be done via:
https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/s3#Client.PutPublicAccessBlock
.. but its not implemented yet.

original conversation with @hasheddan on slack:
https://crossplane.slack.com/archives/C01718T2476/p1605300583114500

TODO
please implement switch to enable feature PutPublicAccessBlock on s3 bucket

@HerrmannHinz HerrmannHinz added the enhancement New feature or request label Nov 13, 2020
@JasP19
Copy link

JasP19 commented Nov 30, 2020

I have not contributed before but I would like to try add this enhancement if possible. Of course, any assistance in terms of reviewing the updates I make would be much appreciated.

@muvaf
Copy link
Member

muvaf commented Nov 30, 2020

Hi @JasP19 ! That would be a good first contribution! Thanks for chiming in!

I was thinking that would be another sub-resource we embed in Bucket object but it seems like Terraform community decided to make it a different API whereas CloudFormation supports it embedded.

I'm closer to sub-resource approach but curious about others' take on it. Do you think you would want to have a separate CRD for this call where you can limit people's RBAC separately form Bucket? i.e. do you think there are cases where I'd like to give Bucket permission to someone but not PutPublicAccessBlock?

@JasP19
Copy link

JasP19 commented Dec 1, 2020

Thanks @muvaf! My initial thoughts were also a sub-resource embedded in Bucket (essentially a sub-object consisting of four Booleans as per the CloudFormation link you sent).

To me a sub-resource makes more sense since it aligns with the experience in the AWS Management Console. I understand the use case of having a separate CRD but, in my opinion, public access control is far more closely coupled to a Bucket than something like a Bucket Policy which gets attached to a Bucket. All in all, I think this setting fits in well on the Bucket CRD with the existing access controls such as grantRead, grantWrite, etc.

If @HerrmannHinz or anyone else has a different opinion then I'm definitely interested to hear it.

@muvaf
Copy link
Member

muvaf commented Dec 1, 2020

@krishchow @hasheddan how do you guys feel? It's a v1beta1 resource so I want to make sure we're all onboard here since the change would be harder compared to v1alpha1 if we decide to separate later.

@krishchow
Copy link
Collaborator

Generally for the other related bucket resources (e.g., Server-side encryption or website configuration), we tried to mirror how to terraform is organizes the calls. I noticed that Terraform separated out resources that the bucket could have multiple of, like how an S3 bucket could have a variable amount of independent bucket policies.

So, just to confirm, an individual bucket can only have one PublicAccessBlock, and the value of the "ExpectedBucketOwner" should always be the same account id as the account used by the provider-aws?

If both of those are true, then I would say that it should be integrated as a sub-resource for the bucket.

@muvaf
Copy link
Member

muvaf commented Dec 2, 2020

@krishchow looking at API, yes I believe these assumptions are true.

@JasP19 I think we can start working on it. GetPublicAccessBlock, DeletePublicAccessBlock and PutPublicAccessBlock are available in the API. Feel free to ping #dev channel in Crossplane Slack for any help 🙂

@JasP19
Copy link

JasP19 commented Dec 2, 2020

Awesome, thanks! I'll start working on it as soon I get some time.

@publiusi
Copy link

Are there any updates on this?

@JasP19
Copy link

JasP19 commented Dec 24, 2020

@publiusi unfortunately I've been quite busy over the past few weeks. I'm still happy to try add this functionality when I can but, if someone is available with more free time than me, I'm also happy to pass it over to them.

@muvaf muvaf added this to Accepted in v1.1 Mar 1, 2021
@muvaf muvaf self-assigned this Mar 1, 2021
@muvaf muvaf added this to Proposed in v1.2 via automation Mar 4, 2021
@muvaf muvaf moved this from Proposed to Accepted in v1.2 Mar 4, 2021
@muvaf muvaf closed this as completed in #648 May 5, 2021
v1.2 automation moved this from Accepted to Done May 5, 2021
@negz negz removed this from Accepted in v1.1 May 26, 2022
@negz negz removed this from Done in v1.2 May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants