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

Understand SPF as it relates to DMARC Reports #4228

Closed
1 task
nickumia-reisys opened this issue Mar 7, 2023 · 2 comments
Closed
1 task

Understand SPF as it relates to DMARC Reports #4228

nickumia-reisys opened this issue Mar 7, 2023 · 2 comments
Assignees
Labels
component/ssb Explore O&M Operations and maintenance tasks for the Data.gov platform

Comments

@nickumia-reisys
Copy link
Contributor

nickumia-reisys commented Mar 7, 2023

Purpose

We want to know we are setting up DMARC (DKIM+SPF) properly for our ses instances, but we're not sure how to interpret the DMARC reports from google.

Given above question, conducting research/investigation is needed to provide factual knowledge on future steps.

1d of effort has been allocated and once compete, findings will be demonstrated and specific future actions will be decided.

Acceptance Criteria

  • GIVEN [a contextual precondition]
    [AND optionally another precondition]
    WHEN [time box] expires
    THEN [findings demonstrated]
    AND [future action is decided]
    AND [stories covering future action are created if needed]

Background

DMARC Reports from Google.

<record>
  <row>
    <source_ip>x.x.x.x</source_ip>
    <count>49</count>
    <policy_evaluated>
    <disposition>none</disposition>
    <dkim>pass</dkim>
    <spf>fail</spf>
    </policy_evaluated>
  </row>
  <identifiers>
    <header_from>ses-513xxx.ssb.data.gov</header_from>
  </identifiers>
  <auth_results>
    <dkim>
      <domain>ses-513xxx.ssb.data.gov</domain>
      <result>pass</result>
      <selector>xxx</selector>
    </dkim>
    <dkim>
      <domain>amazonses.com</domain>
      <result>pass</result>
      <selector>xxx</selector>
    </dkim>
    <spf>
      <domain>us-west-2.amazonses.com</domain>
      <result>pass</result>
    </spf>
  </auth_results>
</record>

Sketch

List of references to start with:

@nickumia-reisys nickumia-reisys added the O&M Operations and maintenance tasks for the Data.gov platform label Mar 7, 2023
@nickumia-reisys nickumia-reisys mentioned this issue Mar 8, 2023
8 tasks
@nickumia-reisys
Copy link
Contributor Author

SPF is a feature of DMARC that prevents against unauthorized servers from sending emails from a domain. There are two modes for SPF: (1) relaxed and (2) strict. Strict SPF requires that all servers must be from the exact domain to which the email is configured. Relaxed SPF allows servers to be configured with either the exact domain or any one-level subdomains.

If a domain customdata.org is used as the email domain,

  • Strict SPF required that all email servers be routed from only customdata.org
  • Relaxed SPF allows the email servers to reside at any *.customdata.org domain.

For our use case, we have DMARC set up for all of our email domains (i.e. ses-xxx.ssb.data.gov). However, the emails are "mailed by" or "mailed from" us-west-2.amazonses.com. Since us-west-2.amazonses.com != ses-xxx.ssb.data.gov, SPF fails both strict and relaxed SPF.

image

According to AWS Support,

To resolve this, you must set up a custom MAIL FROM domain so that the Mail From value is a subdomain of your verified domain. For example, if your verified domain (the From domain) is example.com, then you can set up the custom Mail From domain to be mail.example.com.

Ironically enough, we got a friendly contribution from a sibling team in TTS that allows us to configure MAIL FROM,

From this investigation, it would seem that setting the MAIL FROM domain would solve the SPF failure. I will test and try to figure out if it is safe to upgrade our ssb-smtp with the new feature.

@nickumia-reisys
Copy link
Contributor Author

Successfully modified the MAIL FROM domain on a test instance. And since mail.ses76xxx.ssb.data.gov is a subdomain of ses76xxx.ssb.data.gov, it will pass the relaxed SPF checks from google.

image

Implementing this work will be taken care of in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ssb Explore O&M Operations and maintenance tasks for the Data.gov platform
Projects
Archived in project
Development

No branches or pull requests

1 participant