2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

30189 Commits

Author SHA1 Message Date
Matthijs Mekking
09ac224c5c dnssec-keygen can create keys given dnssec-policy
This commit adds code for generating keys with dnssec-keygen given
a specific dnssec-policy.

The dnssec-policy can be set with a new option '-k'. The '-l'
option can be used to set a configuration file that contains a
specific dnssec-policy.

Because the dnssec-policy dictates how the keys should look like,
many of the existing dnssec-keygen options cannot be used together
with '-k'.

If the dnssec-policy lists multiple keys, dnssec-keygen has now the
possibility to generate multiple keys at one run.

Add two tests for creating keys with '-k': One with the default
policy, one with multiple keys from the configuration.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
97a5698e06 Add various get functions for kasp
Write functions to access various elements of the kasp structure,
and the kasp keys. This in preparation of code in dnssec-keygen,
dnssec-settime, named...
2019-11-06 22:31:45 +01:00
Matthijs Mekking
77d2895a5a Update dst key code to maintain key state
Add a number of metadata variables (lifetime, ksk and zsk role).

For the roles we add a new type of metadata (booleans).

Add a function to write the state of the key to a separate file.

Only write out known metadata to private file.  With the
introduction of the numeric metadata "Lifetime", adjust the write
private key file functionality to only write out metadata it knows
about.
2019-11-06 22:31:45 +01:00
Matthijs Mekking
7f4d1dbddf Nit: fix typo in documentation dst_key_getnum 2019-11-06 22:31:44 +01:00
Matthijs Mekking
68e8741c98 Fix: nums type in dst_keys
This was isc_stdtime_t but should be uint32_t.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
e6ee5486ca Nit: fix typo (dnsssec-signzone) 2019-11-06 22:31:44 +01:00
Matthijs Mekking
7bfac50336 Add code for creating kasp from config
Add code for creating, configuring, and destroying KASP keys.  When
using the default policy, create one CSK, no rollover.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
1a9692f5c8 dnssec-keygen: Move keygen function above main
This is done in a separate commit to make diff easier.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
2829e29410 dnssec-keygen: Move key gen code in own function
In preparation for key generation with dnssec-policy, where multiple
keys may be created.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
48ce026dc9 Sync options in dnssec-keygen
Code and documentation were not in line:
- Remove -z option from code
- Remove -k option from docbook
- Add -d option to docbook
- Add -T option to docbook
2019-11-06 22:31:44 +01:00
Matthijs Mekking
e9ccebd94e Introduce kasp structure
This stores the dnssec-policy configuration and adds methods to
create, destroy, and attach/detach, as well as find a policy with
the same name in a list.

Also, add structures and functions for creating and destroying
kasp keys.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
a50d707fdc Introduce dnssec-policy configuration
This commit introduces the initial `dnssec-policy` configuration
statement. It has an initial set of options to deal with signature
and key maintenance.

Add some checks to ensure that dnssec-policy is configured at the
right locations, and that policies referenced to in zone statements
actually exist.

Add some checks that when a user adds the new `dnssec-policy`
configuration, it will no longer contain existing DNSSEC
configuration options.  Specifically: `inline-signing`,
`auto-dnssec`, `dnssec-dnskey-kskonly`, `dnssec-secure-to-insecure`,
`update-check-ksk`, `dnssec-update-mode`, `dnskey-sig-validity`,
and `sig-validity-interval`.

Test a good kasp configuration, and some bad configurations.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
1fbd8bb1b3 Design documentation 'dnssec-policy'
Initial design document.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
b7c5bfb203 Extend ttlval to accept ISO 8601 durations
The ttlval configuration types are replaced by duration configuration
types. The duration is an ISO 8601 duration that is going to be used
for DNSSEC key timings such as key lifetimes, signature resign
intervals and refresh periods, etc. But it is also still allowed to
use the BIND ttlval ways of configuring intervals (number plus
optional unit).

A duration is stored as an array of 7 different time parts.
A duration can either be expressed in weeks, or in a combination of
the other datetime indicators.

