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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南