Service Bus topic should enable duplicate detection
Medium
Azure
General
topics-service-bus-topic-enable
Applies to
Microsoft.ServiceBus/namespaces/topics
What CGPulse checks
A resource passes this rule when requiresDuplicateDetection must equal true. Anything else is reported as a finding with the evaluated property value attached as evidence.
How to fix it
Enable duplicate detection to prevent publishing duplicate messages. In Azure Portal: Service Bus > Topics > create topic with Duplicate detection enabled. See: https://learn.microsoft.com/en-us/azure/service-bus-messaging/duplicate-detection
CLI
az servicebus topic create -g "{rg}" --namespace-name "<namespace-name>" -n "<topic-name>" --enable-duplicate-detection true --duplicate-detection-history-time-window P1DBicep
resource topic 'Microsoft.ServiceBus/namespaces/topics@2024-01-01' = {
name: '<topic-name>'
parent: serviceBusNamespace
properties: {
requiresDuplicateDetection: true
duplicateDetectionHistoryTimeWindow: 'P1D'
}
}Terraform
resource "azurerm_servicebus_topic" "{name}" {
name = "<topic-name>"
namespace_id = azurerm_servicebus_namespace.{name}.id
requires_duplicate_detection = true
duplicate_detection_history_time_window = "P1D"
}
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