-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EC2 Snapshots gets lots of stuff, takes very long #793
Comments
Ah. It looks like that function returns all available snapshots. I think what we probably want here is to filter to snapshots owned by the current account. @achantavy @ramonpetgrave64, thoughts? |
Co-authored-by: Dallas Kaman <dallas.kaman@praetorian.com>
Why does
However I don't really understand this. I'm using a new AWS account which hasn't been granted access to any other account. I just hope AWS isn't returning a lot of stuff from other accounts that it shouldn't. |
@danielsaporo There's public EBS snapshots for public datasets, and there's a lot of them. This is similar to public AMIs. See, for example, how I changed that to only pull AMIs from owned accounts, but then introspected the graph to find other images that should be fetched: https://github.com/lyft/cartography/blob/master/cartography/intel/aws/ec2/images.py#L17-L59 |
* filter ebs snapshots to just the current account (#793) Co-authored-by: Dallas Kaman <dallas.kaman@praetorian.com> * add snapshots_in_use to get_snapshots * filter duplicate snapshots in get_snapshots * add integration test for get_snapshots_in_use * small var name/comment updates * Update tests/integration/cartography/intel/aws/ec2/test_ec2_snapshots.py Co-authored-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com> * update from linter Co-authored-by: Dallas Kaman <dallas.kaman@praetorian.com> Co-authored-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
Fixed in #799 |
Thanks for fixing this. What is the process to upgrade to a newer version of Cartography that includes this fix? Do I need to wait for some kind of release to happen first? |
* filter ebs snapshots to just the current account (lyft#793) Co-authored-by: Dallas Kaman <dallas.kaman@praetorian.com> * add snapshots_in_use to get_snapshots * filter duplicate snapshots in get_snapshots * add integration test for get_snapshots_in_use * small var name/comment updates * Update tests/integration/cartography/intel/aws/ec2/test_ec2_snapshots.py Co-authored-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com> * update from linter Co-authored-by: Dallas Kaman <dallas.kaman@praetorian.com> Co-authored-by: Ramon Petgrave <32398091+ramonpetgrave64@users.noreply.github.com>
I'm trying Cartography on an AWS account that is practically empty (just a few users), and noticed that it takes a while to run. What really stands out is that it takes over 9 minutes to get EBS snapshot data. And this account does not have (and never had) any EBS volumes in any regions.
Yet, when I debug
get_snapshots()
insnapshots.py
, I see thatclient.get_paginator('describe_snapshots')
returns many thousands of records despite the fact that there is no snapshot data in any region visible in the AWS Console.So, what is describe_snapshots returning exactly, and do we need all that?
The text was updated successfully, but these errors were encountered: