Pipeline aws service role

0

Hi team,

I've set up a pipeline using CodePipeline, and this pipeline automatically generated a new service role called AWSCodePipelineServiceRole-region-myPipeline on my behalf.

but this service role created by the pipeline contains too much permission :

"elasticbeanstalk:*",
                "ec2:*",
                "elasticloadbalancing:*",
                "autoscaling:*",
                "cloudwatch:*",
                "s3:*",
                "sns:*",
                "cloudformation:*",
                "rds:*",
                "sqs:*",
                "ecs:*"
              "opsworks:,
.......
......

I'm wondering if it's normal for the pipeline service role to have that excessive number of permissions?

1 回答
0

Hi,

Yes, this is the expected behavior and important point to note is this would only be used by codepipeline service as it's codepipeline service role. However you can create your own codepipeline service role following least privilege model and use it while creating pipeline but make sure that it has all the required permissions to deploy/provision resources.

Referece:

Hope this helps.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
专家
已回答 9 个月前
profile pictureAWS
专家
已审核 9 个月前
  • Yes, you can reduce to least privilege as suggested but it is dependent on what the stages of your pipeline do: you'll have to grant privileges for each of the AWS service that you use in this pipeline, either directly or indirectly. So, start with no privilege and cycle until the last "Authorization Denied" disappear. You can also use CloudTrail to track the various service calls done by your Pipeline: you'll be more efficient.

  • Do you have any additional questions?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则