Skip to content

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

Merged
HugoPBrito merged 3 commits intomasterfrom
fix-duplicated-users-entra-azure
Jan 29, 2026
Merged

fix(azure): remove duplicated findings in entra_user_with_vm_access_has_mfa#9914
HugoPBrito merged 3 commits intomasterfrom
fix-duplicated-users-entra-azure

Conversation

@HugoPBrito
Copy link
Member

@HugoPBrito HugoPBrito commented Jan 29, 2026

Context

The check entra_user_with_vm_access_has_mfa was reporting duplicated findings when a user had multiple roles that grant VM access (e.g., Owner + Virtual Machine Contributor) within the same subscription.

Fix: #9913

Description

This PR fixes the duplication by tracking which user+subscription combinations have already been reported. Once a finding is generated for a user in a subscription, subsequent role assignments for the same combination are skipped.

Changes:

  • Added a reported_combinations set to track (user.id, subscription_name) pairs
  • Skip processing if the combination was already reported
  • Break out of the role assignment loop after generating a finding

Steps to review

  1. Review the logic change in entra_user_with_vm_access_has_mfa.py
  2. Run the existing tests to verify they still pass
  3. Optionally test with an Azure environment where users have multiple VM-related roles

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

SDK/CLI

  • Are there new checks included in this PR? No

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@HugoPBrito HugoPBrito requested review from a team as code owners January 29, 2026 10:22
@github-actions github-actions bot added the provider/azure Issues/PRs related with the Azure provider label Jan 29, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.99%. Comparing base (e97e31c) to head (f4d2fa5).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9914       +/-   ##
===========================================
+ Coverage   25.64%   85.99%   +60.35%     
===========================================
  Files         836      222      -614     
  Lines       23761     5692    -18069     
===========================================
- Hits         6093     4895     -1198     
+ Misses      17668      797    -16871     
Flag Coverage Δ
prowler-py3.10-aws ?
prowler-py3.10-azure 85.99% <80.00%> (?)
prowler-py3.10-config ?
prowler-py3.11-aws ?
prowler-py3.11-azure 85.99% <80.00%> (?)
prowler-py3.11-config ?
prowler-py3.12-aws ?
prowler-py3.12-azure 85.99% <80.00%> (?)
prowler-py3.12-config ?
prowler-py3.9-aws ?
prowler-py3.9-azure 85.99% <80.00%> (?)
prowler-py3.9-config ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler 85.99% <80.00%> (+60.35%) ⬆️
api ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

🔒 Container Security Scan

Image: prowler:0746e5d
Last scan: 2026-01-29 11:17:03 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 3
Total 3

3 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@HugoPBrito HugoPBrito added the backport-to-v5.17 Backport PR to the v5.17 branch label Jan 29, 2026
@HugoPBrito HugoPBrito requested a review from puchy22 January 29, 2026 10:42
puchy22
puchy22 previously approved these changes Jan 29, 2026
Copy link
Member

@puchy22 puchy22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@HugoPBrito HugoPBrito merged commit c183a2a into master Jan 29, 2026
36 checks passed
@HugoPBrito HugoPBrito deleted the fix-duplicated-users-entra-azure branch January 29, 2026 11:20
@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label Jan 29, 2026
@prowler-bot
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
v5.17

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Hamza-abughazaleh pushed a commit to Raed-sh/prowler that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v5.17 Backport PR to the v5.17 branch provider/azure Issues/PRs related with the Azure provider was-backported The PR was successfully backported to the target branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate findings for check ID entra_user_with_vm_access_has_mfa

3 participants