Skip to content
Snippets Groups Projects

DNAME support

Merged Petr Špaček requested to merge dname-support into master

Closes: #234 (closed)

High-level contents of the MR (in order of request resolution):

iterator

It follows CNAMEs as usual. Here we rely on the fact that servers MUST also include the generated CNAMEs along with DNAMEs.

In the CNAME-following loop it newly needs to also discover (applicable) DNAMEs to:

  • select them (and their RRSIGs) into answ_selected, so they can be validated and included in answer; and to
  • recognize which CNAMEs are generated (mark for use in caching).

It might be surprising that CNAMEs get followed and resolved before they get validated; that's unchanged (not as "easy" to do).

validator

CNAMEs without RRSIGs may be generated from a DNAME, so the new task is to validate them that way. As CNAME may appear before its DNAME, we may fall back to two passes through the list to validate. (Validator never touched RRsets that were already ranked as secure.)

cache

Generated CNAMEs can't be saved into cache, so we use the flag set by iterator. It would be useless to save them, as they can be generated from their DNAMEs. The problem was that for efficiency reasons, the first checks are for exact-name matches with same type or CNAME type, so the generated CNAME was discovered first and used in reply without its DNAME.

New function answer_dname_hit() is added that includes generation of the CNAME.

A tweak in order of checking was needed when searching for best-match answer. On each name, zone cut existence was checked before DNAME, so that apex DNAMEs would often not be considered.

Edited by Petr Špaček

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added bug label

  • added 1 commit

    • e88f2183 - WIP: DNAME support - avoid caching occluded CNAMEs

    Compare with previous version

  • Vladimír Čunát changed the description

    changed the description

  • added 1 commit

    Compare with previous version

  • Now it should be full-featured, including complete aggressive answers, i.e. even unsigned DNAMEs will be used to expand different SNAMEs than the original QNAME sent to upstream.

  • Eh, the validation success still depends on CNAME not occurring before its DNAME, which seems not required by the RFC and 9.9.9.9 even reorders records this way (sometimes). I'll have a look at it.

    Edited by Vladimír Čunát
  • added 1 commit

    • c411f5ae - WIP: DNAME support - fix if CNAME occurs after DNAME

    Compare with previous version

  • Uh, the commit message swapped the order, but I believe it always works now (and no vulnerabilities should be introduced).

  • added 1 commit

    Compare with previous version

  • Vladimír Čunát marked the checklist item FIXME: review, perhaps some cleanup, etc. as completed

    marked the checklist item FIXME: review, perhaps some cleanup, etc. as completed

  • Vladimír Čunát unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Cleanup and self-review done. I think it's ready.

    Respdiff shows a couple instances where DNAMEs weren't getting into answers – and on this MR those differences disappeared.

  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Vladimír Čunát changed milestone to %5.1.0

    changed milestone to %5.1.0

  • High-level contents of the MR (in order of request resolution):

    iterator

    It follows CNAMEs as usual. Here we rely on the fact that servers MUST also include the generated CNAMEs along with DNAMEs.

    In the CNAME-following loop it newly needs to also discover (applicable) DNAMEs to:

    • select them (and their RRSIGs) into answ_selected, so they can be validated and included in answer; and to
    • recognize which CNAMEs are generated (mark for use in caching).

    It might be surprising that CNAMEs get followed and resolved before they get validated; that's unchanged (not as "easy" to do).

    validator

    CNAMEs without RRSIGs may be generated from a DNAME, so the new task is to validate them that way. As CNAME may appear before its DNAME, we may fall back to two passes through the list to validate. (Validator never touched RRsets that were already ranked as secure.)

    cache

    Generated CNAMEs can't be saved into cache, so we use the flag set by iterator. It would be useless to save them, as they can be generated from their DNAMEs. The problem was that for efficiency reasons, the first checks are for exact-name matches with same type or CNAME type, so the generated CNAME was discovered first and used in reply without its DNAME.

    New function answer_dname_hit() is added that includes generation of the CNAME.

    A tweak in order of checking was needed when searching for best-match answer. On each name, zone cut existence was checked before DNAME, so that apex DNAMEs would often not be considered.

  • Petr Špaček changed the description

    changed the description

  • Author Contributor

    Seemingly working Deckard test for unsigned case: iter_dname_insec.rpl

    It fails in weird situation where auth sends two DNAME RRs for the same owner in the same answer and the test expects SERVFAIL but gets both records and NOERROR. I'm a bit worried that this could cause problems down the road. What do you think?

  • So far I haven't seen motivation for strict checking that xNAMEs don't contain multiple records. We could add code for that, though.

  • Author Contributor

    My main worry is that it will cause problems down the road once this is put into cache or if some module attempts to use that. A non-deterministic issue caused by this would be nightmare to debug.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading