Skip to main content

🧠 Azure Subscription Activity Log Alert for Create Policy Assignment does not exist - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• Azure SubscriptionCA10__CaAzureAccount__c13131

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:46:07.504301328Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ CA10__Azure_Activity_Log_Alerts__r.has(COMPLIANT)βœ”οΈ null
🟒test3βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test4βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test5βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test6βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test7βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test8βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test9βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test10βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test11βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null
🟒test12βœ”οΈ 200βœ”οΈ otherwiseβœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/policy.yaml309E17C9E5B777852E926F87833945EC
Open/ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yamlDFCB3B290D01898004E10038DC3FAAC8
Open/types/CA10__CaAzureActivityLogAlert__c/object.extracts.yaml79B153D6511F943B6AB929697CE0452E
Open/ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/test-data.json9C544589AAC6F3F97F7B51BAE3D41FD1

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/subscription/activity-log-alert-for-create-policy-assignment/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAzureAccount__c"
testData:
- file: "test-data.json"
conditions:
- status: "COMPLIANT"
currentStateMessage: "This subscription has an Activity Log Alert for Create Policy Assignment."
check:
RELATED_LIST_HAS:
status: "COMPLIANT"
relationshipName: "CA10__Azure_Activity_Log_Alerts__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This subscription doesn't have an Activity Log Alert for Create Policy Assignment."
remediationMessage: "Consider creating an Activity Log Alert for Create Policy Assignment."
relatedLists:
- relationshipName: "CA10__Azure_Activity_Log_Alerts__r"
importExtracts:
- file: "/types/CA10__CaAzureActivityLogAlert__c/object.extracts.yaml"
conditions:
- status: "INAPPLICABLE"
currentStateMessage: "This is a disabled Activity Log Alert."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__enabledStatus__c"
right:
TEXT: "Enabled"
- status: "COMPLIANT"
currentStateMessage: "This is an Activity Log Alert for Create Policy Assignment."
check:
IS_EQUAL:
left:
JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__conditionJson__c"
expression: "contains(allOf[*].equals, 'Microsoft.Authorization/policyAssignments/write')"
undeterminedIf:
evaluationError: "The JSON query has failed."
resultTypeMismatch: "The JSON query did not return boolean type."
right:
BOOLEAN: true
otherwise:
status: "INAPPLICABLE"
currentStateMessage: "This is an unrelated Activity Log Alert."