]> git.ipfire.org Git - thirdparty/pdns.git/log
thirdparty/pdns.git
4 years agoPartial backport of #10111: Handle policy (if needed) after postresolve 10227/head
Otto [Fri, 26 Mar 2021 09:59:15 +0000 (10:59 +0100)] 
Partial backport of #10111: Handle policy (if needed) after postresolve

I did not take the Lua changes, as there is a (slight) chance they are disruptive.

4 years agoMerge pull request #10199 from omoerbeek/backport-9812-to-rec-4.4.x
Otto Moerbeek [Tue, 23 Mar 2021 14:09:23 +0000 (15:09 +0100)] 
Merge pull request #10199 from omoerbeek/backport-9812-to-rec-4.4.x

rec: Backport 9812 to 4.4.x: Handle failure to start the web server more gracefully

4 years agoMerge pull request #10198 from omoerbeek/backport-9749-to-rec-4.4.x
Otto Moerbeek [Fri, 19 Mar 2021 14:48:01 +0000 (15:48 +0100)] 
Merge pull request #10198 from omoerbeek/backport-9749-to-rec-4.4.x

rec: backport 9749 to 4.4.x: Fix the DNSName move assignement operator

4 years agoMerge pull request #10197 from omoerbeek/backport-9970-to-rec-4.4.x
Otto Moerbeek [Fri, 19 Mar 2021 14:47:46 +0000 (15:47 +0100)] 
Merge pull request #10197 from omoerbeek/backport-9970-to-rec-4.4.x

rec: Backport 9970 to 4.4.x: test that we correctly cap the answer's TTL in expanded wildcard cases

4 years agorec: Handle failure to start the web server more gracefully 10199/head
Remi Gacogne [Thu, 3 Dec 2020 08:34:08 +0000 (09:34 +0100)] 
rec: Handle failure to start the web server more gracefully

At this point we already have several threads so calling exit()
will cause problem by trying to destruct objects that are in use
by other threads, so call _exit() instead.
Also mention the web server in the error message so that the root
cause is easier to identify.

(cherry picked from commit ce715f38fcedf752220cd5056e1a3945330041fd)

4 years agoFix the DNSName move assignement operator 10198/head
Remi Gacogne [Thu, 19 Nov 2020 09:53:06 +0000 (10:53 +0100)] 
Fix the DNSName move assignement operator

A misplaced 'const' prevented it from being called, making every
move of a DNSName into a full copy.
Introduced in d720eb8add5ebda11867e8b404125e0b68ed2911.

(cherry picked from commit 8d1bb300460d5cc97b4599ea8eddeb7b6d35decf)

4 years agorec: Test that we correctly cap the answer's TTL in expanded wildcard cases 10197/head
Remi Gacogne [Wed, 13 Jan 2021 14:24:37 +0000 (15:24 +0100)] 
rec: Test that we correctly cap the answer's TTL in expanded wildcard cases

(cherry picked from commit 84b05fc29e3cab7cd41d0a2309b1f969b7b6d0b7)

4 years agorec: Account for the NSEC(3) denial TTL in expanded wildcard answers
Remi Gacogne [Wed, 13 Jan 2021 11:10:03 +0000 (12:10 +0100)] 
rec: Account for the NSEC(3) denial TTL in expanded wildcard answers

(cherry picked from commit 222ce6bfee7718df70dcaa3e22bb42a3ddf66ad1)

4 years agoMerge pull request #10194 from omoerbeek/backport-9793-to-rec-4.4.x
Otto Moerbeek [Fri, 19 Mar 2021 12:56:19 +0000 (13:56 +0100)] 
Merge pull request #10194 from omoerbeek/backport-9793-to-rec-4.4.x

rec: Backport 9793 to 4.4.x: Fix the gathering of denial proof for wildcard-expanded answers

4 years agoMerge pull request #10192 from omoerbeek/rec-backport-10185-to-4.4.x
Otto Moerbeek [Fri, 19 Mar 2021 09:21:12 +0000 (10:21 +0100)] 
Merge pull request #10192 from omoerbeek/rec-backport-10185-to-4.4.x

rec: Backport 10185 to 4.4.x: make sure we take the right minimum for the PC TTL data in the SERVFAIL case.

4 years agorec: Fix the gathering of denial proof for wildcard-expanded answers 10194/head
Remi Gacogne [Tue, 1 Dec 2020 16:20:22 +0000 (17:20 +0100)] 
rec: Fix the gathering of denial proof for wildcard-expanded answers

If somehow the RRSIG indicating that the answer is expanded from a
wildcard (label count smaller than the number of labels in the name)
went _after_ the NSEC we need, we forgot to gather that NSEC.
It might have been an issue for downstream validation (we do gather
them a second time later for our own validation) since the client
would not have received them.

