Microsoft Secure Tech Accelerator
Apr 03 2024, 07:00 AM - 11:00 AM (PDT)
Microsoft Tech Community

Azure custom policy is not working. Need help!!!!

Copper Contributor

Hi,

 

Trying to check whether SecurityContacts/email presents with this policy. It is not showing. Also the policy execution interval is intermittent. 

 

"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.Security/securityContacts"
},
"then": {
"effect": "AuditIfNotExists",
"details": {
"type": "Microsoft.Security/securityContacts",
"existenceCondition": {
"field": "Microsoft.Security/securityContacts/email",
"exists": "true"
}
}
}
}
1 Reply

Fixed the issue. The issue is that email attribute is null though the SecurityContacts settings is not enabled. So need to check for null values which made the policy to trigger vilations..

 

This issue can be closed..