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

Co-authored-by: Hugo Pereira Brito <101209179+HugoPBrito@users.noreply.github.com>
This commit is contained in:
Prowler Bot
2026-01-29 13:42:05 +01:00
committed by GitHub
parent 448840ff0d
commit 9b0b0f4d7d
@@ -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