π§ Unattached Azure Managed Disk is not encrypted with Customer-managed key - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yaml
- Located in: π Unattached Azure Managed Disk is not encrypted with Customer-managed key π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π Azure Managed Disk | CA10__CaAzureManagedDisk__c | 6 | 1 | 3 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:46:31.276103631Z Open
Result | Id | Condition Index | Condition Text | Runtime 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β
File | MD5 | |
---|---|---|
Open | /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/policy.yaml | 484F272F697ABF418E58844FB2211919 |
Open | /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/prod.logic.yaml | D1C81BDA28F350845147A324ACFB0627 |
Open | /ce/ca/azure/virtual-machine/unattached-disk-encryption-with-cmk/test-data.json | C39CF273F1863EC98E7B436F8CDB74E3 |
Open | /types/CA10__CaAzureManagedDisk__c/object.extracts.yaml | F0194C2E5818080A00E360A4D0FC7075 |
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β
---
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."