57 lines
2.1 KiB
YAML
57 lines
2.1 KiB
YAML
id: azure-servicebus-public-access-disabled
|
|
info:
|
|
name: Azure Service Bus Public Network Access Disabled
|
|
author: princechaddha
|
|
severity: high
|
|
description: |
|
|
Ensure that public network access (i.e., all network access) to Microsoft Azure Service Bus namespaces is disabled in order to enhance security by preventing unauthorized access.
|
|
impact: |
|
|
Enabling public network access to Service Bus namespaces can allow unauthorized access, potentially leading to data leakage or unauthorized operations.
|
|
remediation: |
|
|
Disable public network access to all your Azure Service Bus namespaces to ensure that they are only accessible through authorized private networks.
|
|
reference:
|
|
- https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-networking
|
|
tags: cloud,devops,azure,microsoft,service-bus,azure-cloud-config
|
|
|
|
flow: |
|
|
code(1);
|
|
for (let NamespaceData of iterate(template.namespaceList)) {
|
|
NamespaceData = JSON.parse(NamespaceData);
|
|
set("name", NamespaceData.name);
|
|
set("resourceGroup", NamespaceData.resourceGroup);
|
|
code(2);
|
|
}
|
|
|
|
self-contained: true
|
|
code:
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
az servicebus namespace list --output json --query '[*].{"name":name,"resourceGroup":resourceGroup}'
|
|
|
|
extractors:
|
|
- type: json
|
|
name: namespaceList
|
|
internal: true
|
|
json:
|
|
- '.[]'
|
|
|
|
- engine:
|
|
- sh
|
|
- bash
|
|
source: |
|
|
az servicebus namespace network-rule-set show --namespace-name "$name" --resource-group "$resourceGroup" --query '{publicNetworkAccess:publicNetworkAccess,ipRules:ipRules}'
|
|
|
|
matchers:
|
|
- type: word
|
|
words:
|
|
- '"ipRules": []'
|
|
- '"publicNetworkAccess": "Enabled"'
|
|
condition: and
|
|
|
|
extractors:
|
|
- type: dsl
|
|
dsl:
|
|
- 'name + " in " + resourceGroup + " has public network access enabled with no IP rules set"'
|
|
# digest: 490a0046304402204872987b0f663798383a2aba227cc1dd94206e3ba293df990386a33e45cdc8a802203ef02608b40658b3e71a54dbdb9f34770c13267200ac08217c08a1da9333bd7b:922c64590222798bb761d5b6d8e72950 |