Sha256: a5267c56a3decac7c4909fce92c8b5f7b34f3719c6d7151b6b6934dd073fdd96

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 KB

Contents

control 'azure_vm_example' do
  title 'Check if the Example VM matches expectations'
  impact 1.0

  describe azure_generic_resource(group_name: 'Inspec-Azure', name: 'Windows-Example-VM') do
    # Check if the VM is located in the correct region
    its('location') { should cmp 'westeurope' }

    # Check if the VM has tags
    it { should_not have_tags }

    # Check if the VM has the correct image
    its('properties.storageProfile.imageReference.publisher') { should cmp 'MicrosoftWindowsServer' }
    its('properties.storageProfile.imageReference.offer') { should cmp 'WindowsServer' }
    its('properties.storageProfile.imageReference.sku') { should cmp '2016-Datacenter' }

    # Check if the VM has the correct size
    its('properties.hardwareProfile.vmSize') { should cmp 'Standard_DS2_v2' }

    # Check if the VM has the correct computer name
    its('properties.osProfile.computerName') { should eq 'SomethingObscure' }

    # Check if the VM has the correct admin username
    its('properties.osProfile.adminUsername') { should eq 'SomethingSecure' }

    # Check if the VM has automatic updates enabled
    its('properties.osProfile.windowsConfiguration.enableAutomaticUpdates') { should be true }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 examples/profile-azure/controls/azure_vm_example.rb
inspec-2.1.21 examples/profile-azure/controls/azure_vm_example.rb
inspec-2.1.10 examples/profile-azure/controls/azure_vm_example.rb
inspec-2.0.32 examples/profile-azure/controls/azure_vm_example.rb
inspec-2.0.17 examples/profile-azure/controls/azure_vm_example.rb