From c67c23dd42eebdbcc13b3b284f2e63c0d0949b61 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <38561120+sergargar@users.noreply.github.com> Date: Fri, 3 May 2024 09:12:14 +0200 Subject: [PATCH] fix(ec2): handle non-existing private ip (#3906) --- prowler/providers/aws/services/ec2/ec2_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prowler/providers/aws/services/ec2/ec2_service.py b/prowler/providers/aws/services/ec2/ec2_service.py index 9d4c950a5e..7da0bd5954 100644 --- a/prowler/providers/aws/services/ec2/ec2_service.py +++ b/prowler/providers/aws/services/ec2/ec2_service.py @@ -261,7 +261,7 @@ class EC2(AWSService): id=interface["NetworkInterfaceId"], association=interface.get("Association", {}), attachment=interface.get("Attachment", {}), - private_ip=interface["PrivateIpAddress"], + private_ip=interface.get("PrivateIpAddress"), type=interface["InterfaceType"], subnet_id=interface["SubnetId"], vpc_id=interface["VpcId"], @@ -524,7 +524,7 @@ class NetworkInterface(BaseModel): id: str association: dict attachment: dict - private_ip: str + private_ip: Optional[str] type: str subnet_id: str vpc_id: str