Skip to main content

🧠 Azure Diagnostic Setting captures Administrative, Alert, Policy, and Security categories - prod.logic.yaml 🟒

Flags​

Input Type​

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

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:45:33.087941012Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ RecordType.DeveloperName != 'caDiagnosticSettingOnAzureSubscription'βœ”οΈ null
🟒test3βœ”οΈ 299βœ”οΈ not(extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Administrative].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Alert].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Policy].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Security].enabled | [0]'))βœ”οΈ null
🟒test4βœ”οΈ 300βœ”οΈ otherwiseβœ”οΈ null
🟒test5βœ”οΈ 299βœ”οΈ not(extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Administrative].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Alert].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Policy].enabled | [0]') && extract('caJsonFrom__logsJson__c').jsonQueryText('[? category == Security].enabled | [0]'))βœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/monitor/diagnostic-setting-categories/policy.yaml04D060897D5FE668A60F2C537F6F9A85
Open/ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml24539B2CC16F8161AF4400D4F12AC3D1
Open/ce/ca/azure/monitor/diagnostic-setting-categories/test-data.json7C5C255C035DF0312BE934B2B2729D36
Open/types/CA10__CaAzureDiagnosticSetting__c/object.extracts.yaml1A315A8ECC027A42193366B24979B007

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml

Content​

Open File

inputType: "CA10__CaAzureDiagnosticSetting__c"
importExtracts:
- file: "/types/CA10__CaAzureDiagnosticSetting__c/object.extracts.yaml"
testData:
- file: "test-data.json"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is not a subscription Diagnostic Setting."
check:
NOT_EQUAL:
left:
FIELD:
path: "RecordType.DeveloperName"
right:
TEXT: "caDiagnosticSettingOnAzureSubscription"
- status: "INCOMPLIANT"
currentStateMessage: "The diagnostic setting does not capture the appropriate activities from the management plane."
remediationMessage: "Consider configuring the diagnostic setting to capture Administrative, Alert, Policy, and Security log categories."
check:
NOT:
arg:
AND:
args:
- JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__logsJson__c"
expression: "[? category == `Administrative`].enabled | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return boolean type."
- JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__logsJson__c"
expression: "[? category == `Alert`].enabled | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return boolean type."
- JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__logsJson__c"
expression: "[? category == `Policy`].enabled | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return boolean type."
- JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__logsJson__c"
expression: "[? category == `Security`].enabled | [0]"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return boolean type."
otherwise:
status: "COMPLIANT"
currentStateMessage: "The diagnostic setting captures the appropriate activities from the management plane."