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.
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"...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.