Skip to content

feat(m365): add exchange_shared_mailbox_sign_in_disabled check#9828

Merged
HugoPBrito merged 5 commits intomasterfrom
feat/exchange_shared_mailbox_sign_in_disabled
Jan 26, 2026
Merged

feat(m365): add exchange_shared_mailbox_sign_in_disabled check#9828
HugoPBrito merged 5 commits intomasterfrom
feat/exchange_shared_mailbox_sign_in_disabled

Conversation

@andoniaf
Copy link
Member

Context

Add new security check for Microsoft 365 Exchange Online to verify that shared mailboxes have sign-in blocked in Entra ID.

Based on CIS Microsoft 365 Foundations Benchmark v5.0.0 - Requirement 1.2.2.

Description

This PR adds a new M365 Exchange check exchange_shared_mailbox_sign_in_disabled that verifies shared mailboxes cannot be used for direct sign-in. Shared mailboxes should only be accessed through delegation to maintain accountability and reduce attack surface.

Changes:

  • Add get_shared_mailboxes() method to M365PowerShell class to retrieve shared mailboxes via PowerShell
  • Add SharedMailbox model to exchange_service.py
  • Add _get_shared_mailboxes() method to Exchange service
  • Implement the check that cross-references shared mailboxes with Entra ID user accounts to verify AccountEnabled is False

Steps to review

  1. Review the PowerShell command in get_shared_mailboxes() method
  2. Review the SharedMailbox model and service implementation
  3. Review the check logic that cross-references Exchange mailboxes with Entra ID accounts
  4. Verify metadata JSON follows Prowler standards

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? Yes
    • If so, do we need to update permissions for the provider? No - Uses existing Get-EXOMailbox and Entra ID permissions

License

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

Add new check to verify that shared mailboxes have sign-in blocked
in Entra ID. Shared mailboxes should only be accessed through delegation
to maintain accountability and reduce attack surface.

Based on CIS Microsoft 365 Foundations Benchmark v5.0.0 - Requirement 1.2.2

Changes:
- Add get_shared_mailboxes() to M365PowerShell class
- Add SharedMailbox model to exchange_service.py
- Add _get_shared_mailboxes() method to Exchange service
- Implement exchange_shared_mailbox_sign_in_disabled check
@andoniaf andoniaf requested review from a team as code owners January 19, 2026 15:32
@github-actions github-actions bot added provider/m365 Issues/PRs related with the M365 provider metadata-review labels Jan 19, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

Conflict Markers Resolved

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

✅ All necessary CHANGELOG.md files have been updated.

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.69%. Comparing base (cb367da) to head (a6946f3).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9828      +/-   ##
==========================================
- Coverage   92.07%   88.69%   -3.39%     
==========================================
  Files         181       94      -87     
  Lines       25074     3564   -21510     
==========================================
- Hits        23087     3161   -19926     
+ Misses       1987      403    -1584     
Flag Coverage Δ
api ?
prowler-py3.10-m365 88.52% <81.81%> (?)
prowler-py3.11-m365 88.52% <81.81%> (?)
prowler-py3.12-m365 88.69% <81.81%> (?)
prowler-py3.9-m365 88.52% <81.81%> (?)

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

Components Coverage Δ
prowler 88.69% <81.81%> (∅)
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 19, 2026

🔒 Container Security Scan

Image: prowler:d7550fe
Last scan: 2026-01-23 12:26:38 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:

- Fix security issue: handle None case when Entra user not found
- Update CLI remediation to use modern Update-MgUser cmdlet
- Add comprehensive tests for the check (PASS, FAIL, empty, None)
- Add service test for _get_shared_mailboxes()
- Add additional documentation URL for CIS benchmark
Copy link
Member

@HugoPBrito HugoPBrito left a comment

Choose a reason for hiding this comment

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

Please, also update the changelog since 5.17 was released.

- Update remediation steps to use Entra admin center path
- Remove CIS reference from metadata Notes field
- Add check to CIS 4.0 and 6.0 M365 compliance frameworks (req 1.2.2)
- Move changelog entry to unreleased v5.18.0 section
@andoniaf andoniaf requested review from a team as code owners January 23, 2026 12:14
@github-actions github-actions bot added documentation provider/aws Issues/PRs related with the AWS provider provider/azure Issues/PRs related with the Azure provider provider/gcp Issues/PRs related with the Google Cloud Platform provider github_actions Pull requests that update GitHub Actions code compliance Issues/PRs related with the Compliance Frameworks component/ui component/api component/mcp-server labels Jan 23, 2026
@andoniaf andoniaf force-pushed the feat/exchange_shared_mailbox_sign_in_disabled branch from cb9d7e0 to a6946f3 Compare January 23, 2026 12:17
@github-actions github-actions bot removed documentation provider/aws Issues/PRs related with the AWS provider provider/azure Issues/PRs related with the Azure provider labels Jan 23, 2026
@github-actions github-actions bot removed provider/gcp Issues/PRs related with the Google Cloud Platform provider github_actions Pull requests that update GitHub Actions code component/ui component/api component/mcp-server labels Jan 23, 2026
@andoniaf andoniaf requested a review from HugoPBrito January 23, 2026 13:19
@HugoPBrito HugoPBrito removed request for a team January 23, 2026 13:55
@HugoPBrito HugoPBrito merged commit 7f4c02c into master Jan 26, 2026
34 of 36 checks passed
@HugoPBrito HugoPBrito deleted the feat/exchange_shared_mailbox_sign_in_disabled branch January 26, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compliance Issues/PRs related with the Compliance Frameworks metadata-review provider/m365 Issues/PRs related with the M365 provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants