Back to Checks
nhn

Check for Public IP in NHN Compute Instances

compute_instance_public_ip
Service: computeSeverity: low
OfficialBuilt-inVerified
Resource Type:VMInstance

Check if a floating(public) IP is assigned to an NHN compute instance.

Run this check with Prowler

Run in Prowler Cloud
Run
prowler nhn --checks compute_instance_public_ip

Recommendation

Remove or unassign floating IP if not required to reduce external exposure.

Check Code

from prowler.lib.check.models import Check, CheckReportNHN
from prowler.providers.nhn.services.compute.compute_client import compute_client


class compute_instance_public_ip(Check):
    def execute(self):
        findings = []
        for instance in compute_client.instances:
            report = CheckReportNHN(
                metadata=self.metadata(),
                resource=instance,
            )
            report.status = "PASS"
            report.status_extended = (
                f"VM Instance {instance.name} does not have a public IP."
            )
            if instance.public_ip:
                report.status = "FAIL"
                report.status_extended = f"VM Instance {instance.name} has a public IP."
            findings.append(report)

        return findings