Method: Inspec::Resources::AzureVirtualMachine#password_authentication?

Defined in:
lib/resources/azure/azure_virtual_machine.rb

#password_authentication?Boolean

Deteremine if the machine allows password authentication



135
136
137
138
139
140
141
142
143
# File 'lib/resources/azure/azure_virtual_machine.rb', line 135

def password_authentication?
  # if the osProfile property has a linuxConfiguration section then interrogate that
  # otherwise it is a Windows machine and that always has password auth
  if defined?(properties.osProfile.linuxConfiguration)
    !properties.osProfile.linuxConfiguration.disablePasswordAuthentication
  else
    true
  end
end