iptables und syslog-ng

Post Reply
Message
Author
ceroe
Posts: 51
Joined: 14. Mar 2001 7:23
Location: 35396 Gießen
Contact:

iptables und syslog-ng

#1 Post by ceroe »

Hallo,

mir ist aufgefallen, daß ich keine Firewalleinträge mehr in der Datei /var/log/messages sehe, wenn ich syslog-ng-1.4.14 verwende. Mit dem "normalen" syslog sehe ich kernel-Einträge. Kann mir hier irgendwer weiterhelfen? Hier meine Conf:

(Unten geht es weiter mit Erklärungen)

------ Konfigurationsdatei syslog-ng.conf -----------------

#
# /etc/syslog-ng/syslog-ng.conf - Configuration file for syslog-ng(8)
#
# File format description can be found in syslog-ng.conf(5).
#

options { long_hostnames(off); sync(0); };

source src { unix-stream("/dev/log"); internal(); };
#source net { udp("0.0.0.0" port(514)); };

filter f_newsnotice { level(notice) and facility(news); };
filter f_newscrit { level(crit) and facility(news); };
filter f_newserr { level(err) and facility(news); };
filter f_news { facility(news); };
filter f_mail { facility(mail); };
filter f_cron { facility(cron); };
filter f_warn { level(warn, err, crit); };
filter f_alert { level(alert); };
filter f_debug { level(debug) and not match(pppd); };

filter f_messages { not facility(news, mail)
and not level(debug)
and not match(popper); };

filter f_local { facility(local0, local1, local2, local3,
local4, local5, local6, local7)
and not level(debug); };

#
# print most on tty10 and on the xconsole pipe
#
destination console { file("/dev/tty10"); };
log { source(src); filter(f_warn); destination(console); };

destination xconsole { pipe("/dev/xconsole"); };
log { source(src); filter(f_warn); destination(xconsole); };

# enable this, if you want that root is informed
# immediately, e.g. of logins
#destination root { usertty("root"); };
#log { source(src); filter(f_alert); destination(root); };

#
# Warnings in one file
#
destination warn { file("/var/log/warn"); };
log { source(src); filter(f_warn); destination(warn); };

#
# Debug in one file except pppd output
#
destination debug { file("/var/log/debug"); };
log { source(src); filter(f_debug); destination(debug); };

#
# these files are rotated and examined by "news.daily"
#
destination newscrit { file("/var/log/news/news.crit"); };
log { source(src); filter(f_newscrit); destination(newscrit); };

destination newserr { file("/var/log/news/news.err"); };
log { source(src); filter(f_newserr); destination(newserr); };

destination newsnotice { file("/var/log/news/news.notice"); };
log { source(src); filter(f_newsnotice); destination(newserr); };

#
# enable this, if you want to keep all news messages
# in one file
#destination news { file("/var/log/news.all"); };
#log { source(src); filter(f_news); destination(news); };

#
# all email-messages in one file
#
destination mail { file("/var/log/mail"); };
log { source(src); filter(f_mail); destination(mail); };

#
# all cron-messages in one file
#
destination cron { file("/var/log/cron"); };
log { source(src); filter(f_cron); destination(cron); };

#
# Some foreign boot scripts require local7
#
destination localmessages { file("/var/log/localmessages"); };
log { source(src); filter(f_local); destination(localmessages); };

#
# save the rest in one file
#
destination messages { file("/var/log/messages"); };
log { source(src); filter(f_messages); destination(messages); };

#
# enable this, if you want to keep all messages
# in one file
#destination allmessages { file("/var/log/allmessages"); };
#log { source(src); destination(allmessages); };

-------- Ende der Datei -------------

Ich verwende eine leicht modifizierte Firewallfassung von HJB. Die Logging-Zeilen heißen hier:

CreateBucket ()
{
${IPTABLES} -N destroy
${IPTABLES} -A destroy -j LOG --log-level notice -m limit
${IPTABLES} -A destroy -j DROP
}

Wäre super nett, wenn mir jemand helfen könnte <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">

Achso, ja, SuSE-7.3, Kernel 2.4.16-4GB

Danke schon mal

Gruß
Christian
Informatikstudent an der Fachhochschule Gießen/Friedberg

Rossi

Re: iptables und syslog-ng

#2 Post by Rossi »

Bei mir hab ich im syslog eine facility "kern", also:

kern.info;kern.!warn /var/log/kern

vielleicht mal explizit testen:

filter f_kern { level(notice) and facility(kern); };
destination kern { file("/var/log/iptables"); };
log { source(src); filter(f_kern); destination(kern); };

Zumindest hab ich den "klassischen" syslog soweit gedreht bekommen, das ich fast nur noch iptables Meldungen in "/var/log/kern" hab.
Habe nun leider noch nie mit syslogng gearbeitet (hey, wie wäre es mit einem Artikel in pro-linux :), aber sieht ganz interessant aus. Hab die obere Syntax auch nur aus der Deinigen abgelesen. Kann also dirchaus falsch séin. Es geht halt darum ,die facility kern zu loggen.

Post Reply