fix(azure): remove duplicated findings in entra_user_with_vm_access_has_mfa (#9914)

This commit is contained in:
Hugo Pereira Brito
2026-01-29 12:20:15 +01:00
committed by GitHub
parent e97e31c7ca
commit c183a2a89a
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -29,6 +29,10 @@ All notable changes to the **Prowler SDK** are documented in this file.
- Update Azure Defender service metadata to new format [(#9618)](https://github.com/prowler-cloud/prowler/pull/9618)
- Make AWS cross-account checks configurable through `trusted_account_ids` config parameter [(#9692)](https://github.com/prowler-cloud/prowler/pull/9692)
### Fixed
- Duplicated findings in `entra_user_with_vm_access_has_mfa` check when user has multiple VM access roles [(#9914)](https://github.com/prowler-cloud/prowler/pull/9914)
---
## [5.17.0] (Prowler v5.17.0)
@@ -15,6 +15,7 @@ from prowler.providers.azure.services.iam.iam_client import iam_client
class entra_user_with_vm_access_has_mfa(Check):
def execute(self) -> Check_Report_Azure:
findings = []
already_reported = set()
for users in entra_client.users.values():
for user in users.values():
@@ -22,6 +23,9 @@ class entra_user_with_vm_access_has_mfa(Check):
subscription_name,
role_assigns,
) in iam_client.role_assignments.items():
if (user.id, subscription_name) in already_reported:
continue
for assignment in role_assigns.values():
if (
assignment.agent_type == "User"
@@ -48,5 +52,7 @@ class entra_user_with_vm_access_has_mfa(Check):
report.status_extended = f"User {user.name} can access VMs in subscription {subscription_name} but it has MFA."
findings.append(report)
already_reported.add((user.id, subscription_name))
break
return findings