> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# terraform-admin-port-open-to-world

> A Terraform firewall rule opens an SSH, RDP or database port to every internet address.

## What it flags

An inbound rule in a `.tf` file that accepts `0.0.0.0/0` or `::/0` on SSH (22), RDP (3389) or a database port: MySQL (3306), PostgreSQL (5432), SQL Server (1433), Oracle (1521), MongoDB (27017) or Redis (6379). A port range or an all-protocols rule that covers one of these ports counts too. Internet-wide scanners try these ports within minutes of a host coming up, so an exposed port gets brute-forced or probed for known vulnerabilities. The finding sits on the line that sets the open source range.

Checked resources: `aws_security_group` and `aws_default_security_group` `ingress` blocks, `aws_security_group_rule` with `type = "ingress"`, `aws_vpc_security_group_ingress_rule`, `google_compute_firewall` (ingress, TCP or all protocols, with `ports` or no ports) and Azure `azurerm_network_security_rule` and inline `security_rule` blocks that allow inbound TCP from `*`, `Internet`, `Any` or `0.0.0.0/0`.

Not flagged: ports 80 and 443 and other ranges that miss these ports, private or specific source ranges, egress rules, UDP-only rules, Azure `Deny` rules, and any port, protocol or source range set from a variable, a local value or an interpolated string, because the file does not show its value. Rules written as a list attribute (`ingress = [...]`) instead of blocks are not read.

```hcl theme={null}
ingress {
  from_port   = 22
  to_port     = 22
  protocol    = "tcp"
  cidr_blocks = [var.admin_cidr]
}
```

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "terraform-admin-port-open-to-world": "off" }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.