# Testing VM disk encryption

**URL:** <https://discourse.chef.io/t/testing-vm-disk-encryption/13853>\
**Category:** Chef InSpec\
**Created:** [October 18, 2018, 9:23am UTC](https://discourse.chef.io/t/testing-vm-disk-encryption/13853 "2018-10-18T09:23:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Northenrstar002](https://avatars.discourse-cdn.com/v4/letter/n/839c29/32.png) [@Northenrstar002](https://discourse.chef.io/u/Northenrstar002)\
**Post date:** [October 18, 2018, 9:23am UTC](https://discourse.chef.io/t/testing-vm-disk-encryption/13853/1 "2018-10-18T09:23:20Z")

</div>

I'm trying to have InSpec test the disks attached to my VMs in Azure by running the following:

describe azurerm\_virtual\_machine\_disk(resource\_group: 'xxx\_xxx', name: 'xxx\_xxx') do  
it { should exist }  
it('encryption\_enabled') { should be true }  
its('disk\_encryption') { should eq('On') }  
its('storage\_encryption') { should eq('On') }

In the Inspec.yml I have the following defined: [https://github.com/inspec/inspec-azure.git](https://github.com/inspec/inspec-azure.git)

The responses I'm getting are:

✔ 'xxx\_xxx' Disk should exist

× 'xxx\_xxx' Disk encryption\_enabled

```
 expected true
      got #<#<Class:0x00007f8cb89ad9d0>:70121145957460> => 'xxx_xxx' Disk

 × 'xxx_xxx' Disk disk_encryption undefined method `disk_encryption' for 'xxx_xxx' Disk:# Class:0x00007fcf3d82ecb8>

 × 'xxxx_xxx' Disk storage_encryption undefined method `storage_encryption' for 'xxx_xxx' Disk:#<Class:0x00007fcf3d82ecb8>

```

What am I doing wrong?
