bind9/bin
Michał Kępień 9e81903171 Set up default logging for SSLKEYLOGFILE
A customary method of exporting TLS pre-master secrets used by a piece
of software (for debugging purposes, e.g. to examine decrypted traffic
in a packet sniffer) is to set the SSLKEYLOGFILE environment variable to
the path to the file in which this data should be logged.

In order to enable writing any data to a file using the logging
framework provided by libisc, a logging channel needs to be defined and
the relevant logging category needs to be associated with it.  Since the
SSLKEYLOGFILE variable is only expected to contain a path, some defaults
for the logging channel need to be assumed.  Add a new function,
named_log_setdefaultsslkeylogfile(), for setting up those implicit
defaults, which are equivalent to the following logging configuration:

    channel default_sslkeylogfile {
        file "${SSLKEYLOGFILE}" versions 10 size 100m suffix timestamp;
    };

    category sslkeylog {
    	default_sslkeylogfile;
    };

This ensures TLS pre-master secrets do not use up more than about 1 GB
of disk space, which should be enough to hold debugging data for the
most recent 1 million TLS connections.

As these values are arguably not universally appropriate for all
deployment environments, a way for overriding them needs to exist.
Suppress creation of the default logging channel for TLS pre-master
secrets when the SSLKEYLOGFILE variable is set to the string "config".
This enables providing custom logging configuration for the relevant
category via the "logging" stanza.  (Note that it would have been
simpler to only skip setting up the default logging channel for TLS
pre-master secrets if the SSLKEYLOGFILE environment variable is not set
at all.  However, libisc only logs pre-master secrets if that variable
is set.  Detecting a "magic" string enables the SSLKEYLOGFILE
environment variable to serve as a single control for both enabling TLS
pre-master secret collection and potentially also indicating where and
how they should be exported.)
2021-12-22 18:17:26 +01:00
..
check remove all references to isc_socket and related types 2021-10-15 01:01:25 -07:00
confgen Use #pragma once as header guards 2021-10-13 00:49:15 -07:00
delv remove all references to isc_socket and related types 2021-10-15 01:01:25 -07:00
dig Disable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions 2021-12-01 16:10:04 +01:00
dnssec Drop cppcheck workarounds 2021-12-14 15:03:56 +01:00
named Set up default logging for SSLKEYLOGFILE 2021-12-22 18:17:26 +01:00
nsupdate remove all references to isc_socket and related types 2021-10-15 01:01:25 -07:00
plugins Make isc_result a static enum 2021-10-06 11:22:20 +02:00
rndc Update the description of fetches-per-zone counters 2021-11-30 11:10:04 +00:00
tests doth system test: reduce number of contexts in ns3 2021-12-20 14:28:53 +02:00
tools Make mdig use the OS-supplied ephemeral port range 2021-11-17 14:13:17 -08:00
Makefile.am Remove native PKCS#11 support 2021-09-09 15:35:39 +02:00