mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 04:21:52 +00:00
fix(severity): add enum for severity values (#5856)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from prowler.lib.check.models import Severity
|
||||
from prowler.providers.aws.services.ec2.ec2_service import Instance
|
||||
from prowler.providers.aws.services.vpc.vpc_service import VpcSubnet
|
||||
|
||||
@@ -15,13 +16,13 @@ def get_instance_public_status(
|
||||
tuple: The status and severity of the instance status.
|
||||
"""
|
||||
status = f"Instance {instance.id} has {service} exposed to 0.0.0.0/0 but with no public IP address."
|
||||
severity = "medium"
|
||||
severity = Severity.medium
|
||||
|
||||
if instance.public_ip:
|
||||
status = f"Instance {instance.id} has {service} exposed to 0.0.0.0/0 on public IP address {instance.public_ip} but it is placed in a private subnet {instance.subnet_id}."
|
||||
severity = "high"
|
||||
severity = Severity.high
|
||||
if vpc_subnets[instance.subnet_id].public:
|
||||
status = f"Instance {instance.id} has {service} exposed to 0.0.0.0/0 on public IP address {instance.public_ip} in public subnet {instance.subnet_id}."
|
||||
severity = "critical"
|
||||
severity = Severity.critical
|
||||
|
||||
return status, severity
|
||||
|
||||
Reference in New Issue
Block a user