duo-labs / cloudmapper

CloudMapper helps you analyze your Amazon Web Services (AWS) environments.
BSD 3-Clause "New" or "Revised" License
5.94k stars 800 forks source link

boto determine account id #53

Open FernandoMiguel opened 6 years ago

FernandoMiguel commented 6 years ago

could this use

import boto3
print(boto3.client('sts').get_caller_identity()['Account'])

to determine the account id it is running ?

0xdabbad00 commented 6 years ago

Makes sense. I'm actually not currently using the account id for anything, so I'll look to integrating this concept or removing the account id entirely from the config.

jcornell123 commented 5 years ago

Could it integrate with Organizations and leverage the ListAccounts API to retrieve all accounts in the Org and auto generate the accounts? https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListAccounts.html

Edit: I see #289 Issue that would be related to this.

0xdabbad00 commented 5 years ago

@jcornell123 That's a possibility. My current thinking for #286 is to just remove the config.json or possibly only look at it in cases where it's data might be used to supersede info acquired from collect.