Add specifications for testing SPF and DMARC policies#1100
Add specifications for testing SPF and DMARC policies#1100marc-vanderwal wants to merge 3 commits into
Conversation
|
Sure, I will. I was also unsure about where to add these new test cases. I’ve added them in |
I think |
|
Okay, sticking with |
f54d2d2 to
803d183
Compare
803d183 to
dc17b5a
Compare
dc17b5a to
24280a0
Compare
|
I’ve addressed some of your remarks in this iteration, but I haven’t updated the other test cases or acted on the remaining remarks yet. Also, step 14 is probably wrong because the real limits are described in RFC 7208 § 4.6.4 and it’s slightly more complicated than I thought. I’ll rephrase that step later. |
591a2dd to
4f856a9
Compare
|
Overhauled Zone11. Rewrites of Zone12 and Zone13 will come later. |
matsduf
left a comment
There was a problem hiding this comment.
I have only reviewed Zone11.
4f856a9 to
3c73abd
Compare
3c73abd to
c6a80f9
Compare
c6a80f9 to
57b12fe
Compare
|
Validation of an SPF policy according to the RFC is quite complex! |
|
Yes, validating an SPF policy is indeed a chore (and a tool like Zonemaster cannot necessarily check everything). But I’m doing some research on the use of SPF in the |
5ac1a60 to
6e5ca27
Compare
6e5ca27 to
4ffed69
Compare
|
I think I can simplify this test case quite a bit. People very rarely make mistakes in the SPF version number. Less than 0,1% of domains in the |
0e0c8fb to
e0b1c00
Compare
If I understand it correctly, Zone11 will consider such TXT records as non-SPF records. It is hard to say how much errors to look for. There is always a limit. |
|
This PR is a draft. Are Zone12 and Zone13 ready for review? |
That’s right, Zone11 will output Z11_NO_SPF_FOUND. However it is interesting, I think, to look for TXT records that do contain
I haven’t quantified this phenomenon yet but maybe it’s something to do in a separate test case.
I’ve rewritten Zone12 and Zone13 as well based on your review of Zone11, so yes, they are. I even think that this specification is stable/mature enough for me to mark this PR as ready for review. |
Add a test case for SPF records in the domain under test. The test case ascertains whether any SPF records exist for the zone, and if so, whether they are valid. In short, this test case will: * check for either zero or one TXT record containing an SPF version 1 policy; * check the SPF policy for valid syntax; * ensure that evaluating the policy will never require more than 10 DNS lookups.
Add a test case specification for a test checking that the deprecated SPF resource record type isn’t used on the domain being tested. The rationale for the test is detailed more clearly in the “Objective” section.
Add a specification for a test case validating a DMARC policy, if one exists. The idea is similar to that of the test case for SPF: * first, attempt to find a DMARC policy for either the domain under test or its organizational domain (which is more or less the second-level domain except in some cases such as `co.uk`). * then, if a DMARC policy is found, check its syntax. The test case also checks if the e-mail addresses used for reporting failures or aggregate data are in the same domain as the policy. If not, Zonemaster shall use the procedure documented in RFC 7489 to verify that the subdomain for the report e-mail addresses permits the domain under test to send its reports there.
e0b1c00 to
30d85e3
Compare
I think it fits into this test case instead of a separate one. The cases are maybe rare, but Zonemaster should also look for rare cases such as responding to queries for SOA but not MX. At least I think it should be simple to create test zones with the odd data in a TXT record. I think that looking for a TXT record that contains
OK, I will dig into Zone12 and Zone13 then. |
|
After discussion, I’m going to close this PR in order to split it up into smaller ones. I also finished conducting some preliminary research on the use of SPF, DKIM and DMARC on the Based on that research, I’m therefore going to create new specifications that just focus on checking for SPF, DKIM and DMARC on the zone under test and maybe just conduct a basic syntax check on SPF and DMARC policies (I’ve actually used Mail::SPF and Mail::DMARC to do just that during my research, so that’s going to be an easy thing to implement), raising warnings if there’s an obvious error. All of these will go in separate PRs. |
Take the draft specification in the state it was in for pull request \zonemaster#1100 before that PR was closed.
Purpose
This PR introduces three test cases for testing SPF and DMARC policies for the domain under test.
Context
Fixes #995.
Changes
Added three test cases:
How to test this PR
This is a documentation update. However #1099 should be merged first.