SPF の参照上限超過と DMARC
A 社は,example.com の SPF レコードを -all で終え,DMARC レコードを p=reject で公開している。新たに契約したメール配信サービスの include を SPF レコードの -all の直前に追加したところ,その include を評価する時点で,DNS 参照を伴う項の数が RFC 7208 の上限を超えるようになった。サービスの送信サーバの IP アドレスは,その include の参照先にだけ記載されている。サービスは,エンベロープ From とヘッダ From を example.com のアドレスにし,d=mailer.example.net の DKIM 署名を付けて送信する。このサービスから届いたメールを受信サーバが評価した結果として,適切なものはどれか。
- アSPF は temperror となり,受信サーバが一時的な障害として受信を保留すれば,送信側が再送したときに上限内で評価されて pass となる。
- イSPF は permerror となって pass にならず,DKIM の署名ドメインも example.com とアラインメントしないので,DMARC は fail となり,p=reject に従って拒否され得る。
- ウSPF は,上限を超えた include を評価せずに読み飛ばし,末尾の -all に一致して fail となり,送信元が許可されていないと判定される。
- エSPF は permerror となるが,DKIM 署名の検証が成功するので,DMARC は DKIM によって pass となり,メールは受信される。
正解と解説を見る
正解 イ
この問題の基礎知識
- SPF は,エンベロープ From のドメインの SPF レコードで送信元の IP アドレスが許可されているかを評価する。include など DNS 参照を伴う項の数には上限がある。
- SPF の評価結果のうち,fail は送信元が許可されていないことの明示的な表明,temperror は DNS の一時的な障害などで評価を完了できなかったこと,permerror は公開されたレコードを正しく解釈できないことを表す。
- DMARC は,SPF 又は DKIM が pass し,かつその識別子(SPF はエンベロープ From,DKIM は d= のドメイン)がヘッダ From のドメインとアラインメントしていることを pass の条件とする。
- DMARC レコードの p タグは,DMARC が fail となったメールの扱いを受信側に求めるもので,none,quarantine,reject がある。
temperror は,DNS の一時的な障害などで評価を完了できなかった場合の結果で,再試行で解消し得る。参照の上限超過は permerror を返すと規定されており,レコードを直さない限り,再送しても同じ結果になる。
RFC 7208 は,DNS 参照を伴う項の数が上限を超えたら permerror を返すとしている。permerror は公開されたレコードを正しく解釈できないことを示す。DMARC は,アラインメントした識別子で SPF か DKIM が pass することを求めるので,このメールは fail となる。
上限を超えた項を読み飛ばして評価を続ける規定はなく,上限を超えた時点で permerror を返す。fail は,送信元が許可されていないことの明示的な表明であり,レコードを正しく解釈できないことを示す permerror とは意味が異なる。
DMARC の pass には,pass した認証の識別子がヘッダ From のドメインとアラインメントしていることが必要である。d=mailer.example.net は example.com と組織ドメインも異なるので,署名の検証が成功しても DMARC の pass にはならない。
照合の根拠(7 件)
- イ(正解)・ウ: DNS 参照を伴う項が上限を超えたら permerror を返す。上限を超えた include を読み飛ばして評価を続ける規定はない
SPF implementations MUST limit the total number of those terms to 10 during SPF evaluation, to avoid unreasonable load on the DNS. If this limit is exceeded, the implementation MUST return "permerror".
RFC 7208 · Section 4.6.4(新しいタブで開きます) - イ(正解)・ア: permerror はレコードを直さない限り解消しないので,再送しても pass にならない
A "permerror" result means the domain's published records could not be correctly interpreted. This signals an error condition that definitely requires DNS operator intervention to be resolved.
RFC 7208 · Section 2.6.7(新しいタブで開きます) - ア: temperror は一時的な(主に DNS の)障害の結果で,上限超過の結果ではない
A "temperror" result means the SPF verifier encountered a transient (generally DNS) error while performing the check. A later retry may succeed without further DNS operator action.
RFC 7208 · Section 2.6.6(新しいタブで開きます) - ウ: fail は送信元が許可されていないことの明示的な表明であり,レコードを解釈できない permerror とは異なる
A "fail" result is an explicit statement that the client is not authorized to use the domain in the given identity.
RFC 7208 · Section 2.6.4(新しいタブで開きます) - イ(正解)・エ: DMARC の pass には,アラインメントした識別子で SPF か DKIM が pass することが必要
A message satisfies the DMARC checks if at least one of the supported authentication mechanisms: 1. produces a "pass" result, and 2. produces that result based on an identifier that is in alignment,
RFC 7489 · Section 4.2(新しいタブで開きます) - エ: d=mailer.example.net の署名の検証が成功しても,ヘッダ From の example.com とアラインメントしないので DMARC の pass にならない
Identifier Alignment is required because a message can bear a valid signature from any domain, including domains used by a mailing list or even a bad actor. Therefore, merely bearing a valid signature is not enough to infer authenticity of the Author Domain.
RFC 7489 · Section 3.1.1(新しいタブで開きます) - イ(正解): p=reject では DMARC が fail となったメールの拒否が求められる
reject: The Domain Owner wishes for Mail Receivers to reject email that fails the DMARC mechanism check.
RFC 7489 · Section 6.3(新しいタブで開きます)