Azure / Azure/Azure-Landing-Zones
(Repeat of 1627: Security Contact failing compliance)
- Dominant language
- PowerShell
- Stars
- 97
- Forks
- 70
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 7
Description
Guys, it's a repeat of Azure/Azure-Landing-Zones#1754.
I've got emails and notifications set, but subscriptions are still failing compliance for no Security Contacts set. I've also confirmed in the UI that the emails and notifications have been set.
Here's my Terraform:
```hcl
resource "azapi_resource" "SecurityContacts" {
type = "Microsoft.Security/securityContacts@2023-12-01-preview"
name = "default"
location = "West Europe"
parent_id = data.azurerm_subscription.current.id
body = {
properties = {
emails = join(";", var.security_contacts)
isEnabled = true
notificationsByRole = {
roles = []
state = "Off"
}
notificationsSources = [
{
sourceType = "AttackPath"
minimalRiskLevel = "Critical"
},
{
sourceType = "Alert"
minimalSeverity = "High"
}
]
}
}
schema_validation_enabled = false
}
```
Additionally:
```powershell
(Invoke-AzRestMethod -Method 'Get' -Path ('/subscriptions/7dfd****/providers/Microsoft.Security/securityContacts?api-version=2023-12-01-preview')).Content | ConvertFrom-Json -Depth 10 | ConvertTo-Json -Depth 10
{
"value": [
{
"properties": {
"notificationsSources": [
{
"minimalRiskLevel": "Critical",
"sourceType": "AttackPath"
},
{
"minimalSeverity": "High",
"sourceType": "Alert"
}
],
"isEnabled": true,
"notificationsByRole": {
"state": "Off",
"roles": []
},
"emails": "(redacted)",
"phone": ""
},
"id": "/subscriptions/7dfd****/providers/Microsoft.Security/securityContacts/default",
"name": "default",
"type": "Microsoft.Security/securityContacts",
"etag": "\"19044f43-0000-0d00-0000-6877d1800000\"",
"location": "West Europe"
}
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.