diff --git a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_firewall_use_selected_networks/cosmosdb_account_firewall_use_selected_networks.py b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_firewall_use_selected_networks/cosmosdb_account_firewall_use_selected_networks.py index 7be20270ce..90bf3da355 100644 --- a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_firewall_use_selected_networks/cosmosdb_account_firewall_use_selected_networks.py +++ b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_firewall_use_selected_networks/cosmosdb_account_firewall_use_selected_networks.py @@ -7,12 +7,11 @@ class cosmosdb_account_firewall_use_selected_networks(Check): findings = [] for subscription, accounts in cosmosdb_client.accounts.items(): for account in accounts: - report = Check_Report_Azure(self.metadata()) + report = Check_Report_Azure( + metadata=self.metadata(), resource_metadata=account + ) report.subscription = subscription - report.resource_name = account.name - report.resource_id = account.id report.status = "FAIL" - report.location = account.location report.status_extended = f"CosmosDB account {account.name} from subscription {subscription} has firewall rules that allow access from all networks." if account.is_virtual_network_filter_enabled: report.status = "PASS" diff --git a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_aad_and_rbac/cosmosdb_account_use_aad_and_rbac.py b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_aad_and_rbac/cosmosdb_account_use_aad_and_rbac.py index 7e843afda0..1aa25d65e8 100644 --- a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_aad_and_rbac/cosmosdb_account_use_aad_and_rbac.py +++ b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_aad_and_rbac/cosmosdb_account_use_aad_and_rbac.py @@ -7,12 +7,11 @@ class cosmosdb_account_use_aad_and_rbac(Check): findings = [] for subscription, accounts in cosmosdb_client.accounts.items(): for account in accounts: - report = Check_Report_Azure(self.metadata()) + report = Check_Report_Azure( + metadata=self.metadata(), resource_metadata=account + ) report.subscription = subscription - report.resource_name = account.name - report.resource_id = account.id report.status = "FAIL" - report.location = account.location report.status_extended = f"CosmosDB account {account.name} from subscription {subscription} is not using AAD and RBAC" if account.disable_local_auth: report.status = "PASS" diff --git a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_private_endpoints/cosmosdb_account_use_private_endpoints.py b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_private_endpoints/cosmosdb_account_use_private_endpoints.py index 315f8de7c5..b99d3dd9fb 100644 --- a/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_private_endpoints/cosmosdb_account_use_private_endpoints.py +++ b/prowler/providers/azure/services/cosmosdb/cosmosdb_account_use_private_endpoints/cosmosdb_account_use_private_endpoints.py @@ -7,12 +7,11 @@ class cosmosdb_account_use_private_endpoints(Check): findings = [] for subscription, accounts in cosmosdb_client.accounts.items(): for account in accounts: - report = Check_Report_Azure(self.metadata()) + report = Check_Report_Azure( + metadata=self.metadata(), resource_metadata=account + ) report.subscription = subscription - report.resource_name = account.name - report.resource_id = account.id report.status = "FAIL" - report.location = account.location report.status_extended = f"CosmosDB account {account.name} from subscription {subscription} is not using private endpoints connections" if account.private_endpoint_connections: report.status = "PASS" diff --git a/prowler/providers/azure/services/cosmosdb/cosmosdb_service.py b/prowler/providers/azure/services/cosmosdb/cosmosdb_service.py index 8e467fd5af..bd5eb5a81b 100644 --- a/prowler/providers/azure/services/cosmosdb/cosmosdb_service.py +++ b/prowler/providers/azure/services/cosmosdb/cosmosdb_service.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from azure.mgmt.cosmosdb import CosmosDBManagementClient from azure.mgmt.cosmosdb.models import PrivateEndpointConnection @@ -50,5 +50,7 @@ class Account: tags: dict is_virtual_network_filter_enabled: bool location: str - private_endpoint_connections: list[PrivateEndpointConnection] = None + private_endpoint_connections: list[PrivateEndpointConnection] = field( + default_factory=list + ) disable_local_auth: bool = False