Skip to main content

🧠 Azure Subscription Security Alert Notifications for alerts with High severity are not configured - prod.logic.yaml 🟒

Flags​

Input Type​

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

Uses​

Test Results πŸŸ’β€‹

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

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 199βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications__c').isEmpty()βœ”οΈ null
🟒test2βœ”οΈ 299βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications__c') != 'On'βœ”οΈ null
🟒test3βœ”οΈ 499βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications_severity__c') == 'High' && extract('caJsonQueryText__securityCenterContacts_default_alert_notifications__c') == 'On'βœ”οΈ null
🟒test4βœ”οΈ 101βœ”οΈ CA10__securityCenterContacts__c.delegatedTo(CA10__securityCenterContacts__c).isEmpty()βœ”οΈ null
🟒test5βœ”οΈ 103βœ”οΈ extract('CA10__securityCenterContacts__c').asJson().isInvalid()βœ”οΈ Expected property name or '}' in JSON at position 1 (line 1 column 2)
🟒test6βœ”οΈ 199βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications__c').isEmpty()βœ”οΈ null
🟒test7βœ”οΈ 199βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications__c').isEmpty()βœ”οΈ null
🟒test8βœ”οΈ 399βœ”οΈ extract('caJsonQueryText__securityCenterContacts_default_alert_notifications_severity__c') != 'High'βœ”οΈ null

Generation​

FileMD5
Open/ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/policy.yamlD35C1CE1B8DF71F90F90FDDC4024619C
Open/ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml80023100CBFCD586D792966D318FC9CE
Open/types/CA10__CaAzureAccount__c/object.extracts.yaml9C78116D7D6EA5327842D3BC5DCF8980
Open/ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/test-data.json5415B05C9EF8937453325A9070DB02E3

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/azure/subscription/security-alert-notifications-for-alerts-with-high-severity/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAzureAccount__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10__CaAzureAccount__c/object.extracts.yaml"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "Security notifications emailing is not enabled."
remediationMessage: "Consider enabling security notifications emailing to the subscription owner or other designated security contact."
# Extract only for the default contact
check:
IS_EMPTY:
arg:
EXTRACT: "caJsonQueryText__securityCenterContacts_default_alert_notifications__c"
- status: "INCOMPLIANT"
currentStateMessage: "Security notifications emailing is not enabled."
remediationMessage: "Consider enabling security notifications emailing to the subscription owner or other designated security contact."
# Extract only for the default contact
check:
NOT_EQUAL:
left:
EXTRACT: "caJsonQueryText__securityCenterContacts_default_alert_notifications__c"
right:
TEXT: "On"
- status: "INCOMPLIANT"
currentStateMessage: "Security notifications for alerts with High severity is not set."
remediationMessage: "Consider enabling security notifications for alerts with High severity."
# Extract only for the default contact
check:
NOT_EQUAL:
left:
EXTRACT: "caJsonQueryText__securityCenterContacts_default_alert_notifications_severity__c"
right:
TEXT: "High"
- status: "COMPLIANT"
currentStateMessage: "Security alerts emailing is not enabled."
# Extract only for the default contact
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "caJsonQueryText__securityCenterContacts_default_alert_notifications_severity__c"
right:
TEXT: "High"
- IS_EQUAL:
left:
EXTRACT: "caJsonQueryText__securityCenterContacts_default_alert_notifications__c"
right:
TEXT: "On"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."