Skip to main content

🧠 Azure Diagnostic Setting Logs export to Storage Account not encrypted with Customer-managed key - prod.logic.yaml🟒

Uses​

Test Results πŸŸ’β€‹

Generated at: 2026-02-10T22:33:31.458056511Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ not(setOfText(['caDiagnosticSettingOnAzureSubscription']).contains(RecordType.DeveloperName))βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ isEmptyLookup('CA10__storageAccount__r')βœ”οΈ null
🟒test4βœ”οΈ 399βœ”οΈ extract('CA10__storageAccount__r.CA10__encryptionKeySource__c') != 'Microsoft.Keyvault' && extract('CA10__storageAccount__r.CA10__encryptionKeyVaultUri__c').isEmpty()βœ”οΈ null
🟒test5βœ”οΈ 499βœ”οΈ extract('CA10__storageAccount__r.CA10__encryptionKeySource__c') == 'Microsoft.Keyvault' && extract('CA10__storageAccount__r.CA10__encryptionKeyVaultUri__c').isNotEmpty()βœ”οΈ null

Generation Bundle​

FileMD5
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/policy.yamlED87596E4CEAC300F625684C5AD6A10F
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yamlF9857A406C398B0B5A50E2E24E9FA394
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/test-data.json784EE622A12546C08CEB8FB3392E83A8
Open/types/CA10__CaAzureStorageAccount__c/object.extracts.yaml2FD9F962F192FC3E335D23D11315B8F9

Available Commands​

repo-manager policies generate FULL /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml

Content​

Open File

inputType: "CA10__CaAzureDiagnosticSetting__c"
recordTypes:
- "caDiagnosticSettingOnAzureSubscription"
importExtracts:
- file: "/types/CA10__CaAzureStorageAccount__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "Diagnostic setting logs are not sent to a storage account."
check:
IS_EMPTY_LOOKUP: "CA10__storageAccount__r"
- status: "INCOMPLIANT"
currentStateMessage: "Diagnostic setting logs are sent to a storage account without a customer-managed key."
remediationMessage: "Encrypt the destination storage account with a customer-managed key."
check:
AND:
args:
- NOT_EQUAL:
left:
EXTRACT: "CA10__storageAccount__r.CA10__encryptionKeySource__c"
right:
TEXT: "Microsoft.Keyvault"
- IS_EMPTY:
arg:
EXTRACT: "CA10__storageAccount__r.CA10__encryptionKeyVaultUri__c"
- status: "COMPLIANT"
currentStateMessage: "Diagnostic setting logs are sent to a storage account encrypted with a customer-managed key."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__storageAccount__r.CA10__encryptionKeySource__c"
right:
TEXT: "Microsoft.Keyvault"
- NOT_EMPTY:
arg:
EXTRACT: "CA10__storageAccount__r.CA10__encryptionKeyVaultUri__c"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."