VerinFast / verinfast

An open sourced scanning agent
Other
6 stars 8 forks source link

handling AWS ec2 instances missing a "Name" tag #330

Open z-mhelp opened 6 months ago

z-mhelp commented 6 months ago

cloud/aws/instances.py checks if an ec2 instance has any tags. If there are none, it uses the "InstanceId", otherwise it looks for a "Name" tag. This appears to break down in the case the instance has tags but not a "Name" tag. Maybe I'm misreading the details or cause, nevertheless my logs show:

2024-03-25 11:34:45 ERROR: 'Tags' 2024-03-25 11:34:45 ERROR STACK: Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/verinfast/agent.py", line 665, in scanCloud aws_instance_file = get_aws_instances( File "/opt/homebrew/lib/python3.10/site-packages/verinfast/cloud/aws/instances.py", line 178, in get_instances tags = instance['Tags'] KeyError: 'Tags'

... resulting in the process exiting before reporting on instances and instance utilization.

aylusltd commented 4 months ago

@SeanTConrad was this issue fixed? I thought we had that in the last release?