FreeBSD 8 LOG_SECURITY and LOG_AUTH confused
Guys something shit the bed with 3.0.3 on 8.0-PL: ----- config ---------------- source src { unix-dgram("/var/run/log"); filter f_security { facility(security); }; filter f_auth { facility(auth); }; destination security { file("/var/log/security" template(cfi_template)); }; destination authlog { file("/var/log/auth.log" template(cfi_template)); }; log { source(src); filter(f_security); destination(security); flags(final); }; log { source(src); filter(f_auth); destination(authlog); flags(final); }; ------------------------- # /usr/local/sbin/syslog-ng -p /var/run/syslog.pid -tevdF Syslog connection established; fd='5', server='AF_INET(192.168.128.XXX:514)', local='AF_INET(0.0.0.0:0)' Running application hooks; hook='1' Running application hooks; hook='3' syslog-ng starting up; version='3.0.3' ^Z [5]+ Stopped /usr/local/sbin/syslog-ng -p /var/run/syslog.pid -tevdF [root@cfi-db-corp ~]# bg [root@cfi-db-corp ~]# echo test | logger -p auth.info Incoming log entry; line='<38>Mar 18 15:57:40 bseklecki: test' Filter rule evaluation begins; filter_rule='f_ams' Filter node evaluation result; filter_result='not-match', filter_type='level' Filter node evaluation result; filter_result='not-match', filter_type='AND' Filter node evaluation result; filter_result='not-match', filter_type='AND' Filter rule evaluation result; filter_result='not-match', filter_rule='f_ams' Filter rule evaluation begins; filter_rule='f_auth' Filter node evaluation result; filter_result='match', filter_type='facility' Filter rule evaluation result; filter_result='match', filter_rule='f_auth' Filter rule evaluation begins; filter_rule='f_ams' Filter node evaluation result; filter_result='not-match', filter_type='level' Filter node evaluation result; filter_result='not-match', filter_type='AND' Filter node evaluation result; filter_result='not-match', filter_type='AND' Filter rule evaluation result; filter_result='not-match', filter_rule='f_ams' Filter rule evaluation begins; filter_rule='f_authpriv' Filter node evaluation result; filter_result='not-match', filter_type='facility' Filter rule evaluation result; filter_result='not-match', filter_rule='f_authpriv' Filter rule evaluation begins; filter_rule='f_kern' Filter node evaluation result; filter_result='not-match', filter_type='facility' Filter rule evaluation result; filter_result='not-match', filter_rule='f_kern' Filter rule evaluation begins; filter_rule='f_user' Filter node evaluation result; filter_result='not-match', filter_type='facility' Filter rule evaluation result; filter_result='not-match', filter_rule='f_user' Filter rule evaluation begins; filter_rule='f_mail' Filter node evaluation result; filter_result='not-match', filter_type='facility' Filter rule evaluation result; filter_result='not-match', filter_rule='f_mail' Filter rule evaluation begins; filter_rule='f_security' Filter node evaluation result; filter_result='match', filter_type='facility' Filter rule evaluation result; filter_result='match', filter_rule='f_security' Initializing destination file writer; template='/var/log/security', filename='/var/log/security' The two fixes I can find are: - Move: "log { source(src); filter(f_security);.." below "log { source(src); filter(f_auth);..." ...wait, what?! - Remove reference to LOG_SECURITY /usr/include/syslog.h defines for Facility->index mappings haven't changed since RELENG_6, so I'm not sure what to make of this. Very strange, ~BAS
On Thu, 2010-03-18 at 12:13 -0400, Brian A. Seklecki wrote:
Guys something shit the bed with 3.0.3 on 8.0-PL:
syslog-ng thinks that "security" is equal to "auth" {"security", LOG_AUTH}, /* DEPRECATED */ This comes from the original <sys/syslog.h> in Linux. Don't tell me, I know. However syslog-ng 3.1 got decoupled from the system installed syslog.h as that proved to be less than reliable. It defines "security" as: {"security", FACILITY_CODE(13) }, I guess the patch that introduces this behaviour can easily be backported. I didn't touch the stable branch as I felt it was too risky. And I may be right, if this means that the meaning of the "security" facility has changed. (would have been quite a suprise if it happened in the 3.0 maintenance releases). To make it easier for you, here's the patch that made this change: commit 8a02601f81791a519de568f900276ceedd3ca6c9 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Fri Sep 4 09:55:18 2009 +0200 [syslog-names] decouple the facility/severity codes known by syslog-ng from the system defined codes Until now syslog-ng depended on the values defined in <syslog.h> to implement the severity/facility name lookups. Since BSD uses a couple of new facility codes which are not defined on other system, this patch removes this dependency and hard-codes the values defined by RFC3164, the Linux syslog.h header and the BSD syslog.h header. This makes syslog-ng know about "ntp", "security" and "console" facilities. Even on non-BSD systems. -- Bazsi
On Thu, 2010-03-18 at 15:49 -0400, Brian A. Seklecki wrote:
Guys something shit the bed with 3.0.3 on 8.0-PL:
As mentioned, this is fixed in 3.1.1 on FBSD 8.1-RC1 Thanks all. ~BAS
participants (2)
-
Balazs Scheidler
-
Brian A. Seklecki