Azure / Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
https://aka.ms/alz
MIT License
1.69k stars 964 forks source link

Policy 'Deploy Diagnostic Settings for Log Analytics to Log Analytics workspace' is always incompliant #1513

Closed Thijsfk closed 8 months ago

Thijsfk commented 9 months ago

Describe the bug

The policy definition 'Deploy Diagnostic Settings for Log Analytics to Log Analytics workspace' in initiative 'Deploy-Diagnostics-LogAnalytics' stays incompliant after remediation because the Log category "SummaryLogs" is missing. To fix this the summarylogs category could be added: ``` "logs": [ { "category": "Audit", "enabled": "[parameters('logsEnabled')]" }, { "category": "SummaryLogs", "enabled": "[parameters('logsEnabled')]" } ] ``` or the Category Groups can be utilized (in this case AllLogs).

Steps to reproduce

  1. Assign either 'Deploy-Diagnostics-LogAnalytics' or policy 'Deploy Diagnostic Settings for Log Analytics to Log Analytics workspace' to a scope with a Log Analytics Workspace
  2. Remediate the resource
  3. See that while the Diagnostic Settings are deployed, the resource is still incompliant
  4. Change the Policy Definition to include the Summary Logs, or enable Category Group AllLogs, and Remediate to see that it then will be compliant

Screenshots

image image

Springstone commented 8 months ago

@Thijsfk thank you for raising this issue. Please note that we will be transitioning to new built-in diagnostic settings policies when they land in the coming weeks:

We've been working closely with the product group on the new policies, which come in 3 "flavors" covering 139 Azure services (including MySQL Flexible) - the flavors are for the log targets being Log Analytics, Event Hub or Storage. With this we will also get two initiatives for each flavor, one for all logs and one for only audit logs (418 new policies and 6 new initiatives!!). Once they're published (the process takes a few weeks) we will be deprecating our custom diagnostic settings policies and changing the default assignment to use the built-in initiative(s).

I hope this is clear, feel free to reopen the issue if you have any questions.