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

fix: Remove "autoscaling:UpdateAutoScalingGroup" permission from cluster-autoscaler IRSA #357

Conversation

blanchardma
Copy link
Contributor

Description

Remove unnecessary action ("autoscaling:UpdateAutoScalingGroup") from the IAM policy of the Cluster Autoscaler.
Update the order of the IAM actions as in the documentation, so that it is easier for future comparison.

Motivation and Context

Reduces the IAM permissions to the required actions.

Breaking Changes

No.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@@ -59,11 +59,8 @@ data "aws_iam_policy_document" "cluster_autoscaler" {
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeScalingActivities",
"autoscaling:DescribeTags",
"ec2:DescribeLaunchTemplateVersions",
Copy link
Member

Choose a reason for hiding this comment

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

we can remove "autoscaling:UpdateAutoScalingGroup" since its not listed in the cluster-autoscaler policy on the project, but the rest of the changes need to be reverted. The statement below has a condition which many of these permissions will fail on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

First thanks you for the quick response. Based on the related documentation it is possible to use it with condition and tags like here: "In this example, only the second block of actions should be updated to restrict the resources/add conditionals:" And also the EC2 instances has the tag from autoscaling group. For "eks:DescribeNodegroup" in the 2nd example is it similar with ARN but not same. Below the example the API use case with "eks:DescribeNodegroup" is described but I could not test so far.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bryantbiggs I can adjust the PR, but I wanted to ask if the additional information has it described a little better and impact first feedback?

Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry but I am not following. from what I can see from the upstream project, we should only be removing autoscaling:UpdateAutoScalingGroup and not modifying anything else in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bryantbiggs the PR is update as discussed.

@blanchardma blanchardma force-pushed the fix/cluster-autoscaler-iam-permissions branch from 5ae2153 to 2dcf305 Compare April 4, 2023 14:02
@bryantbiggs bryantbiggs changed the title fix: Remove unnecessary IAM permission for cluster autoscaler fix: Remove "autoscaling:UpdateAutoScalingGroup" permission from cluster-autoscaler IRSA Apr 4, 2023
@github-actions
Copy link

github-actions bot commented May 5, 2023

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label May 5, 2023
@blanchardma blanchardma force-pushed the fix/cluster-autoscaler-iam-permissions branch from 61aa65b to c174907 Compare May 5, 2023 14:17
@blanchardma blanchardma force-pushed the fix/cluster-autoscaler-iam-permissions branch from c174907 to 91993b8 Compare May 5, 2023 14:26
@blanchardma blanchardma requested a review from bryantbiggs May 5, 2023 14:32
@bryantbiggs bryantbiggs merged commit aeb5d7f into terraform-aws-modules:master May 5, 2023
antonbabenko pushed a commit that referenced this pull request May 5, 2023
### [5.17.1](v5.17.0...v5.17.1) (2023-05-05)

### Bug Fixes

* Remove `"autoscaling:UpdateAutoScalingGroup"` permission from cluster-autoscaler IRSA ([#357](#357)) ([aeb5d7f](aeb5d7f))
@antonbabenko
Copy link
Member

This PR is included in version 5.17.1 🎉

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants