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

Remove IAM actions from minimal policy for AWS FargateCluster #381

Open
jgdwyer opened this issue Sep 30, 2022 · 4 comments
Open

Remove IAM actions from minimal policy for AWS FargateCluster #381

jgdwyer opened this issue Sep 30, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed provider/aws/ecs Cluster provider for AWS ECS

Comments

@jgdwyer
Copy link

jgdwyer commented Sep 30, 2022

In the interest of minimizing the number of permissions that we need to provide to the cluster manager, I'd like to explore the option of removing the need for iam:ListRoles and iam:ListRoleTags actions if all resources are specified when creating the cluster. Looking at the code, it appears that if the task_role_arn and execution_role_arn are specified, then the iam actions are only needed when attempting to clean up stale resources.

Is there support for skipping the cleanup of stale IAM roles if task_role_arn and execution_role_arn are explicitly specified? It might enable us to reduce the resources needed to ec2, ecs, and logs. (And for FargateCluster we could eliminate the need for ec2 as well).

"ec2:CreateTags",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeVpcs",
"ecs:DescribeTasks",
"ecs:ListAccountSettings",
"ecs:RegisterTaskDefinition",
"ecs:RunTask",
"ecs:StopTask",
"ecs:ListClusters",
"ecs:DescribeClusters",
"ecs:ListTaskDefinitions",
"ecs:DescribeTaskDefinition",
"ecs:DeregisterTaskDefinition",
"logs:DescribeLogGroups",
"logs:GetLogEvents"
@jacobtomlinson
Copy link
Member

I am very in favour of reducing the minimal permissions if the user provides everything themselves.

Cleaning up stale resources can be skipped today, are you suggesting automatically skipping if everything is provided?

@jacobtomlinson jacobtomlinson added enhancement New feature or request help wanted Extra attention is needed provider/aws/ecs Cluster provider for AWS ECS labels Oct 3, 2022
@jgdwyer
Copy link
Author

jgdwyer commented Oct 3, 2022

Cleaning up stale resources can be skipped today, are you suggesting automatically skipping if everything is provided?

I was thinking to automatically skip the role cleanup if the roles were provided, but to keep the rest of the automatic cleanup in place. But perhaps there are other cleanup steps that can be skipped as well if their resources are directly provided?

@jacobtomlinson
Copy link
Member

Yeah I think that makes sense. Do you have any interest/time to work on this?

@jgdwyer
Copy link
Author

jgdwyer commented Oct 6, 2022

Yup I can put something together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed provider/aws/ecs Cluster provider for AWS ECS
Projects
None yet
Development

No branches or pull requests

2 participants