Skip to main content

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

Uses​

Test Results πŸŸ’β€‹

Generated at: 2026-02-10T22:33:31.537911131Z 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 Bundle​

FileMD5
Open/ce/ca/azure/monitor/diagnostic-setting-categories/policy.yaml6717D14002CB25FB546A0C4007911D02
Open/ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml6BC88D251A51C85B2990D5B8B7C098D4
Open/ce/ca/azure/monitor/diagnostic-setting-categories/test-data.json7C5C255C035DF0312BE934B2B2729D36
Open/types/CA10__CaAzureDiagnosticSetting__c/object.extracts.yaml4AADFEBE59E43127A2529B2F0DB31297

Available Commands​

repo-manager policies generate FULL /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/azure/monitor/diagnostic-setting-categories/prod.logic.yaml
# Execute tests
repo-manager 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: "Capture the Administrative, Alert, Policy, and Security log categories in the diagnostic setting."
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."