Once the SPF and DKIM records are in use everywhere, deploy SPF records for all of torproject.org pointing to known mail hosts. Also enforce a domain-wide DMARC policy, at least to get reporting when we have failures.
commit 8017c10a3ed51a5511369675b50e74163452096dAuthor: Antoine Beaupré <anarcat@debian.org>AuthorDate: Tue Dec 6 14:33:57 2022 -0500 global SPF records, soft (tpo/tpa/team#40981)--- torproject.org | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-)diff --git a/torproject.org b/torproject.orgindex a8292b2..c1bc5c7 100644[ 0001-01-01-global-SPF-records-soft-tpo-tpa-team-40981.patch: inline patch (as text/x-diff) ]--- a/torproject.org+++ b/torproject.org@@ -51,6 +51,23 @@ ns5 24h IN A 89.45.235.22 ; per <PMZ2MDQ3YD_5a66b41a688eb_1d0673fe91b0cb98c51870_sprut@zendesk.com> ; Subject: [Fastly] Update: [Action Required] l.ssl- Re-vetting domains on Fastly shared certs+; mail records+;+; those servers write mail from @torproject.org+;+; TODO: consider adding include:riseup.net include:google.com+@ IN TXT "v=spf1 a:crm-int-01.torproject.org a:eugeni.torproject.org a:submit-01.torproject.org mx ~all"++; TODO: also considering having a generic _spf record that gets included in+; a few places, and that lists all possible servers instead...+;+; warning: this gets close to the 255 character limit+;+; for now i feel we can just pinpoint the servers sending as+; @torproject.org and have per-service overrides as well+;_spf IN TXT "v=spf1 a:eugeni.torproject.org a:crm-int-01.torproject.org a:submit-01.torproject.org a:gitlab-02.torproject.org a:alberti.torproject.org a:rdsys-01.torproject.org a:rude.torproject.org ~all"++; TODO: DMARC keys and DKIM records belong here ; services ; ========@@ -79,6 +96,7 @@ collector IN CNAME colchicifolium collector2 IN CNAME corsicum ; DKIM for CiviCRM, tpo/tpa/team#40986+; TODO: move up with SPF records crm-2022._domainkey IN TXT ( "v=DKIM1; h=sha256; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtSNGCjHmZnGrnBb9nCsPUc6MjZd5QueGKV+iXwcRNfU0LapFZMi5t7WE/kTPJsRWIF8AMHymNqLA5835m5LwaBBXZdu1utNARKSXDzGsEjxuDiAnSqD0Rb1px1JA+Eex0RC3thYZuyIIAxK31pXxJt2mowXtrhIkuKFB2YpE0yUudKuDZIZZ3YNH025czK/jFLD6TH+5xD9Cej" "H0MB6tE4O41rCjZUjSZ7Ar7BjVID6foCmlbr/3EG7dbzQv6YqH19OX6YgL0UMfG2RhvhWEUNYghS6K88vTelnHx/ShUzIeu05jd6mi9OLCA/Hl2bFRsa0f1ttHKpnzuC+ecn0sWwIDAQAB" ) ; ----- DKIM key 2022 for crm.torproject.org@@ -91,10 +109,10 @@ crm-2022._domainkey.crm IN TXT ( "v=DKIM1; h=sha256; k=rsa; " "H0MB6tE4O41rCjZUjSZ7Ar7BjVID6foCmlbr/3EG7dbzQv6YqH19OX6YgL0UMfG2RhvhWEUNYghS6K88vTelnHx/ShUzIeu05jd6mi9OLCA/Hl2bFRsa0f1ttHKpnzuC+ecn0sWwIDAQAB" ) ; ----- DKIM key 2022 for crm.torproject.org crm IN A 116.202.120.186 ; crm-int-01 IN AAAA 2a01:4f8:fff0:4f:266:37ff:fe4d:f883- IN TXT "v=spf1 a mx -all"+ IN TXT "v=spf1 a mx -all" ; TODO: redundant with @ record? IN MX 0 crm _dmarc.crm IN TXT "v=DMARC1;p=none;pct=100;rua=mailto:postmaster@torproject.org"-crm-int-01 IN TXT "v=spf1 a mx -all"+crm-int-01 IN TXT "v=spf1 a mx -all" ; TODO: redundant with @ record? IN MX 0 crm _dmarc.crm-int-01 IN TXT "v=DMARC1;p=none;pct=100;rua=mailto:postmaster@torproject.org" staging.crm IN CNAME crm-int-01@@ -114,6 +132,8 @@ test-api.donate IN CNAME crm-ext-01 exonerator IN CNAME materculae gitlab IN CNAME gitlab-02 gitlab-dev IN CNAME gitlab-dev-01+; TODO: does SPF follow CNAMEs? ie. mail goes out From: gitlab@gitlab.tpo, will the following TXT record work?+gitlab-02 IN TXT "v=spf1 a ~all" ; no one else than gitlab can send for gitlab gettor IN CNAME static git IN CNAME vineale git-rw IN CNAME cupani@@ -123,7 +143,7 @@ kgb-bot IN CNAME chives lists IN A 49.12.57.136 ; eugeni IN AAAA 2a01:4f8:fff0:4f:266:37ff:fe48:41b8 ; eugeni IN MX 10 eugeni- IN TXT "v=spf1 mx ~all"+ IN TXT "v=spf1 mx ~all" ; TODO: redundant with @ record? media IN CNAME media-01 metrics-store IN CNAME metrics-store-01 metrics-db IN CNAME metrics-psqlts-01
the only feedback i received was from @micah and it was basically:
a: mechanism should work as expected, as it's in use at Riseup
mx might not be necessary in the root level
CNAMEs might work, but it remains to be tested
subdomains need to be tested explicitly as well
So I'm going to go ahead and deploy those with "soft" mechanisms so that we can use online tools to test them.
i tested mailing from anarcat@torproject.org from eugeni, submit-01, and crm-int-01, all worked. i also tested anarcat@crm.torproject.org using the the vamsoft tool, and that also works.
it certainly looks like our SPF policy is going to need some work. it might also be that there are some reports that date from the transition period during which we were deploying the records so that some records were missing when some mail finally got through. maybe better to investigate again in a day or two after the dust settles.
i'm certainly not going to enable hard records at this point and will wait for next week for the next move.
IP Count From RFrom RDKIM RSPF eugeni.torproject.org. 8 gitlab.torproject.org gitlab.torproject.org softfail eugeni.torproject.org. 7 gitlab.torproject.org gitlab.torproject.org softfail
... is because gitlab.torproject.org actually delivers mail to eugeni.torproject.org when the target is a @torproject.org, of course! from there, we get a failure because gitlab.tpo doesn't have eugeni in its allow list.
so i actually needed to add the MX on all of those hosts as well...
i'm not sure what those first two are. The third and fifth ones seems to be a bad signature for mail relayed from gitlab through eugeni.. Maybe that was fixed recently by @lavamind? Not sure what the rt.torproject.org one is.
And of course there's all this mail that'S sent from outside our infrastructure... and there is a lot of those:
It's mostly google, of course, but there's also a good chunk from riseup, and also a long tail of random providers... all of those would be dropped to the ground whenever we setup "hard" records... so I'm not sure we're ready to do that switch just yet.
marked the checklist item DKIM records everywhere (#40989 (closed)) as completed
anarcatchanged title from Deploy SPF (hard), DKIM, and DMARC records for all of torproject.org to Deploy SPF, DKIM, and DMARC records for all of torproject.org
changed title from Deploy SPF (hard), DKIM, and DMARC records for all of torproject.org to Deploy SPF, DKIM, and DMARC records for all of torproject.org
i'm going to call this one done. i don't think we're in a place where we can enable hard records right now and we have significantly improved our reputation, as far as CivicRM mailings are concerned.
so let's push the "hard" records here to a later phase.