ECS Task defintion

0

Hello community, I want to control ECS Task Definition like a addition control, Allow the creation of task definition that uses container images from specific ECR Reject the creation of ECS task definition that uses any public container registry

Thanks

2개 답변
1

Hi,

I think that if you grant your ECS task access to the only ECR repo(s) that you want, you're good.

Look at section "Accessing One Amazon ECR Repository" of https://docs.aws.amazon.com/AmazonECR/latest/userguide/security_iam_id-based-policy-examples.html for an example:

{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Sid":"ListImagesInRepository",
         "Effect":"Allow",
         "Action":[
            "ecr:ListImages"
         ],
         "Resource":"arn:aws:ecr:us-east-1:123456789012:repository/my-repo"
      },
      {
         "Sid":"GetAuthorizationToken",
         "Effect":"Allow",
         "Action":[
            "ecr:GetAuthorizationToken"
         ],
         "Resource":"*"
      },
      {
         "Sid":"ManageRepositoryContents",
         "Effect":"Allow",
         "Action":[
                "ecr:BatchCheckLayerAvailability",
                "ecr:GetDownloadUrlForLayer",
                "ecr:GetRepositoryPolicy",
                "ecr:DescribeRepositories",
                "ecr:ListImages",
                "ecr:DescribeImages",
                "ecr:BatchGetImage",
                "ecr:InitiateLayerUpload",
                "ecr:UploadLayerPart",
                "ecr:CompleteLayerUpload",
                "ecr:PutImage"
         ],
         "Resource":"arn:aws:ecr:us-east-1:123456789012:repository/my-repo"
      }
   ]
}

Best,

Didier

profile pictureAWS
전문가
답변함 4달 전
0

Hello.

Looking at the ECS IAM policy list, I think it is difficult to restrict repositories using task definitions.
https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonelasticcontainerservice.html

So, how about configuring CI/CD so that ECS is updated when Git Push is performed?
If you set the IAM policy so that each IAM user cannot directly update the ECS task definition, you will be less worried about the task definition repository settings being changed.

profile picture
전문가
답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