Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 5, 2025

Description

This PR implements a new rule Azure.ACR.Logs (AZR-000498) that ensures audit diagnostic logs are enabled for Azure Container Registry resources. This addresses the security best practice of monitoring authentication and repository access events for compliance and security investigation purposes.

Changes

  • New Rule: Azure.ACR.Logs checks that Container Registry instances have diagnostic settings configured to capture audit events
  • Log Categories: The rule validates that at least one of the following is enabled:
    • ContainerRegistryLoginEvents - captures authentication events to the registry
    • ContainerRegistryRepositoryEvents - captures push and pull operations for container images
    • Alternative: audit or allLogs category groups
  • Documentation: Added comprehensive documentation with ARM and Bicep examples
  • Tests: Added 6 new test cases covering various diagnostic settings configurations
  • Metadata:
    • Rule reference: AZR-000498
    • Rule set: 2025_12
    • Pillar: Security
    • MCSB control: LT-4
    • WAF maturity: L1
    • Severity: Important

Example

A Container Registry that passes this rule:

resource registry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {
  name: name
  location: location
  sku: {
    name: 'Premium'
  }
  properties: {
    adminUserEnabled: false
  }
}

resource logs 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  name: 'logs'
  scope: registry
  properties: {
    workspaceId: workspaceId
    logs: [
      {
        category: 'ContainerRegistryLoginEvents'
        enabled: true
      }
      {
        category: 'ContainerRegistryRepositoryEvents'
        enabled: true
      }
    ]
  }
}

Related Issues

Fixes #3536

References

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • management.azure.com

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[RULE] Collect audit logs for Azure Container Reigstry</issue_title>
<issue_description>### Existing rule

No response

Suggested rule

Enable Azure resource logs for Container Registry for ContainerRegistryLoginEvents and ContainerRegistryRepositoryEvents.

Pillar

Security

Additional context

Similar to Azure.KeyVault.Logs

Comments on the Issue (you are @copilot in this section)

Fixes #3445

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: BernieWhite <13513058+BernieWhite@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] [RULE] Collect audit logs for Azure Container Reigstry Add Azure.ACR.Logs rule to collect audit logs for Container Registry Oct 5, 2025
@Copilot Copilot AI requested a review from BernieWhite October 5, 2025 08:40
Copilot finished work on behalf of BernieWhite October 5, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RULE] Collect audit logs for Azure Container Reigstry

2 participants