From 9e2ff2cf220d3fcacc9a16643c6d9d13527ce1ee Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 9 Mar 2016 07:19:31 +0100 Subject: [PATCH] Adding logging for Bind --- bind/conf.sls | 16 +++++++ bind/dirs.sls | 11 +++++ bind/files/named-log.conf | 87 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 bind/files/named-log.conf diff --git a/bind/conf.sls b/bind/conf.sls index 7eb9da3..694c1d6 100644 --- a/bind/conf.sls +++ b/bind/conf.sls @@ -9,3 +9,19 @@ - backup: minion - require: - file: /etc/bind + +/etc/bind/named-log.conf: + file.managed: + - source: salt://bind/files/named-log.conf + - user: root + - group: root + - mode: 644 + - template: jinja + - backup: minion + - require: + - file: /etc/bind + - file: /var/log/bind + + + +# vim: filetype=sls diff --git a/bind/dirs.sls b/bind/dirs.sls index 152cfcc..bab58c8 100644 --- a/bind/dirs.sls +++ b/bind/dirs.sls @@ -35,6 +35,17 @@ - group: bind-group - user: bind-user +/var/log/bind/.old: + file.directory: + - user: bind + - group: bind + - dir_mode: 755 + - makedirs: True + - require: + - group: bind-group + - user: bind-user + - file: /var/log/bind + /etc/bind/dnssec: file.directory: - user: root diff --git a/bind/files/named-log.conf b/bind/files/named-log.conf new file mode 100644 index 0000000..70a0b92 --- /dev/null +++ b/bind/files/named-log.conf @@ -0,0 +1,87 @@ +//############################################################### +//# Bind9-Konfigurationsdatei Logging +//# /etc/bind/named-log.conf +//# +//# Host {{ grains['fqdn'] }} +//# +//############################################################### + +//############################################################### +//# Angaben zum Logging + +logging { + + //--------------------------------------- + // Channels + + channel complete_debug { + file "/var/log/bind/complete-debug.log"; + print-category yes; + print-severity yes; + print-time yes; + severity debug 99; + }; + + channel logtofile { + file "/var/log/bind/named.log"; + print-category yes; + print-severity yes; + print-time yes; + severity info; + }; + + channel moderate_debug { + file "/var/log/bind/debug.log"; + print-category yes; + print-severity yes; + print-time yes; + severity debug 1; + }; + + channel query_logging { + file "/var/log/bind/query.log"; + print-time yes; + }; + + channel security_file { + file "/var/log/bind/security.log"; + print-category yes; + print-severity yes; + print-time yes; + severity dynamic; + }; + + channel syslog-warning { + syslog daemon; + severity warning; + }; + + + //--------------------------------------- + // Categories + + category default { + default_debug; + logtofile; + }; + + category general { + logtofile; + syslog-warning; + }; + + category lame-servers { + null; + }; + + category queries { + query_logging; + }; + + category security { + security_file; + }; + +}; + +# vim: ts=4 filetype=named noai -- 2.39.5