Skip to main content

🧠 Azure Subscription Activity Log Alert for Delete SQL Server Firewall Rule 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:12.390159573Z 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-delete-sql-server-firewall-rule/policy.yaml959A540CCDA5D5AE1B994BDADBEA5A76
Open/ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/prod.logic.yaml822AD69D943C12E953CF80D5FCC334AC
Open/types/CA10__CaAzureActivityLogAlert__c/object.extracts.yaml79B153D6511F943B6AB929697CE0452E
Open/ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/test-data.jsonE207C9DF60A2C0E301CA4614810AB657

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/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-delete-sql-server-firewall-rule/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/subscription/activity-log-alert-for-delete-sql-server-firewall-rule/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 Delete SQL Server Firewall Rule."
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 Delete SQL Server Firewall Rule."
remediationMessage: "Consider creating an Activity Log Alert for Delete SQL Server Firewall Rule."
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 Delete SQL Server Firewall Rule."
check:
IS_EQUAL:
left:
JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__conditionJson__c"
expression: "contains(allOf[*].equals, 'Microsoft.Sql/servers/firewallRules/delete')"
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."