π§ Azure Diagnostic Setting Logs export to Storage Account not encrypted with Customer-managed key - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
Test Results π’β
Generated at: 2026-02-10T22:33:31.458056511Z Open
| Result | Id | Condition Index | Condition Text | Runtime 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β
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/policy.yaml | ED87596E4CEAC300F625684C5AD6A10F |
| Open | /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml | F9857A406C398B0B5A50E2E24E9FA394 |
| Open | /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/test-data.json | 784EE622A12546C08CEB8FB3392E83A8 |
| Open | /types/CA10__CaAzureStorageAccount__c/object.extracts.yaml | 2FD9F962F192FC3E335D23D11315B8F9 |
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β
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."