Skip to content

refactor(m365): normalize CA platforms at model level#10635

Merged
danibarranqueroo merged 14 commits into
masterfrom
refactor/entra-normalize-platforms-from-10615
Apr 14, 2026
Merged

refactor(m365): normalize CA platforms at model level#10635
danibarranqueroo merged 14 commits into
masterfrom
refactor/entra-normalize-platforms-from-10615

Conversation

@HugoPBrito
Copy link
Copy Markdown
Member

@HugoPBrito HugoPBrito commented Apr 9, 2026

Context

Supersedes #10614 and now follows #10615.

Both Conditional Access checks that inspect device platforms duplicated platform normalization logic. This PR moves that normalization to the Entra model layer so checks can consume normalized platform values directly.

Description

Steps to review

  1. Review prowler/providers/m365/services/entra/entra_service.py
  2. Review the two platform-based checks under prowler/providers/m365/services/entra/
  3. Run:
    poetry run pytest tests/providers/m365/services/entra/entra_conditional_access_policy_block_unknown_device_platforms/entra_conditional_access_policy_block_unknown_device_platforms_test.py tests/providers/m365/services/entra/entra_conditional_access_policy_approved_client_app_required_for_mobile/entra_conditional_access_policy_approved_client_app_required_for_mobile_test.py -q

Checklist

  • Are there new checks included in this PR? No
  • Review if the code is being covered by tests.
  • Review if backport is needed.
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

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

Hugo P.Brito and others added 4 commits April 8, 2026 15:53
…platforms security check

Add new security check entra_conditional_access_policy_block_unknown_device_platforms for m365 provider.
Includes check implementation, metadata, and unit tests.
- Require all users and all cloud apps for compliance
- Ignore policies scoped to user actions
- Add regression coverage for scoped policies
- Remove the global tenant scope requirement from the check
- Document Microsoft broad-scope guidance in metadata
- Keep report-only policies non-compliant with Maester semantics
- Normalize Conditional Access platform values in PlatformConditions
- Remove duplicated platform normalization from Entra checks
- Simplify platform-based comparisons in device platform checks
@HugoPBrito HugoPBrito requested a review from a team April 9, 2026 13:47
@HugoPBrito HugoPBrito requested a review from a team as a code owner April 9, 2026 13:47
Base automatically changed from feat/prowler-836 to master April 14, 2026 12:32
@github-actions github-actions Bot added compliance Issues/PRs related with the Compliance Frameworks provider/m365 Issues/PRs related with the M365 provider metadata-review labels Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Conflict Markers Resolved

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

@github-actions github-actions Bot removed the compliance Issues/PRs related with the Compliance Frameworks label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

✅ All necessary CHANGELOG.md files have been updated.

Comment thread prowler/providers/m365/services/entra/entra_service.py Fixed
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.97%. Comparing base (bc3fd79) to head (b2fbb7d).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10635      +/-   ##
==========================================
- Coverage   88.07%   87.97%   -0.11%     
==========================================
  Files         125      131       +6     
  Lines        5251     5537     +286     
==========================================
+ Hits         4625     4871     +246     
- Misses        626      666      +40     
Flag Coverage Δ
prowler-py3.10-m365 87.97% <100.00%> (-0.11%) ⬇️
prowler-py3.11-m365 87.44% <100.00%> (-0.64%) ⬇️
prowler-py3.12-m365 87.97% <100.00%> (-0.11%) ⬇️

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

Components Coverage Δ
prowler 87.97% <86.44%> (-0.11%) ⬇️
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.

@HugoPBrito HugoPBrito force-pushed the refactor/entra-normalize-platforms-from-10615 branch from 6505deb to 6c594fd Compare April 14, 2026 12:52
@danibarranqueroo danibarranqueroo merged commit a82eaa8 into master Apr 14, 2026
35 of 36 checks passed
@danibarranqueroo danibarranqueroo deleted the refactor/entra-normalize-platforms-from-10615 branch April 14, 2026 13:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

🔒 Container Security Scan

Image: prowler:cbee51c
Last scan: 2026-04-14 13:06:42 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 4
Total 4

4 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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider/m365 Issues/PRs related with the M365 provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants