logo

Database

Terraform Unrestricted Rpc Port 135

Description

Detects Azure Network Security Group (NSG) rules that allow unrestricted access to RPC port 135. Allowing unrestricted access to RPC ports can expose systems to unauthorized access and potential remote code execution attacks since RPC is used for remote procedure calls between systems.

Weakness:

157 - Unrestricted access between network segments

Category: Access Subversion

Detection Strategy

    Identifies Azure NSG rules (azurerm_network_security_rule) or rules within NSG resources (azurerm_network_security_group)

    Checks if any rule allows inbound traffic to port 135 (RPC)

    Verifies if the source address prefix is too permissive (e.g., '*', '0.0.0.0/0', 'Internet')

    Validates the rule's direction is inbound and access is set to allow

Vulnerable code example

provider "azurerm" {
  features {}
}

resource "azurerm_network_security_group" "example" {
  name                = "example-nsg"
  location            = "East US"
  resource_group_name = "example-rg"...

✅ Secure code example

provider "azurerm" {
  features {}
}

resource "azurerm_network_security_group" "example" {
  name                = "example-nsg"
  location            = "East US"
  resource_group_name = "example-rg"...