(cherry picked from commit 0626e855ad5f944f8b357d729dc42e001f57820a)

4 years agoBackport #10185: make sure we take the right minimum for the PC TTL data in the SERVF... 10192/head
Otto [Fri, 19 Mar 2021 07:57:37 +0000 (08:57 +0100)] 
Backport #10185: make sure we take the right minimum for the PC TTL data in the SERVFAIL case.

4 years agoMerge pull request #10062 from Habbie/rec-4.4.x-el8-fstrm
Peter van Dijk [Fri, 5 Feb 2021 13:52:18 +0000 (14:52 +0100)] 
Merge pull request #10062 from Habbie/rec-4.4.x-el8-fstrm

rec-4.4.x el8: pull in libfstrm

4 years agorec-4.4.x el8: pull in libfstrm 10062/head
Peter van Dijk [Fri, 5 Feb 2021 11:25:56 +0000 (12:25 +0100)] 
rec-4.4.x el8: pull in libfstrm

4 years agoMerge pull request #9830 from omoerbeek/rec-4-4.x-drop-el6
Pieter Lexis [Thu, 4 Feb 2021 13:08:24 +0000 (14:08 +0100)] 
Merge pull request #9830 from omoerbeek/rec-4-4.x-drop-el6

Rec: Backport 8617 to 4.4.x: drop el6 build

4 years agoMerge pull request #9852 from pieterlexis/rec-4.4-docker
Otto Moerbeek [Mon, 4 Jan 2021 09:46:49 +0000 (10:46 +0100)] 
Merge pull request #9852 from pieterlexis/rec-4.4-docker

Port the dockerfiles from master to rec-4.4

4 years agoPort the dockerfiles from master to rec-4.4 9852/head
Pieter Lexis [Fri, 11 Dec 2020 10:28:53 +0000 (11:28 +0100)] 
Port the dockerfiles from master to rec-4.4

4 years agoMerge pull request #9837 from omoerbeek/backport-9832-to-rec-4.4.x rec-4.4.2
Otto Moerbeek [Wed, 9 Dec 2020 12:08:22 +0000 (13:08 +0100)] 
Merge pull request #9837 from omoerbeek/backport-9832-to-rec-4.4.x

rec: Backport 9832 to rec 4.4.x: UUID: Use the non-cryptographic variant of the boost::uuid

4 years agoMerge pull request #9838 from omoerbeek/backport-9817-to-rec-4.4.x
Otto Moerbeek [Wed, 9 Dec 2020 12:08:06 +0000 (13:08 +0100)] 
Merge pull request #9838 from omoerbeek/backport-9817-to-rec-4.4.x

rec: Backport 9817 to rec 4.4.x: Keep a cached, valid entry over a fresher Bogus one

4 years agoLWResult::Result does not exist in 4.4.x 9838/head
Otto Moerbeek [Wed, 9 Dec 2020 10:22:24 +0000 (11:22 +0100)] 
LWResult::Result does not exist in 4.4.x

4 years agorec: Fix a comment, as suggested by Otto
Remi Gacogne [Fri, 4 Dec 2020 16:17:24 +0000 (17:17 +0100)] 
rec: Fix a comment, as suggested by Otto

(cherry picked from commit 911d4fa6ff8dd2afd86f10e53cf025ed7b1dd250)

4 years agorec: Fix unit test formatting
Remi Gacogne [Fri, 4 Dec 2020 16:16:34 +0000 (17:16 +0100)] 
rec: Fix unit test formatting

(cherry picked from commit 5cf5062e9bb8c320eba1d4e51f5b0ba9afad0270)

4 years agorec: Keep a cached, valid entry over a fresher Bogus one
Remi Gacogne [Thu, 3 Dec 2020 14:21:48 +0000 (15:21 +0100)] 
rec: Keep a cached, valid entry over a fresher Bogus one

It turns out to be quite difficult to make us accept a record that
we already have in cache, thanks to sanitization, but let's make
sure that we will not replace a valid entry with a Bogus one if that
happens.
It might happen for SOA records, and for DS records when the TTL of
the corresponding NS records is shorter than the TTL of the DS.

(cherry picked from commit feca7c190f690e0caa424a2810a4d43b55501dfb)

4 years agoAdd a speedtest for uuid generation 9837/head
Otto Moerbeek [Wed, 9 Dec 2020 07:37:38 +0000 (08:37 +0100)] 
Add a speedtest for uuid generation

(cherry picked from commit eee6c2d5ab5c322f3e7501e531a0325b586beb3b)

4 years agoUUID: Use the non-cryptographic variant of the boost::uuid
Remi Gacogne [Tue, 8 Dec 2020 15:54:14 +0000 (16:54 +0100)] 
UUID: Use the non-cryptographic variant of the boost::uuid

