Skip to main content

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

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure Diagnostic SettingCA10__CaAzureDiagnosticSetting__c212

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-05-10T12:02:51.832561477Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ not(['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​

FileMD5
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/policy.yaml0D4AD0E1D0D32FDC788ED3DCCEE3D3B6
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yamlD461FCC9CD93E9A89185440B1FE20593
Open/types/CA10__CaAzureStorageAccount__c/object.extracts.yaml2E0979CA85C35CDB555F32B262F6942F
Open/ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/test-data.json100915FC016D3402D90705864D051AF6

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/monitor/diagnostic-logs-export-to-storage-without-cmk/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar 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: "This Diagnostic Setting logs are not sent to a Storage account."
check:
IS_EMPTY_LOOKUP: "CA10__storageAccount__r"
- status: "INCOMPLIANT"
currentStateMessage: "This Diagnostic Setting logs are sent to a Storage account not encrypted with a Customer-managed Key."
remediationMessage: "Consider encrypting the destination Storage account with a Customer-managed encryption 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: "This Diagnostic Setting logs are sent to a Storage account encrypted with 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."