Skip to main content

🧠 Azure Virtual Machine OS and Data disks are not encrypted with Customer-managed key - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure Virtual DiskCA10__CaAzureVirtualMachineDisk__c411

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-05-10T12:04:09.242159826Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ isEmptyLookup('CA10__managedDiskLookup__r')βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ extract('CA10__managedDiskLookup__r.CA10__encryptionType__c') == 'ENCRYPTIONATRESTWITHPLATFORMKEY'βœ”οΈ null
🟒test4βœ”οΈ 399βœ”οΈ extract('CA10__managedDiskLookup__r.CA10__encryptionType__c') == 'ENCRYPTIONATRESTWITHPLATFORMANDCUSTOMERKEYS' || extract('CA10__managedDiskLookup__r.CA10__encryptionType__c') == 'ENCRYPTIONATRESTWITHCUSTOMERKEY'βœ”οΈ null
🟒test5βœ”οΈ 399βœ”οΈ extract('CA10__managedDiskLookup__r.CA10__encryptionType__c') == 'ENCRYPTIONATRESTWITHPLATFORMANDCUSTOMERKEYS' || extract('CA10__managedDiskLookup__r.CA10__encryptionType__c') == 'ENCRYPTIONATRESTWITHCUSTOMERKEY'βœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/policy.yamlE172A5F7C73EE6F36B068CDC41A5C786
Open/ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml05D5A4AC4CCDD235021B20F85F6B61D7
Open/types/CA10__CaAzureManagedDisk__c/object.extracts.yaml324855F25B28A4A6B8613A3E228EEA01
Open/ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/test-data.jsonA536C71FF3EF22388E35FD9485006966

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/virtual-machine/os-and-data-disks-encryption-with-cmk/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAzureVirtualMachineDisk__c"
importExtracts:
- file: "/types/CA10__CaAzureManagedDisk__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is a VHD."
check:
IS_EMPTY_LOOKUP: "CA10__managedDiskLookup__r"
- status: "INCOMPLIANT"
currentStateMessage: "The disk is encrypted at rest with the Platform Key."
remediationMessage: "Consider encrypting the disk with a Customer Managed Key, if data stored in the disk is important.
If data stored in the disk is no longer useful, consider deleting it."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__managedDiskLookup__r.CA10__encryptionType__c"
right:
TEXT: "ENCRYPTIONATRESTWITHPLATFORMKEY"
- status: "COMPLIANT"
currentStateMessage: "The disk is encrypted with a Customer Managed Key."
check:
OR:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__managedDiskLookup__r.CA10__encryptionType__c"
right:
TEXT: "ENCRYPTIONATRESTWITHPLATFORMANDCUSTOMERKEYS"
- IS_EQUAL:
left:
EXTRACT: "CA10__managedDiskLookup__r.CA10__encryptionType__c"
right:
TEXT: "ENCRYPTIONATRESTWITHCUSTOMERKEY"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected value in the field."