Since Boost 1.67.0 the default UUID generator is cryptographically
strong, which is neat but quite slower. Since we don't need that,
just use the fastest version.

(cherry picked from commit 0acc8b31804a2ed3bb7309d5fb22576411fcd244)

4 years agoMerge pull request #9833 from Habbie/backport-9831-to-rec-4.4.x
Peter van Dijk [Tue, 8 Dec 2020 21:13:49 +0000 (22:13 +0100)] 
Merge pull request #9833 from Habbie/backport-9831-to-rec-4.4.x

rec-4.4.x: el8: PowerTools is now powertools

4 years agoel8: PowerTools is now powertools 9833/head
Your Name [Tue, 8 Dec 2020 14:23:13 +0000 (15:23 +0100)] 
el8: PowerTools is now powertools

(cherry picked from commit 26fe12046566da83844f1163134ba722a603e911)

4 years agopkgs: drop EL6 9830/head
Pieter Lexis [Tue, 10 Dec 2019 10:45:43 +0000 (11:45 +0100)] 
pkgs: drop EL6

4 years agorec: drop EL6 pkg support
Pieter Lexis [Tue, 10 Dec 2019 10:40:31 +0000 (11:40 +0100)] 
rec: drop EL6 pkg support

4 years agoMerge pull request #9799 from Habbie/backport-9574-to-rec-4.4.x
Otto Moerbeek [Tue, 8 Dec 2020 07:06:38 +0000 (08:06 +0100)] 
Merge pull request #9799 from Habbie/backport-9574-to-rec-4.4.x

rec-4.4.x: Ensure socket-dir matches runtimedir on old systemd

4 years agoMerge pull request #9825 from omoerbeek/backport-9807-to-rec-4.4.x
Otto Moerbeek [Mon, 7 Dec 2020 14:04:45 +0000 (15:04 +0100)] 
Merge pull request #9825 from omoerbeek/backport-9807-to-rec-4.4.x

rec: Backport 9807 to rec 4.4.x: Untangle the validation/resolving qnames and qtypes

4 years agorec: Untangle the validation/resolving qnames and qtypes 9825/head
Remi Gacogne [Wed, 2 Dec 2020 13:46:19 +0000 (14:46 +0100)] 
rec: Untangle the validation/resolving qnames and qtypes

(cherry picked from commit 6d1218188747bdeb9f8fddc52a0499a8d9490ff4)

4 years agoMerge pull request #9821 from rgacogne/rec44-more-bogus-states
Remi Gacogne [Mon, 7 Dec 2020 13:57:04 +0000 (14:57 +0100)] 
Merge pull request #9821 from rgacogne/rec44-more-bogus-states

rec-4.4.x: Move to several distinct Bogus states, for easier debugging

4 years agorec: Preserve compatibility with Lua scripts using the 'Bogus' state 9821/head
Remi Gacogne [Mon, 7 Dec 2020 12:32:17 +0000 (13:32 +0100)] 
rec: Preserve compatibility with Lua scripts using the 'Bogus' state

4 years agoMerge pull request #9805 from omoerbeek/backport-9790-to-rec-4.4.x
Otto Moerbeek [Mon, 7 Dec 2020 12:28:03 +0000 (13:28 +0100)] 
Merge pull request #9805 from omoerbeek/backport-9790-to-rec-4.4.x

rec: backport 9790 to rec-4.4.x: Do not chase CNAME during qname minization step 4

4 years agorec: Export a 'Bogus' metric as the sum of all other Bogus metrics
Remi Gacogne [Mon, 7 Dec 2020 09:22:36 +0000 (10:22 +0100)] 
rec: Export a 'Bogus' metric as the sum of all other Bogus metrics

4 years agorec: Add more Bogus states to better match rfc8914 extended codes
Remi Gacogne [Thu, 29 Oct 2020 15:00:14 +0000 (16:00 +0100)] 
rec: Add more Bogus states to better match rfc8914 extended codes

(cherry picked from commit fecac3ba8edd4f14d88bab29a215ef246e5af764)

4 years agorec: Move to several distinct Bogus states, for easier debugging
Remi Gacogne [Mon, 12 Oct 2020 10:43:04 +0000 (12:43 +0200)] 
rec: Move to several distinct Bogus states, for easier debugging

This is especially useful after the fact, when the Bogus state is
retrieved from a cache and we don't have any clue left as to how
we ended up with that state.

(cherry picked from commit fd8709153d9318904ef2b1063bff10244d9724fd)

4 years agorec: Do not chase CNAME during qname minization step 4 9805/head
Remi Gacogne [Tue, 1 Dec 2020 09:52:37 +0000 (10:52 +0100)] 
rec: Do not chase CNAME during qname minization step 4

(cherry picked from commit 7373cea835239f1b18a72000821bb17b516d954b)

