Updated README for the new resources

Fixes #5

Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
This commit is contained in:
Russell Seymour 2017-02-20 10:05:40 +00:00
parent c8378d513e
commit d5a9a39a00
3 changed files with 19 additions and 5 deletions

View file

@ -114,6 +114,16 @@ end
| azure_vm | publisher | Publisher that provided the image in the marketplace |
| | offer | The offer of the image |
| | sku | The SKU being used |
| | size | The size of the machine |
| | location | Where the machine has been deployed |
| | boot_diagnostics? | Whether boot diagnostics have been enabled or not |
| | nic_count | How many network cards are attached to the machine |
| | username | The admin username that has been assigned to the machine |
| | computername | Computer name of the machine in the operating system. This maybe different to the VM name as seen in Azure |
| | hostname | Alias for computername |
| | password_authentication? | If password authentication is enabled. For Windows machines this is always true |
| | ssh_key_count | How many SSH public keys have been added to the machine. For Windows this is always 0 |
| | os_type | Tyep type of operating system. Linux or Windows |
- `azure_vm_datadisks` - Resource to read the data disks for a machine and check that they are of the correct size etc

View file

@ -124,7 +124,6 @@ class AzureVm < Inspec.resource(1)
# Boolean
#
def password_authentication?
# if the vm has a linux configuration then interrogate that, otherwise return true
if !vm.os_profile.linux_configuration.nil?
!vm.os_profile.linux_configuration.disable_password_authentication
@ -140,13 +139,11 @@ class AzureVm < Inspec.resource(1)
# Integer
#
def ssh_key_count
if !vm.os_profile.linux_configuration.nil?
vm.os_profile.linux_configuration.ssh.public_keys.length
else
0
end
end
# Determine the Operating system type using the os_disk object
@ -157,5 +154,4 @@ class AzureVm < Inspec.resource(1)
def os_type
vm.storage_profile.os_disk.os_type
end
end

View file

@ -29,7 +29,7 @@ class AzureVmDataDisks < Inspec.resource(1)
@params = parse_data_disks(vm.storage_profile.data_disks)
end
# Create a filter table for testing
# Create a FilterTable which can be used by controls to interogate the data disks
filter = FilterTable.create
filter.add_accessor(:where)
.add_accessor(:entries)
@ -46,10 +46,18 @@ class AzureVmDataDisks < Inspec.resource(1)
filter.connect(self, :params)
# Determine how many data disks have been applied to the machine
#
# == Returns:
# Integer
def count
entries.length
end
# Determine if any data disks are attached to the machine
#
# == Returns:
# Boolean
def has_disks?
entries.!empty?
end