amazon-ecr-user-guide icon indicating copy to clipboard operation
amazon-ecr-user-guide copied to clipboard

Document S3 buckets used by ECR

Open copumpkin opened this issue 8 years ago • 8 comments

It turns out that running docker against ECR in a VPC with an S3 endpoint with a nontrivial locked down policy on it is a recipe in frustration.

It eventually turned out that we needed to allow our endpoint to access prod-us-east-1-starport-layer-bucket for ECR to work properly, but this was not obvious at all from any of the official documentation.

I get that on some level it's an implementation detail of ECR, but on the other hand, given that other AWS constructs like VPCE policies require us to know about that implementation detail, it'd be nice to have that documented somewhere.

copumpkin avatar Jul 11 '18 18:07 copumpkin

Thanks for filing this issue. I agree that we can improve the user experience here. I'll start a conversation with the product team to see what we can do to improve the documentation on using ECR with an S3 endpoint.

nrdlngr avatar Aug 14 '18 22:08 nrdlngr

In many ways this feels similar in "shape" to prefix lists in EC2 networking. If want to open my security group to S3, I don't want to have to keep track of all the CIDRs S3 is using behind the scenes, but I still need to be able to talk about S3 as a logical entity. Unfortunately, there's not really a notion of "named resource bundles" in IAM, so within a given policy, I can't just say "hey allow the stuff that ECR wants". Managed policies do this for principals, but VPCEs don't support that.

But since none of that is really possible today, I think this boils down to the equivalent of https://ip-ranges.amazonaws.com/ip-ranges.json and just publishing a list of buckets in the documentation. Or perhaps in a machine-readable form like the ip-ranges.json so we can adjust our automated policies without having to keep reading the documentation?

copumpkin avatar Aug 15 '18 04:08 copumpkin

This is now more relevant thanks to https://aws.amazon.com/blogs/compute/setting-up-aws-privatelink-for-aws-fargate-amazon-ecs-and-amazon-ecr/ and ECR gaining PrivateLink support.

That blog post suggests a wide-open S3 VPCE, which many/most organizations using VPCEs will not want or allow. But to recommend a more precise policy, the starport layer buckets need to be documented (and by extension, the team commits to their names) or we can't realistically write sensible private policies for our endpoints.

I also tried posting something like this comment on that blog post but my comment disappeared 😦

copumpkin avatar Jan 25 '19 22:01 copumpkin

Looks like the documentation was updated! https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecs-minimum-s3-perms.html

copumpkin avatar Jan 25 '19 22:01 copumpkin

@copumpkin That link is no longer working it seems.

ronkorving avatar Feb 12 '19 10:02 ronkorving

The updated link is https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr-minimum-s3-perms.html

joelsbrandenburg avatar Feb 13 '19 22:02 joelsbrandenburg

That link no longer contains any information about s3 and starport.

tessprime avatar Oct 22 '21 16:10 tessprime

I believe this documentation can be found at https://docs.aws.amazon.com/AmazonECR/latest/userguide/vpc-endpoints.html#ecr-setting-up-s3-gateway

joelbrandenburg avatar Oct 22 '21 16:10 joelbrandenburg