Skip to main content

🧠 Unattached Azure Managed Disk is not encrypted with Customer-managed key - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure Managed DiskCA10__CaAzureManagedDisk__c613

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:46:31.276103631Z Open

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

Generation​

FileMD5
Open/ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/policy.yaml484F272F697ABF418E58844FB2211919
Open/ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yamlD1C81BDA28F350845147A324ACFB0627
Open/ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/test-data.jsonC39CF273F1863EC98E7B436F8CDB74E3
Open/types/CA10__CaAzureManagedDisk__c/object.extracts.yamlF0194C2E5818080A00E360A4D0FC7075

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/virtual-machine/unattached-disk-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/unattached-disk-encryption-with-cmk/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAzureManagedDisk__c"
importExtracts:
- file: "/types/CA10__CaAzureManagedDisk__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This isn't an Unattached Disk."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__diskState__c"
right:
TEXT: "Unattached"
- 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__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__encryptionType__c"
right:
TEXT: "ENCRYPTIONATRESTWITHPLATFORMANDCUSTOMERKEYS"
- IS_EQUAL:
left:
EXTRACT: "CA10__encryptionType__c"
right:
TEXT: "ENCRYPTIONATRESTWITHCUSTOMERKEY"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected value in the field."