azure-vnet-subnet-located-in

explicit azure emits LocatedIn

match (record)

{ "field": "id", "resource_type": "Microsoft.Network/virtualNetworks/subnets" }

emit

source typeSubnet
target typeVirtualNetwork
source<subnet>
target<parent VNet>

Narrative

Subnet {subnet.name} is located in VNet {vnet.name}.

Raw rule rules/explicit/azure-vnet.yaml

id: azure-vnet-subnet-located-in
emits: LocatedIn
applies_to:
- azure
match_record:
  resource_type: Microsoft.Network/virtualNetworks/subnets
  field: id
emit:
  source_type: Subnet
  target_type: VirtualNetwork
  source: <subnet>
  target: <parent VNet>
  api_source: Microsoft.Network/virtualNetworks GET (subnets array)
  evidence_field: subnets[].id (parent VNet from resource id path)
  narrative: Subnet {subnet.name} is located in VNet {vnet.name}.
move · open · esc close