Add several unit tests to ensure the correct value is parsed given
different string values.
2019-11-06 22:31:44 +01:00
Matthijs Mekking
c67379fb92 Change indentation in doc/arm/dnssec.xml
This commit does not change anything significant, it just makes
the file more readable in preparation for upcoming changes related
to the `dnssec-policy` configuration option.
2019-11-06 22:31:44 +01:00
Michał Kępień
799e95b132 Merge branch '1206-fix-tcp-high-water-release-note' into 'master'
Fix TCP high-water release note

Closes #1206

See merge request isc-projects/bind9!2541
2019-11-06 15:28:55 +00:00
Michał Kępień
d0a3273d4d Fix TCP high-water release note
Add missing GitLab issue number to the TCP high-water release note.
2019-11-06 16:25:55 +01:00
Michał Kępień
db670fcdc8 Merge branch '1298-do-not-use-sys-sysctl.h-on-linux' into 'master'
Do not use <sys/sysctl.h> on Linux

Closes #1298

See merge request isc-projects/bind9!2525
2019-11-06 14:49:42 +00:00
Michał Kępień
65a8b53bd0 Do not use <sys/sysctl.h> on Linux
glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html
2019-11-06 15:32:04 +01:00
Michał Kępień
89f874e6ee Merge branch '1206-add-assert_int_equal-shell-function' into 'master'
Add assert_int_equal() shell function

Closes #1206

See merge request isc-projects/bind9!2535
2019-11-06 14:31:02 +00:00
Michał Kępień
8bb7f1f2a1 Add assert_int_equal() shell function
Add a shell function which is used in the "tcp" system test, but has
been accidentally omitted from !2425.  Make sure the function does not
change the value of "ret" itself, so that the caller can decide what to
do with the function's return value.
2019-11-06 15:24:15 +01:00
Ondřej Surý
54b92a04b1 Merge branch '1256-jitter-dynamically-updated-signatures' into 'master'
Resolve "Signature Expiration Jitter not working for dynamic NSEC3 zones"

Closes #1256

See merge request isc-projects/bind9!2451
2019-11-06 14:01:19 +00:00
Ondřej Surý
00569e0dfa Add CHANGES 2019-11-06 13:31:25 +01:00
Matthijs Mekking
540b90fd6c Test jitter distribution
Test jitter distribution in NSEC3 dynamic zone and for a zone that has old
signatures.  In both cases the generated signatures should be spread nicely.
2019-11-06 13:31:25 +01:00
Witold Kręcicki
6b2fd40269 Jitter signatures times when adding dynamic records.
When doing regular signing expiry time is jittered to make sure
that the re-signing times are not clumped together. This expands
this behaviour to expiry times of dynamically added records.

When incrementally re-signing a zone use the full jitter range if
the server appears to have been offline for greater than 5 minutes
otherwise use a small jitter range of 3600 seconds.  This will stop
the signatures becoming more clustered if the server has been off
line for a significant period of time (> 5 minutes).
2019-11-06 13:31:25 +01:00
Ondřej Surý
7c7f5884e5 Merge branch '1206-tcp-high-water-stats-fix-type' into 'master'
Avoid an extra atomic_load call when doing atomic_compare_exchange_loop

See merge request isc-projects/bind9!2531
2019-11-06 11:31:31 +00:00
Ondřej Surý
b4df5a6ecb Avoid an extra atomic_load() call 2019-11-06 11:30:36 +01:00
Ondřej Surý
3361247519 Merge branch '1285-documentation-update-to-sortlist-feature-bugs-42615' into 'master'
arm: Add a sentence about overlaping selectors in sortlist statement

Closes #1285

See merge request isc-projects/bind9!2517
2019-11-06 10:05:27 +00:00
Ondřej Surý
ebc61946b2 arm: Add a sentence about overlaping selectors in sortlist statement 2019-11-06 11:04:20 +01:00
Ondřej Surý
9abcff9ce3 Merge branch '1206-tcp-high-water-stats' into 'master'
Added tcp-high-water statistics variable.

Closes #1206

See merge request isc-projects/bind9!2425
2019-11-06 08:47:19 +00:00
Diego Fronza
ba3fe75e65 Added TCP high-water entry to CHANGES 2019-11-06 09:18:27 +01:00
Diego Fronza
dd492b64d9 Added TCP high-water entry to release notes 2019-11-06 09:18:27 +01:00
Diego Fronza
29be224a04 Added TCP high-water system tests
Note: ans6/ans6.py is a helper script that allows tests.sh to open/close
TCP connections to some BIND instance.
2019-11-06 09:18:27 +01:00
Diego Fronza
66fe8627de Added TCP high-water statistics variable
This variable will report the maximum number of simultaneous tcp clients
that BIND has served while running.

