SecurityFTW / cs-suite

Cloud Security Suite - One stop tool for auditing the security posture of AWS/GCP/Azure infrastructure.
GNU General Public License v3.0
1.14k stars 217 forks source link

Add fallback to account id if no account alias set #4

Closed flosell closed 6 years ago

flosell commented 6 years ago

If an account does not have an account alias, cs.py fails:

$ python cs.py
Traceback (most recent call last):
  File "/app/cs.py", line 16, in <module>
    account_name = account_details['AccountAliases'][0]
IndexError: list index out of range
$ aws iam list-account-aliases
{
    "AccountAliases": []
}

This PR adds a fallback to aws sts get-caller-identity in this case.

shivankar-madaan commented 6 years ago

thanks