You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Choose one: is this a 🐛 bug report or 🙋 feature request? Bug Report
When testing allow_rdp_from_internet or allow_ssh_from_internet against NSGs that contain multiple source addresses, the test will fail and return the error "no member 'sourceAddressPrefix' in struct".
🌍 InSpec and Platform Version
Inspec Version 3.6.6
macOS 10.14.3
🤔 Replication Case
Create an NSG in Azure that contains source IP restriction for RDP with multiple IP addresses.
Run test allow_rdp_from_internet against NSG.
💁 Possible Solutions
I was able to resolve the issue by editing the source_open? method in azurerm_network_security_group.rb with the following code.
def source_open?(properties)
properties_hash = properties.to_h
if properties_hash.include?(:sourceAddressPrefix)
return properties['sourceAddressPrefix'] =~ %r{\*|0\.0\.0\.0|<nw>\/0|\/0|Internet|any}
end
if properties_hash.include?(:sourceAddressPrefixes)
return properties['sourceAddressPrefixes'].include?('0.0.0.0')
end
end
The text was updated successfully, but these errors were encountered:
🎛 Description
Choose one: is this a 🐛 bug report or 🙋 feature request? Bug Report
When testing allow_rdp_from_internet or allow_ssh_from_internet against NSGs that contain multiple source addresses, the test will fail and return the error "no member 'sourceAddressPrefix' in struct".
🌍 InSpec and Platform Version
Inspec Version 3.6.6
macOS 10.14.3
🤔 Replication Case
Create an NSG in Azure that contains source IP restriction for RDP with multiple IP addresses.
Run test allow_rdp_from_internet against NSG.
💁 Possible Solutions
I was able to resolve the issue by editing the source_open? method in azurerm_network_security_group.rb with the following code.
The text was updated successfully, but these errors were encountered: