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

Index out of range error when running prepare for ecs tasks in failed state due to `reason: MISSING` #785

Closed danielpops closed 3 years ago

danielpops commented 3 years ago

I'm not exactly sure why the task is marked as "MISSING" (I originally ran collect with a user that may not have had all the required permissions? Or maybe the task was transient and was removed between API calls?). The task in this case looks like:

> /home/danielpops/cloudmapper/commands/prepare.py(149)get_ecs_tasks()
-> tasks.append(task["tasks"][0])
(Pdb) task
{'failures': [{'arn': 'arn:aws:ecs:us-east-1:111111111111:task/47fb5ad1-26d4-43e5-b55f-3b17d811cb74', 'reason': 'MISSING'}], 'tasks': []}

While that may have been user error to collect incomplete data, I feel like the prepare step can handle this more gracefully