Ensure the log profile captures activity logs for all regions including global
Configure the log profile to export activities from all Azure supported regions/locations including global.
Risk Level: Low
Cloud Entity: Log Profile
CloudGuard Rule ID: D9.AZU.LOG.02
Covered by Spectral: Yes
Category: Global
GSL LOGIC
LogProfile should have properties.locations length()>=65
REMEDIATION
From Portal
- Go to Activity log
- Click on Export
- Select Subscription
- In Regions dropdown list, check Select all
- Select Save
From TF
Set the 'locations' arguments under 'azurerm_monitor_log_profile' as all the location in your subscription and 'global'.:
resource "azurerm_monitor_log_profile" "example" {
..
locations = [
"LIST_OF_REGIONS",
..
..
"global",
]
..
}
From Command Line
Run
az monitor log-profiles create --categories CATEGORY --days NUMBEROFDAYS --enabled true --location LOCATION --locations LIST_OF_REGIONS --name MYLOGPROFILE --storage-account-id STORAGEACCOUNTID
NOTE : To get the list of supported regions for the current subscription run :
az account list-locations --query '[*].name'
References
- https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/activity-log?tabs=powershell#work-with-legacy-settings
- https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_log_profile
- https://learn.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-list-locations
- https://learn.microsoft.com/en-us/cli/azure/monitor/log-profiles?view=azure-cli-latest#az-monitor-log-profiles-create
Log Profile
The Azure activity log captures control/management activities performed on a subscription. By default, the Azure Portal retains activity logs only for 90 days. The Log Profile defines the type of events that are stored or streamed and the outputs���storage account and/or event hub. The Log Profile, if configured properly, can ensure that all activity logs are retained for longer dur
Compliance Frameworks
- Azure CIS Foundations v. 1.1.0
- Azure CloudGuard Best Practices
- Azure HITRUST v9.5.0
- Azure ITSG-33
- CloudGuard Azure All Rules Ruleset
Updated about 1 year ago