Check provider logo

Lightsail instance has no publicly accessible ports

lightsail_instance_public

Severityhigh
Servicelightsail
by Prowler

Lightsail instances that have a public IP and at least one firewall rule allowing public ports are treated as publicly exposed. The evaluation inspects instance addressing and port rules to detect any port or range marked public.

Risk

Public IP plus open ports enables Internet scanning, brute force, and exploits.

  • Confidentiality: data exfiltration
  • Integrity: RCE/admin takeover via exposed services
  • Availability: DoS or abuse (botnets, cryptomining), service disruption
Run this check with Prowler CLI

prowler aws --checks lightsail_instance_public

Recommendation

Apply least privilege network access: close unused ports, restrict sources (avoid 0.0.0.0/0), and review IPv4/IPv6 rules. Use a VPN or bastion host for administration. Place services behind private networking or load balancers, and harden/monitor any required public endpoints.

Remediation

CLI

aws lightsail put-instance-public-ports --instance-name <example_resource_name> --port-infos '[]'

Native IaC
Terraform
Other
  1. Sign in to the AWS Lightsail console
  2. Go to Instances and select <example_resource_name>
  3. Open the Networking tab
  4. In IPv4 Firewall, delete all existing rules, then Save
  5. If IPv6 is enabled, in IPv6 Firewall, delete all existing rules, then Save

Source Code

Resource Type

Other

References