4 years agoEnsure socket-dir matches runtimedir on old systemd 9799/head
Pieter Lexis [Thu, 1 Oct 2020 18:36:51 +0000 (20:36 +0200)] 
Ensure socket-dir matches runtimedir on old systemd

This is mostly a hack for systemd version <240 so using virtual hosting
on Ubuntu Bionic and EL7 does not lead to surprises.

This Commit explicitly adds the `--socket-dir` to the invocation of the
unit. Any users who want to use their own runtimedirs should use a
drop-in unit overriding ExecStart. I believe this does not validate the
principle of least surprise for those using the PowerDNS provided
packages and virtual hosting.

Fixes #9485

(cherry picked from commit 7bbaae110abb53f43d0bf60c81efe3bb8630a925)

4 years agoMerge pull request #9774 from Habbie/backport-9766-to-rec-4.4.x
Otto Moerbeek [Thu, 26 Nov 2020 11:52:07 +0000 (12:52 +0100)] 
Merge pull request #9774 from Habbie/backport-9766-to-rec-4.4.x

rec-4.4.x: APL records: fix endianness problem.

4 years agoAPL records: fix endianness problem. Closes #9763 9774/head
Peter van Dijk [Tue, 24 Nov 2020 14:13:49 +0000 (15:13 +0100)] 
APL records: fix endianness problem. Closes #9763

(cherry picked from commit a0d9f00d8d76bb07847abb2f837f7c629fb238b2)

4 years agoMerge pull request #9719 from omoerbeek/backport-9707-to-rec-4.4.x rec-4.4.1
Otto Moerbeek [Mon, 16 Nov 2020 14:47:17 +0000 (15:47 +0100)] 
Merge pull request #9719 from omoerbeek/backport-9707-to-rec-4.4.x

rec: Backport to 4.4.x: Do not add request to a wait chain that's already processed or being processed.

4 years agoMerge pull request #9687 from omoerbeek/backport-9651-to-rec-4.4.x
Otto Moerbeek [Mon, 16 Nov 2020 07:05:08 +0000 (08:05 +0100)] 
Merge pull request #9687 from omoerbeek/backport-9651-to-rec-4.4.x

rec: Backport 9651 to rec 4.4.x: Allow to specify a name in getMetric() that is used for Prometheus export only.

4 years agoDo not add request to a wait chain that's already processed or being processed. 9719/head
Otto Moerbeek [Wed, 11 Nov 2020 11:02:50 +0000 (12:02 +0100)] 
Do not add request to a wait chain that's already processed or being processed.

The following scenario can occur. Multiple concurrent clients doing the same query A
are needed to trigger it:

1. Incoming request A, which has a need for request X
2. Add request X to chain because we already have an identical outstanding request
3. We receive the reply for X
4. We process the chain
5. In the meantime a new request for X that's identical is added to the chain
6. The added id in step 5 is not being processed anymore -> timeout

This can happen if request X has TTL 0, otherwise the record cache would have a hit.

(cherry picked from commit c647a254a0f863aabeaea9d33f673afa26c60457)

4 years agoMerge pull request #9710 from rgacogne/rec44-fakeaaa-cname-loop
Remi Gacogne [Thu, 12 Nov 2020 20:37:28 +0000 (21:37 +0100)] 
Merge pull request #9710 from rgacogne/rec44-fakeaaa-cname-loop

rec-4.4.x: Avoid a CNAME loop detection issue with DNS64

4 years agoMerge pull request #9705 from Habbie/rec-4.4-nod-oversize
Otto Moerbeek [Thu, 12 Nov 2020 19:22:34 +0000 (20:22 +0100)] 
Merge pull request #9705 from Habbie/rec-4.4-nod-oversize

rec-4.4: do not send overly long NOD lookups

4 years agorec: Add a regression test for the DNS64 CNAME loop detection issue 9710/head
Remi Gacogne [Tue, 10 Nov 2020 10:16:43 +0000 (11:16 +0100)] 
rec: Add a regression test for the DNS64 CNAME loop detection issue

(cherry picked from commit c222611257ba7230b7d5f5cea76bf79067079ce2)

4 years agorec: Avoid a CNAME loop detection issue with DNS64
Remi Gacogne [Tue, 10 Nov 2020 10:15:02 +0000 (11:15 +0100)] 
rec: Avoid a CNAME loop detection issue with DNS64

When the requested qname is a CNAME to a second CNAME, the CNAME
loop detection might get incorrectly triggered because the CNAMEs
were already present in the vector of result records.

(cherry picked from commit acc9751140f91020c2917831b70c7d51f744e91e)

4 years agorec-4.4: do not send overly long NOD lookups 9705/head
Peter van Dijk [Wed, 11 Nov 2020 10:20:41 +0000 (11:20 +0100)] 
rec-4.4: do not send overly long NOD lookups

4 years agoMerge pull request #9683 from omoerbeek/backport-9680-to-rec-4.4.x
Otto Moerbeek [Tue, 10 Nov 2020 08:19:32 +0000 (09:19 +0100)] 
Merge pull request #9683 from omoerbeek/backport-9680-to-rec-4.4.x

rec: Backport 9680 to rec 4.4.x: If a.b.c CNAME x.a.b.c is encoutered, switch off QM

4 years agoOnly prepend the pdns_recursor_ prefix if no 2nd arg to getMteric was 9687/head
Otto Moerbeek [Fri, 30 Oct 2020 08:12:06 +0000 (09:12 +0100)] 
Only prepend the pdns_recursor_ prefix if no 2nd arg to getMteric was
given.

This also fixes the lookup of the HELP entries since they require the
original key. So getAllStats() now returns the key, the prometheus name
and the value.

(cherry picked from commit 308cd14cac73ba48aca3d3953e12d1cc04a96bbb)

4 years agoAllow to specify a name that is used for Prometheus export only.
Otto Moerbeek [Wed, 28 Oct 2020 09:39:23 +0000 (10:39 +0100)] 
Allow to specify a name that is used for Prometheus export only.

This can be used to specify names that are structured using Prometheus
conventions. If no name Prometheus name is given, do a more thorough
conversion to a name Prometheus likes by replacng any non-alnum
char by an underscore.

(cherry picked from commit 57c5fefb0f2d97e072f8a9e34a30729e6c24b52b)

4 years agoMerge pull request #9682 from omoerbeek/backport-9679-to-rec-4.4.x
Otto Moerbeek [Mon, 9 Nov 2020 11:39:58 +0000 (12:39 +0100)] 
Merge pull request #9682 from omoerbeek/backport-9679-to-rec-4.4.x

rec: Backport 9679 to rec 4.4.x: Fix the processing of answers generated from gettag

4 years agoUse the same words for for both cases 9683/head
Otto Moerbeek [Mon, 9 Nov 2020 09:36:58 +0000 (10:36 +0100)] 
Use the same words for for both cases

(cherry picked from commit 90ef54c85523e845107fecda53b365e50ae69569)

4 years agoIf a.b.c CNAME x.a.b.c is encoutered, switch off
Otto Moerbeek [Fri, 6 Nov 2020 11:58:53 +0000 (12:58 +0100)] 
If a.b.c CNAME x.a.b.c is encoutered, switch off
QM, it will lead to great recursion depth without result.

(cherry picked from commit 157d17730c4fa6b25c1e0f5e720b7e73ac7723aa)

4 years agorec: Add a regression test for answers generated from gettag 9682/head
Remi Gacogne [Fri, 6 Nov 2020 14:28:53 +0000 (15:28 +0100)] 
rec: Add a regression test for answers generated from gettag

(cherry picked from commit 9fbfe39b195982fbce4123014a943a6f02bbe58d)

4 years agorec: Fix the processing of answers generated from gettag
Remi Gacogne [Fri, 6 Nov 2020 10:56:58 +0000 (11:56 +0100)] 
rec: Fix the processing of answers generated from gettag

The logic to let a RPZ match override the answers generated from Lua
was broken, ignoring the generated values.

(cherry picked from commit 995884ff35d9591857edd6aef0df07e892c19485)

4 years agoMerge pull request #9605 from omoerbeek/rec-backport-to-4.4.x-sec-2020-07 rec-4.4.0
Otto Moerbeek [Tue, 13 Oct 2020 10:17:29 +0000 (12:17 +0200)] 
Merge pull request #9605 from omoerbeek/rec-backport-to-4.4.x-sec-2020-07

rec: Backport of CVE-2020-25829 (any-cache-update) to 4.4.x

4 years agorec: Add a unit test for the ANY "just-in-time" cached records case 9605/head
Remi Gacogne [Thu, 24 Sep 2020 16:02:13 +0000 (18:02 +0200)] 
rec: Add a unit test for the ANY "just-in-time" cached records case

4 years agorec: Fix validation when more than one cached record is returned
Remi Gacogne [Thu, 24 Sep 2020 16:01:16 +0000 (18:01 +0200)] 
rec: Fix validation when more than one cached record is returned

We need to validate them RRSet by RRSet.

4 years agorec: Fix returning more than one cached records
Remi Gacogne [Tue, 22 Sep 2020 14:49:34 +0000 (16:49 +0200)] 
rec: Fix returning more than one cached records

The existing implementation did not properly update the DNSSEC
and authoritative status, and did not include all the needed
RRSIG and additional records.

4 years agorec: Prevent updating the status of all cached records for a name
Remi Gacogne [Tue, 22 Sep 2020 14:48:11 +0000 (16:48 +0200)] 
rec: Prevent updating the status of all cached records for a name

Before that fix, it was possible to make the recursor update the
DNSSEC status of all cached records for a given name using an ANY
query.
This real issue is that we should retrieve the needed RRSIGs and
authority records for all cached records when processing an ANY
query, but this fix prevents the cache pollution which is the worst
part of the issue.

4 years agoMerge pull request #9579 from omoerbeek/backport-9434-to-rec-4.4.x rec-4.4.0-rc2
Otto Moerbeek [Fri, 2 Oct 2020 10:23:25 +0000 (12:23 +0200)] 
Merge pull request #9579 from omoerbeek/backport-9434-to-rec-4.4.x

rec: Backport 9434 to rec 4.4.x: When deciding if we are auth in the local auth or forwarding case, DS is special

4 years agoFix test 9579/head
Otto Moerbeek [Fri, 4 Sep 2020 09:13:17 +0000 (11:13 +0200)] 
Fix test

(cherry picked from commit 4459dcf53f77a6de1b2802567146622cd80db276)

4 years agoTest for the reported issue wrt doing an spurious DS queries
Otto Moerbeek [Wed, 2 Sep 2020 13:57:40 +0000 (15:57 +0200)] 
Test for the reported issue wrt doing an spurious DS queries

I'm trying to setup a valid a.test and b.test, using a non-recursive forward
but somehow my DNSSEC setup is not right. Cannot spot the issue atm.

(cherry picked from commit 5879cd2d6d8d374a3aaa38e280a16c4d01d16ef4)

4 years agoWhen deciding if we are auth in the local auth or forwarding case,
Otto Moerbeek [Wed, 2 Sep 2020 12:03:44 +0000 (14:03 +0200)] 
When deciding if we are auth in the local auth or forwarding case,
for DS records we need to look at the parent of the particular name.

Seems to fix #9433

(cherry picked from commit 68f6b16cb2709d5cc9ca53823def2781cc2f1f06)

4 years agoMerge pull request #9577 from omoerbeek/backport-9569-to-rec-4.4.x
Otto Moerbeek [Fri, 2 Oct 2020 09:10:45 +0000 (11:10 +0200)] 
Merge pull request #9577 from omoerbeek/backport-9569-to-rec-4.4.x

rec: backport 9569 to rec 4.4.x: Don't parse any config with `--version`

4 years agoMerge pull request #9576 from omoerbeek/backport-9562-to-rec-4.4.x
Otto Moerbeek [Fri, 2 Oct 2020 09:10:24 +0000 (11:10 +0200)] 
Merge pull request #9576 from omoerbeek/backport-9562-to-rec-4.4.x

rec: Backport 9562 to rec 4.4.x: Expose typed cache flush via Web API

4 years agorecursor: Don't parse any config with `--version` 9577/head
Pieter Lexis [Thu, 1 Oct 2020 11:47:27 +0000 (13:47 +0200)] 
recursor: Don't parse any config with `--version`

This ensures we don't log anything _apart_ from the version info.
Spotted in https://github.com/PowerDNS/pdns_recursor-ansible/issues/66

(cherry picked from commit 2733183fc0b35ed2b59c87aab5aaaa86688db778)

4 years agoBe explicit we're talking about the recursor. 9576/head
Otto Moerbeek [Fri, 2 Oct 2020 08:21:21 +0000 (10:21 +0200)] 
Be explicit we're talking about the recursor.

(cherry picked from commit 193a9a7a0b1c8791d4d9de2bee290d62a8d0114c)

4 years agoExpose typed cache flush via Web API
Otto Moerbeek [Wed, 30 Sep 2020 08:24:33 +0000 (10:24 +0200)] 
Expose typed cache flush via Web API

(cherry picked from commit 3bb2d9875c82776d91c2c7a7d4de1a8ce8ed3097)

4 years agoMerge pull request #9557 from omoerbeek/rec-backport-9515-to-4.4.x
Otto Moerbeek [Wed, 30 Sep 2020 06:31:14 +0000 (08:31 +0200)] 
Merge pull request #9557 from omoerbeek/rec-backport-9515-to-4.4.x

rec: Backport #9515 to rec 4.4.x: actually fix wipe-cache-typed

4 years agoBackport #9515 to 4.4.x: actually fix wipe-cache-typed 9557/head
Otto Moerbeek [Tue, 29 Sep 2020 13:46:20 +0000 (15:46 +0200)] 
Backport #9515 to 4.4.x: actually fix wipe-cache-typed

4 years agoMerge pull request #9528 from omoerbeek/backport-9471-to-rec-4.4.x
Otto Moerbeek [Fri, 25 Sep 2020 12:38:29 +0000 (14:38 +0200)] 
Merge pull request #9528 from omoerbeek/backport-9471-to-rec-4.4.x

rec: Backport 9471 to rec-4.4.x: Log when going Bogus because of a missing SOA in authority

4 years agoMerge pull request #9526 from omoerbeek/backport-9495-to-rec-4.4.x
Otto Moerbeek [Fri, 25 Sep 2020 12:38:03 +0000 (14:38 +0200)] 
Merge pull request #9526 from omoerbeek/backport-9495-to-rec-4.4.x

rec: Backport 9495 to rec 4.4.x: Watch the descriptor again after an out-of-order read timeout

4 years agorec: Log when going Bogus because of a missing SOA in authority 9528/head
Remi Gacogne [Tue, 15 Sep 2020 13:03:34 +0000 (15:03 +0200)] 
rec: Log when going Bogus because of a missing SOA in authority

A missing SOA in the authority section of negative (NXDOMAIN, NODATA)
answers in a DNSSEC-secure zone currently leads to a Bogus result,
because the needed NSEC/NSEC3 could not be validated.

(cherry picked from commit 832f4fbdd7ef50d0e0ff5135ee6e270acc22df9d)

4 years agorec: Fix a typo in a comment 9526/head
Remi Gacogne [Wed, 23 Sep 2020 08:31:36 +0000 (10:31 +0200)] 
rec: Fix a typo in a comment

Co-authored-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
(cherry picked from commit ebcde9cbc9e1239157963e581327cdacde3a862f)

4 years agorec: Watch the descriptor again after an out-of-order read timeout
Remi Gacogne [Mon, 21 Sep 2020 15:24:55 +0000 (17:24 +0200)] 
rec: Watch the descriptor again after an out-of-order read timeout

It might be that there was no other incoming query on that connection
and we timed out while the response had not been sent yet, but the
client might want to re-use the connection after receving the response.
We try to reset the TTD, but that might fail when the socket descriptor
has already been removed.

(cherry picked from commit b05ef1b472cfa3597dda44075f3947abd565008b)

4 years agoMerge pull request #9506 from omoerbeek/backport-9497-to-rec-4.4.x
Otto Moerbeek [Fri, 25 Sep 2020 06:39:11 +0000 (08:39 +0200)] 
Merge pull request #9506 from omoerbeek/backport-9497-to-rec-4.4.x

rec: Backport 9497 to rec 4.4.x: raise an exception on invalid content in unknown record

4 years agorec: Fix invalid unknown record in the unit tests 9506/head
Remi Gacogne [Tue, 11 Aug 2020 13:31:57 +0000 (15:31 +0200)] 
rec: Fix invalid unknown record in the unit tests

(cherry picked from commit dda934facbac96a0aad5a82f84113009ddf3ec92)

