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

ECR support #730

Merged
merged 1 commit into from
Jan 21, 2016
Merged

ECR support #730

merged 1 commit into from
Jan 21, 2016

Conversation

Flygsand
Copy link
Contributor

This PR introduces multiple authentication backends, and adds support for the EC2 Container Registry. This addresses #703.

@ejholmes
Copy link
Contributor

Awesome! Overall this looks good. I have some minor nits around style consistency, but nothing major I think.

svc ECR
}

func NewEcrAuthProvider(svc ECR) *ecrAuthProvider {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use ECR here to be consistent? NewECRAuthProvider.

@Flygsand
Copy link
Contributor Author

Thanks for the feedback. The things I haven't commented on are already done or have to do with my other comments. I'd appreciate a final round of thoughts from you.

@Flygsand
Copy link
Contributor Author

Thanks for the update. I'll go ahead and implement your suggestions shortly.

@Flygsand
Copy link
Contributor Author

I've added some commits implementing these changes. If this looks good to you, I'll squash.

@@ -298,6 +298,13 @@
"ec2:Describe*",
"elasticloadbalancing:*",
"ecs:*",
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but, ecr:GetAuthorizationToken looks like it should be the only permission Empire needs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe anything that wants to pull from ECR using the Docker API needs GetAuthorizationToken, GetDownloadUrlForLayer, BatchGetImage and BatchCheckLayerAvailability. These are included in AmazonEC2ContainerServiceforEC2Role, and also as "pull action permissions" within the ECR console. GetRepositoryPolicy, DescribeRepositories and ListImages shouldn't be necessary, as these pertain to AWS SDK operations. I copied from AmazonEC2ContainerRegistryReadOnly, which is why they're there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, makes sense.

On Thursday, January 21, 2016, Martin Häger notifications@github.com
wrote:

In docs/cloudformation.json
#730 (comment):

@@ -298,6 +298,13 @@
"ec2:Describe_",
"elasticloadbalancing:_",
"ecs:*",

  •            "ecr:GetAuthorizationToken",
    
  •            "ecr:BatchCheckLayerAvailability",
    

I believe anything that wants to pull from ECR using the Docker API needs
GetAuthorizationToken, GetDownloadUrlForLayer, BatchGetImage and
BatchCheckLayerAvailability. These are included in
AmazonEC2ContainerServiceforEC2Role
http://docs.aws.amazon.com/AmazonECS/latest/developerguide/instance_IAM_role.html.
GetRepositoryPolicy, DescribeRepositories and ListImages shouldn't be
necessary, as these pertain to AWS SDK operations. I copied from
AmazonEC2ContainerRegistryReadOnly
http://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html#AmazonEC2ContainerRegistryReadOnly,
which is why they're there.


Reply to this email directly or view it on GitHub
https://github.com/remind101/empire/pull/730/files#r50382480.

@ejholmes
Copy link
Contributor

Awesome. Looks good to me 👍

Feel free to squash and I'll merge.

@Flygsand
Copy link
Contributor Author

Squashed and removed the three unnecessary permissions as per above. As expected, Empire works fine without them.

ejholmes added a commit that referenced this pull request Jan 21, 2016
@ejholmes ejholmes merged commit 6b3b656 into remind101:master Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants