Activity Log Not Retained or Exported

The subscription's Activity Log is kept only for Azure's default 90 days and is not sent to a workspace, storage or SIEM, limiting investigation of and alerting on management actions.

SeverityLow
CVSS 3.13.1 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N Open in the calculator
CVSS 4.02.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-778: Insufficient Logging
OWASP Top 10A09:2025 Security Logging and Alerting Failures
CategoryInsufficient Logging

Description

The Azure Activity Log records management operations on a subscription's resources, such as creating, changing and deleting resources, role assignments, policy decisions and security alerts, together with who performed them and from where. Azure keeps these events for 90 days and then deletes them. To keep them for longer, query them alongside other logs or alert on them, a diagnostic setting on the subscription must send them to a Log Analytics workspace, a storage account, an event hub or a partner solution.

The finding applies where no such diagnostic setting exists, or where it sends only some categories or sends them to a destination with short retention. An investigation that begins more than 90 days after an attacker's first actions then cannot establish what they changed, which accounts they used or how they gained access, and no alert fires when sensitive operations occur, such as new role assignments, deleted diagnostic settings or changes to network rules. This lengthens the time an attacker can operate unnoticed and weakens the organisation's ability to scope and report an incident, although the 90 days for which the log remains available limit the impact for incidents that are detected quickly.

The gap is identified in Azure Monitor, under the Activity Log's diagnostic settings for each subscription, or with az monitor diagnostic-settings subscription list. Similar gaps are common for Microsoft Entra ID sign-in and audit logs, which are kept for at most 30 days by default, and for resource logs, which are not collected at all unless a diagnostic setting is configured on each resource.

Remediation

  • Create a diagnostic setting on every subscription that sends all Activity Log categories to a central Log Analytics workspace, and keep the data for as long as the organisation's incident response and regulatory needs require.
  • Where long-term or tamper-resistant retention is needed, also send the log to a storage account with an immutability policy, or stream it to the organisation's SIEM through an event hub or a native connector such as Microsoft Sentinel's.
  • Enforce the setting with Azure Policy at management group level, so that new subscriptions are covered automatically.
  • Export Microsoft Entra ID sign-in and audit logs, and the resource logs of key services such as Key Vault, to the same workspace.
  • Create alerts for sensitive operations, including role assignment changes, deletion of policies and diagnostic settings, and network rule changes, and restrict who can change or delete diagnostic settings and the workspace.

Confirm the fix by listing the subscription's diagnostic settings and by querying the AzureActivity table in the workspace for recent events.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Azure and Microsoft 365 Findings

Every Azure and Microsoft 365 finding