4 years agoRaise an exception on invalid first part (!= \#) in unknown records
Remi Gacogne [Tue, 11 Aug 2020 12:07:32 +0000 (14:07 +0200)] 
Raise an exception on invalid first part (!= \#) in unknown records

(cherry picked from commit 2d79e3273b9b68bbdb0e45a2df1fbe4769296d07)

4 years agoRaise an exception on invalid hex content in unknown records
Remi Gacogne [Tue, 11 Aug 2020 09:25:06 +0000 (11:25 +0200)] 
Raise an exception on invalid hex content in unknown records

Otherwise we can end up reading uninitialised memory from the stack,
possibly leaking information.
This is only an issue if the content is read from an untrusted source
and can be passed back to an attacker.

(cherry picked from commit f5234115710094a8a7bd0b5ebddaa1fde83a52f0)

4 years agoMerge pull request #9465 from omoerbeek/backport-9448-to-rec-4.4.x rec-4.4.0-rc1
Remi Gacogne [Fri, 18 Sep 2020 06:44:12 +0000 (08:44 +0200)] 
Merge pull request #9465 from omoerbeek/backport-9448-to-rec-4.4.x

rec: Backport 9448 to rec 4.4.x: We only want to do QName Minimization for the names in a forwarded  domain.

4 years agoUse boost::optional to pass optional cutoff point. This way the 9465/head
Otto Moerbeek [Mon, 14 Sep 2020 09:30:42 +0000 (11:30 +0200)] 
Use boost::optional to pass optional cutoff point. This way the
proper cutoff point can be specified for forwarded zones only,
making it possible to change it meaning witjout regular nameserver
lookups.

(cherry picked from commit 96ce7d340951b31a3e3d042455a1f0e7f3a6eb56)

4 years agoMake code more clear by eliminating the "ancestor" as suggested by @rgacogne
Otto Moerbeek [Mon, 14 Sep 2020 08:56:40 +0000 (10:56 +0200)] 
Make code more clear by eliminating the "ancestor" as suggested by @rgacogne

(cherry picked from commit 1722d283bd3cf119870988213e9052bf0312a3e3)

4 years agoIf we're looking in the cache for NS for a forwarded name, we
Otto Moerbeek [Fri, 11 Sep 2020 08:06:24 +0000 (10:06 +0200)] 
If we're looking in the cache for NS for a forwarded name, we
can cut off the search at the forwarding domain.

I'm not sure if I like the added complexity...

(cherry picked from commit 007fb8008a7da4698dde9f65a8d7ace72d47970c)

4 years agoTake into account a potentially more specific NS we might
Otto Moerbeek [Tue, 8 Sep 2020 09:59:32 +0000 (11:59 +0200)] 
Take into account a potentially more specific NS we might
have in cache.

Also, do the forward lookup only once before the loop.

(cherry picked from commit afb1d0393abd613b2f362e48d1e3dde3d34689ca)

4 years agoWe only want to do QName Minimization for the names in a forwarded
Otto Moerbeek [Mon, 7 Sep 2020 10:17:30 +0000 (12:17 +0200)] 
We only want to do QName Minimization for the names in a forwarded
domain.

E.g. if foo.bar.com is forwarded and the qname is x.foo.bar.com,
start the QM process with ancestor foo.bar.com, so the query is
directed to the forwarder.  But if the qname is baz.bar.com, we do
regular QM, starting with the regular ancestor.

Should fix #9438 without breaking having forward for .

(cherry picked from commit 21af3294a6fdacd9632ecb3a05eb2ccf204d2fdb)

4 years agoMerge pull request #9458 from omoerbeek/backport-9454-to-rec-4.4.x
Otto Moerbeek [Fri, 11 Sep 2020 07:37:36 +0000 (09:37 +0200)] 
Merge pull request #9458 from omoerbeek/backport-9454-to-rec-4.4.x

rec: backport to 4.4.x: Parts is reused, so clear the names it might contain.

4 years agoMerge pull request #9459 from rgacogne/rec44-remove-non-rec-tests
Otto Moerbeek [Fri, 11 Sep 2020 06:34:20 +0000 (08:34 +0200)] 
Merge pull request #9459 from rgacogne/rec44-remove-non-rec-tests

rec-4.4.x: Remove non-recursor tests

4 years agorec-4.4.x: Remove non-recursor tests 9459/head
Remi Gacogne [Thu, 10 Sep 2020 09:27:03 +0000 (11:27 +0200)] 
rec-4.4.x: Remove non-recursor tests

4 years agoParts is reused, so clear the names it might contain. 9458/head
Otto Moerbeek [Wed, 9 Sep 2020 13:11:26 +0000 (15:11 +0200)] 
Parts is reused, so clear the names it might contain.

(cherry picked from commit bc3d2b7386e058c39872a3aa74101283b6f1af45)

4 years agoMerge pull request #9376 from omoerbeek/rec-rpz-store-trigger rec-4.4.0-beta1
Otto Moerbeek [Fri, 28 Aug 2020 11:19:53 +0000 (13:19 +0200)] 
Merge pull request #9376 from omoerbeek/rec-rpz-store-trigger

Rec: rpz store trigger in appliedPolicy and protobuf message

4 years agoAdd new field `AppliedPolicyHit` to regress test. 9376/head
Otto Moerbeek [Fri, 28 Aug 2020 09:36:50 +0000 (11:36 +0200)] 
Add new field `AppliedPolicyHit` to regress test.

4 years agoDocument new Lua dq fields and centralize logging in handle olicyHit functions.
Otto Moerbeek [Fri, 28 Aug 2020 09:29:33 +0000 (11:29 +0200)] 
Document new Lua dq fields and centralize logging in handle olicyHit functions.
Plus corrections from review.

4 years agoDefine a log string method for a Policy and use it in appropriate places
Otto Moerbeek [Mon, 17 Aug 2020 12:44:42 +0000 (14:44 +0200)] 
Define a log string method for a Policy and use it in appropriate places
to log what is going on wrt RPZ processing.

4 years agoAlso record the value that caused a hit.
Otto Moerbeek [Fri, 14 Aug 2020 08:51:28 +0000 (10:51 +0200)] 
Also record the value that caused a hit.

For triggers fomr rpz zones it makes sense to store them as listed there.
For hit values (names or IPs) it makes more sense to store them
in the regular string value and not list them as rpz trigger format.
e.g.: a trigger is listed

24.0.2.0.192.rpz-ip.rpz.local.

A corresponding hit as

192.0.2.1

4 years agoUse static constr string instead of string literals for some well-known names.
Otto Moerbeek [Fri, 14 Aug 2020 08:24:17 +0000 (10:24 +0200)] 
Use static constr string instead of string literals for some well-known names.

4 years agoAppease spell check
Otto Moerbeek [Mon, 10 Aug 2020 12:41:07 +0000 (14:41 +0200)] 
Appease spell check