From the course: Python: Pen Testing AWS

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Managing IAM programmatically

Managing IAM programmatically - Python Tutorial

From the course: Python: Pen Testing AWS

Start my 1-month free trial

Managing IAM programmatically

- [Instructor] We've already seen how we can access the IAM service to identify account authorizations. Let's take a look at some other IAM functions we can call. We'll start with the standard program frame. Nano starter.py minus L and let's add a heading, print IAM enumerator and we'll underline it. We'll start a session on IAM using scenario one. IAMs equals boto3.session.Session profile name equals scenario one, region name equals US West two, and the client service name equals IAM. Okay, let's list users. Print user list. Users equals IAMs and we'll call list users for X in users users. So, for every user, we will print X user name. Okay, let's now see how we list groups. Print groups, groups equal IAMs.list groups, the function call, and again for X in groups groups structure print X group name. We can also list the access keys for each user. Print access keys and the access keys we'll find…

Contents