Skip to content

bug(arm): adapter ignores NSG rules declared in the security group #11660

Closed

Description

@nikpivkin

Discussed in #11655

The ARM adapter reads NSG rules only from top-level Microsoft.Network/networkSecurityGroups/securityRules resources and adds each of them to every NSG in the template. Rules in the securityRules property of the NSG and rules declared as child resources are ignored, so AZU-0047 and AZU-0050 miss them.

AZU-0047 and AZU-0050 do not report the open SSH rule in this template.

{
  "type": "Microsoft.Network/networkSecurityGroups",
  "name": "example",
  "properties": {
    "securityRules": [
      {
        "name": "ssh-any",
        "properties": {
          "access": "Allow",
          "direction": "Inbound",
          "protocol": "Tcp",
          "sourceAddressPrefix": "*",
          "sourcePortRange": "*",
          "destinationAddressPrefix": "*",
          "destinationPortRange": "22",
          "priority": 100
        }
      }
    ]
  }
}

Trivy should read rules from the securityRules property, from child resources and from top-level resources whose name starts with the NSG name. A rule should belong only to its own NSG. A rule whose NSG cannot be found should still be reported.

Activity

  1. added
    kind/bug
    scan/misconfiguration
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugscan/misconfiguration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions