Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS.EXO.02.2: False negative on example.mail.onmicrosoft.com #686

Open
moorereason opened this issue Feb 21, 2025 · 2 comments · May be fixed by #690
Open

MS.EXO.02.2: False negative on example.mail.onmicrosoft.com #686

moorereason opened this issue Feb 21, 2025 · 2 comments · May be fixed by #690

Comments

@moorereason
Copy link

Given

  • maester version 00fd5db (essentially v1.0.22-preview)
  • A domain of example.mail.onmicrosoft.com
  • SFP record of: v=spf1 include:outlook.com -all

Result

Test-MtCisaSpfDirective (MS.EXE.02.2) returns a failure result with:

  • Reason: No EXO directive
  • Directives: include:outlook.com

Problem

This is a false negative. Microsoft has correctly published an SPF record to restrict authorized senders of that domain.

See:

}elseif(($directives|Measure-Object).Count -ge 1 -and -not $check){
$spfRecord.reason = "No EXO directive"

The logic appears to require a include:spf.protection.outlook.com directive, which Microsoft does not use for this domain. AFAIK, I have no control over that SFP record.

Proposed Solution

        }elseif(($directives|Measure-Object).Count -ge 1 -and -not $domain.EndsWith(".mail.onmicrosoft.com") -and -not $check){

I'm happy to submit a PR.

It might also be helpful to update the documentation for this check to explain that the include:spf.protection.outlook.com directive is required for all domains (except for the .mail.onmicrosoft.com domains).

@soulemike
Copy link
Contributor

I hadn't dug deep enough to notice this nuance before. After some review this appears to only impact the placeholder used for remote routing by the hybrid configuration wizard. I assume this is due to bypassing EOP, but unsure why.

I would recommend amending the proposed solution to show mail.onmicrosoft.com domains as skipped. So they still show, but just are ignored.

It is a good call out on the documentation as well. A note could be added to the effect that "Additional controls restricting use of the HCW domain should be used. Such as transport rules. While production use of this domain should be as limited as possible.".

I did double check and this is only for the HCW domain, MOERA does still use EOP.

@moorereason
Copy link
Author

I'm working on a PR for this.

@moorereason moorereason linked a pull request Feb 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants