Skip to content

Commit 2971b3a

Browse files
committed
datamodel: move dnssec bogus logging from 'logging' section to 'dnssec' section
1 parent ff123b5 commit 2971b3a

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ Incompatible changes
2121
- /network/tls/auto-discovery
2222
- /webmgmt
2323
- /workers-max
24-
- Renamed options in the declarative configuration model (YAML).
24+
- Renamed/moved options in the declarative configuration model (YAML).
2525
- /network/tls/files-watchdog -> /network/tls/watchdog
26+
- /logging/dnssec-bogus -> /dnssec/logging-bogus
2627

2728

2829
Knot Resolver 6.0.11 (2025-02-26)

doc/_static/config.schema.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,11 @@
12951295
},
12961296
"description": "List of zone-files where trust-anchors are stored.",
12971297
"default": null
1298+
},
1299+
"logging-bogus": {
1300+
"type": "boolean",
1301+
"description": "Enable logging for each DNSSEC validation failure if '/logging/level' is set to at least 'notice'.",
1302+
"default": false
12981303
}
12991304
}
13001305
}
@@ -1442,11 +1447,6 @@
14421447
"description": "List of groups for which 'debug' logging level is set.",
14431448
"default": null
14441449
},
1445-
"dnssec-bogus": {
1446-
"type": "boolean",
1447-
"description": "Logging a message for each DNSSEC validation failure.",
1448-
"default": false
1449-
},
14501450
"dnstap": {
14511451
"anyOf": [
14521452
{
@@ -1489,7 +1489,6 @@
14891489
"level": "notice",
14901490
"target": "stdout",
14911491
"groups": null,
1492-
"dnssec_bogus": false,
14931492
"dnstap": false
14941493
}
14951494
},

doc/user/config-logging-bogus.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Add following line to your configuration file to enable it:
1313

1414
.. code-block:: yaml
1515
16-
logging:
17-
dnssec-bogus: true
16+
dnssec:
17+
logging-bogus: true
1818
1919
Example of error message logged:
2020

python/knot_resolver/datamodel/dnssec_schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class DnssecSchema(ConfigSchema):
3030
trust_anchors: List of trust-anchors in DS/DNSKEY records format.
3131
negative_trust_anchors: List of domain names representing negative trust-anchors. (RFC 7646)
3232
trust_anchors_files: List of zone-files where trust-anchors are stored.
33+
logging_bogus: Enable logging for each DNSSEC validation failure if '/logging/level' is set to at least 'notice'.
3334
"""
3435

3536
trust_anchor_sentinel: bool = True
@@ -39,3 +40,4 @@ class DnssecSchema(ConfigSchema):
3940
trust_anchors: Optional[List[EscapedStr]] = None
4041
negative_trust_anchors: Optional[List[DomainName]] = None
4142
trust_anchors_files: Optional[List[TrustAnchorFileSchema]] = None
43+
logging_bogus: bool = False

python/knot_resolver/datamodel/logging_schema.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,19 @@ class Raw(ConfigSchema):
8989
level: Global logging level.
9090
target: Global logging stream target. "from-env" uses $KRES_LOGGING_TARGET and defaults to "stdout".
9191
groups: List of groups for which 'debug' logging level is set.
92-
dnssec_bogus: Logging a message for each DNSSEC validation failure.
9392
dnstap: Logging DNS requests and responses to a unix socket.
9493
"""
9594

9695
level: LogLevelEnum = "notice"
9796
target: Union[LogTargetEnum, Literal["from-env"]] = "from-env"
9897
groups: Optional[List[LogGroupsEnum]] = None
99-
dnssec_bogus: bool = False
10098
dnstap: Union[Literal[False], DnstapSchema] = False
10199

102100
_LAYER = Raw
103101

104102
level: LogLevelEnum
105103
target: LogTargetEnum
106104
groups: Optional[List[LogGroupsEnum]]
107-
dnssec_bogus: bool
108105
dnstap: Union[Literal[False], DnstapSchema]
109106

110107
def _target(self, raw: Raw) -> LogTargetEnum:

python/knot_resolver/datamodel/templates/dnssec.lua.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,10 @@ trust_anchors.set_insecure({
4747
{% for taf in cfg.dnssec.trust_anchors_files %}
4848
trust_anchors.add_file('{{ taf.file }}', readonly = {{ boolean(taf.read_only) }})
4949
{% endfor %}
50-
{% endif %}
50+
{% endif %}
51+
52+
{% if cfg.dnssec.logging_bogus %}
53+
modules.load('bogus_log')
54+
{% else %}
55+
modules.unload('bogus_log')
56+
{% endif %}

python/knot_resolver/datamodel/templates/logging.lua.j2

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ log_groups({
1919
})
2020
{% endif %}
2121

22-
{% if cfg.logging.dnssec_bogus %}
23-
modules.load('bogus_log')
24-
{% endif %}
25-
2622
{% if cfg.logging.dnstap -%}
2723
-- logging.dnstap
2824
modules.load('dnstap')

0 commit comments

Comments
 (0)