how can i quickly troubleshoot IAM permission for a service

1

hi.. i'm currently developing a beanstalk service that calls an automation document that creates cloudformation stacks. the role for such a service requires many MANY iterations, of modify Role, upload, restart, try again. as a developer we only have SSO roles, is there a way i can develop under the context of the service role without modifying the original role to allow my sso user to assume it? i'd like to be able to perform operations as though i am the service to figure out faster what kind of permissions i require (for example execute cloudformation stack as though i am that role

2 個答案
2

One way of generating policies is to use AWS's policy generator based off activity: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_generate-policy.html. With this, IAM Access Analyzer reviews AWS CloudTrail for API calls and generates a policy template that contains the permissions that the entity used over a specified data range.

There are other 3rd party tools that do something like this as well.

I also recommend using AWS Policy Sim: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_testing-policies.html

jsonc
已回答 2 年前
  • thanks, i've been reading about the policy generation, and i'm not sure about a few things, i'm assuming i need to use my current developer role, but OTOH , i don't want to give my actuall role, as i maybe doing other aws stuff while the activity is running, not mention my IDE will as well, so i would need to create an additional role similar to my own, by my current role is actually SAML based, so how do i create a "developer like" role i can configure in aws CLI to assume that role?

1

You can search for the service role in IAM Roles and see which policies are applied to it. Then create another role that you can assume or create an IAM user with the same policies that are applied to the server role. After you are done you can remove the role/user that you created.

AWS
已回答 2 年前
  • that's what i thought i would do, but i can't even create roles for that too.

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

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

回答問題指南