Inspect doesn't find azure storage network rules

41 Views Asked by At

Trying to use inspec to check my storage accounts in azure have vnets attached, but inspec is just returning nulls.

Checked the docs here (https://learn.microsoft.com/en-us/cli/azure/storage/account?view=azure-cli-latest) to get the property names right, and use the portal and az storage list --name (storagename) and all my end matches up - but inspec says no.

Anyone come across this before?

attached_networks = ['vnet-'+env,'vnet-'+env+'fw']

control 'Networking tests' do
    title 'Testing PAFW Storage Networking rules'
    impact 'high'

    describe azure_storage_account(resource_group: rg_name, name: diag_storage_name) do
          its('properties.networkAcls.virtualNetworkRules') { should be attached_networks }
    end
end






Networking tests: Testin Storage Networking rules
     ×  Azure Storage Account - api_version: 2023-01-01 latest: rg Microsoft.Storage/storageAccounts mystorage properties.networkAcls.virtualNetworkRules is expected to equal "vnet-test" and "vnet-test-fw"
     can't convert #<Class:0x0000558969393da0>::AzureResourceProbe to Array (#<Class:0x0000558969393da0>::AzureResourceProbe#to_ary gives #<Class:0x0000558969393da0>::NullResponse)
0

There are 0 best solutions below