Skip to content

Commit b06cc25

Browse files
committed
datamodel: move dnssec bogus logging from 'logging' section to 'dnssec' section
1 parent b3d8a7b commit b06cc25

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ Incompatible changes
2222
- /network/tls/auto-discovery
2323
- /webmgmt
2424
- /workers-max
25-
- Renamed options in the declarative configuration model (YAML).
25+
- Renamed/moved options in the declarative configuration model (YAML).
2626
- /network/tls/files-watchdog -> /network/tls/watchdog
2727
- /dnssec/keep-removed -> /dnssec/trust-anchors-keep-removed
2828
- /dnssec/trust-anchor-sentinel -> /dnssec/sentinel
2929
- /dnssec/trust-anchor-signal-query -> /dnssec/signal-query
30+
- /logging/dnssec-bogus -> /dnssec/logging-bogus
3031

3132

3233
Knot Resolver 6.0.11 (2025-02-26)

doc/_static/config.schema.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,11 @@
12291229
"description": "Enable/disable DNSSEC.",
12301230
"default": true
12311231
},
1232+
"logging-bogus": {
1233+
"type": "boolean",
1234+
"description": "Enable logging for each DNSSEC validation failure if '/logging/level' is set to at least 'notice'.",
1235+
"default": false
1236+
},
12321237
"sentinel": {
12331238
"type": "boolean",
12341239
"description": "Allows users of DNSSEC validating resolver to detect which root keys are configured in resolver's chain of trust. (RFC 8509)",
@@ -1294,6 +1299,7 @@
12941299
},
12951300
"default": {
12961301
"enabled": true,
1302+
"logging_bogus": false,
12971303
"sentinel": true,
12981304
"signal_query": true,
12991305
"trust_anchors_keep_removed": 0,
@@ -1442,11 +1448,6 @@
14421448
"description": "List of groups for which 'debug' logging level is set.",
14431449
"default": null
14441450
},
1445-
"dnssec-bogus": {
1446-
"type": "boolean",
1447-
"description": "Logging a message for each DNSSEC validation failure.",
1448-
"default": false
1449-
},
14501451
"dnstap": {
14511452
"anyOf": [
14521453
{
@@ -1489,7 +1490,6 @@
14891490
"level": "notice",
14901491
"target": "stdout",
14911492
"groups": null,
1492-
"dnssec_bogus": false,
14931493
"dnstap": false
14941494
}
14951495
},

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
@@ -24,6 +24,7 @@ class DnssecSchema(ConfigSchema):
2424
2525
---
2626
enabled: Enable/disable DNSSEC.
27+
logging_bogus: Enable logging for each DNSSEC validation failure if '/logging/level' is set to at least 'notice'.
2728
sentinel: Allows users of DNSSEC validating resolver to detect which root keys are configured in resolver's chain of trust. (RFC 8509)
2829
signal_query: Signaling Trust Anchor Knowledge in DNSSEC Using Key Tag Query, according to (RFC 8145#section-5).
2930
trust_anchors_keep_removed: How many removed keys should be held in history (and key file) before being purged.
@@ -34,6 +35,7 @@ class DnssecSchema(ConfigSchema):
3435
"""
3536

3637
enabled: bool = True
38+
logging_bogus: bool = False
3739
sentinel: bool = True
3840
signal_query: bool = True
3941
trust_anchors_keep_removed: IntNonNegative = IntNonNegative(0)

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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
{% if cfg.dnssec.enabled %}
44

5+
-- dnssec.logging-bogus
6+
{% if cfg.dnssec.logging_bogus %}
7+
modules.load('bogus_log')
8+
{% else %}
9+
-- modules.unload('bogus_log')
10+
{% endif %}
11+
512
-- dnssec.sentinel
613
{% if cfg.dnssec.sentinel %}
714
modules.load('ta_sentinel')

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)