It can be verified by running rndc status, then inspect "tcp high-water:
count", or by generating statistics file, rndc stats, then inspect the
line with "TCP connection high-water" text.

The tcp-highwater variable is atomically updated based on an existing
tcp-quota system handled in ns/client.c.
2019-11-06 09:18:27 +01:00
Diego Fronza
a544e2e300 Add functions for collecting high-water counters
Add {isc,ns}_stats_{update_if_greater,get_counter}() functions that
are used to set and collect high-water type of statistics.
2019-11-06 09:11:20 +01:00
Diego Fronza
eb5611a770 Change the isc_stat_t type to isc__atomic_statcounter_t
The isc_stat_t type was too similar to isc_stats_t type, so the name was
changed to something more distinguishable.
2019-11-06 09:09:45 +01:00
Diego Fronza
0fc98ef2d5 Change the isc_statscounter_t type from int to C99 int_fast64_t type
For TCP high-water work, we need to keep the used integer types widths
in sync.

Note: int_fast32_t is used on WIN32 platform
2019-11-06 08:43:46 +01:00
Mark Andrews
5d4182c945 Merge branch '1301-geoip2-default-data-path' into 'master'
Resolve "geoip2 default data path"

Closes #1301

See merge request isc-projects/bind9!2520
2019-11-05 23:50:12 +00:00
Mark Andrews
7b10faf108 Add CHANGES note 2019-11-06 10:23:33 +11:00
Mark Andrews
51fb42edcb Regenerate configure. 2019-11-06 10:23:29 +11:00
Mark Andrews
2eaa75c380 Have 'named -V' report geoip-directory 2019-11-06 10:20:16 +11:00
Mark Andrews
fcd765a59d The default geoip-directory should be <MAXMINDDB_PREFIX>/share/GeoIP 2019-11-06 10:20:16 +11:00
Mark Andrews
e0fe33506c MAXMINDDB_LIBS should end with '/lib' not '/libs' 2019-11-06 10:20:16 +11:00
Ondřej Surý
ae33c75d06 Merge branch '664-fetches-per-server-quota-docs' into 'master'
Describe the polynomial backoff curve used in the quota adjustment

Closes #664

See merge request isc-projects/bind9!2519
2019-11-05 08:50:01 +00:00
Ondřej Surý
56ef09c3a1 Describe the polynomial backoff curve used in the quota adjustment 2019-11-05 09:48:15 +01:00
Ondřej Surý
5fc8130822 Merge branch '45-integrate-llvm-scan-build-to-gitlab-ci-workflow' into 'master'
Add LLVM/Clang scan-build checks into the GitLab CI

Closes #45

See merge request isc-projects/bind9!2452
2019-11-04 16:00:56 +00:00
Ondřej Surý
e9acad638e libdns: add missing checks for return values in dnstap unit test
Related scan-build report:

dnstap_test.c:169:2: warning: Value stored to 'result' is never read
        result = dns_test_makeview("test", &view);
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dnstap_test.c:193:2: warning: Value stored to 'result' is never read
        result = dns_compress_init(&cctx, -1, dt_mctx);
        ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
2019-11-04 16:15:22 +01:00
Ondřej Surý
6decd14592 named: remove named_g_defaultdnstap global variable
The named_g_defaultdnstap was never used as the dnstap requires
explicit configuration of the output file.

Related scan-build report:

./server.c:3476:14: warning: Value stored to 'dpath' during its initialization is never read
        const char *dpath = named_g_defaultdnstap;
                    ^~~~~   ~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
2019-11-04 16:15:22 +01:00
Ondřej Surý
64cf5144a6 libdns: Change check_dnskey_sigs() return type to void to match the reality how the function is used 2019-11-04 16:15:22 +01:00
Ondřej Surý
309dca417c tests: Resolve scan-build false positive by adding extra assertion 2019-11-04 16:15:22 +01:00