Event Hub should have sufficient message retention
Medium
Azure
General
eventhubs-event-hub-sufficient-message
Applies to
Microsoft.EventHub/namespaces/eventhubs
What CGPulse checks
A resource passes this rule when messageRetentionInDays must be one of [2,3,4,5,6,7]. Anything else is reported as a finding with the evaluated property value attached as evidence.
How to fix it
Set message retention to at least 2 days for adequate event processing and replay time. In Azure Portal: Event Hub > Properties > set Message retention. See: https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-features#event-retention
CLI
az eventhubs eventhub update --ids "{id}" --message-retention 7Terraform
resource "azurerm_eventhub" "{name}" {
name = "{name}"
namespace_name = "{parent}"
resource_group_name = "{rg}"
partition_count = 2
message_retention = 7
}
Compliance frameworks
Is your environment compliant with this rule?
CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.
Related Azure rules
- Action Group should be enabled
- Activity Log Alert should be enabled
- AKS cluster logs should be sent to Log Analytics
- AKS cluster must enable RBAC
- AKS cluster must enable RBAC
- AKS cluster should be a private cluster
- AKS cluster should disable local accounts
- AKS cluster should enable Azure RBAC for Kubernetes