Ten watek jest logiczna kontynuacja watku:
viewtopic.php?f=5&t=34799
Ogolne dane systemu i aplikacji:
Kod: Zaznacz cały
root@robin-desktop:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
root@robin-desktop:~# uname -r
4.15.0-33-generic
root@robin-desktop:~# rsyslogd -version
rsyslogd 8.16.0, compiled with:
PLATFORM: x86_64-pc-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
memory allocator: system default
Runtime Instrumentation (slow code): No
uuid support: Yes
Number of Bits in RainerScript integers: 64
See http://www.rsyslog.com for more information.
root@robin-desktop:~# ps -A | grep rsyslog
18328 ? 00:00:00 rsyslogd
root@robin-desktop:~# rsyslogd -N1
rsyslogd: version 8.16.0, config validation run (level 1), master config /etc/rsyslog.conf
rsyslogd: command 'KLogPermitNonKernelFacility' is currently not permitted - did you already set it via a RainerScript command (v6+ config)? [v8.16.0 try http://www.rsyslog.com/e/2222 ]
rsyslogd: error during parsing file /etc/rsyslog.d/tcpconnections.conf, on or before line 2: warnings occured in file '/etc/rsyslog.d/tcpconnections.conf' around line 2 [v8.16.0 try http://www.rsyslog.com/e/2207 ]
Uzyte prefixy iptables:
Kod: Zaznacz cały
ctstate INVALID,NEW LOG level warning prefix "indrop"
ctstate INVALID,NEW LOG level warning prefix "outdrop"
Plik /etc/rsyslog.conf (rsyslog configuration file)
Kod: Zaznacz cały
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
module(load="imuxsock") # provides support for local system logging
module(load="imklog") # provides kernel logging support
module(load="immark") # provides --MARK-- message capability
#provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="514")
# Enable non-kernel facility klog messages
$KLogPermitNonKernelFacility on
###########################
#### GLOBAL DIRECTIVES ####
###########################
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
#
Plik /etc/rsyslog.d/50-default.com
Kod: Zaznacz cały
# Default rules for rsyslog.
#
# For more information see rsyslog.conf(5) and /etc/rsyslog.conf
#
# First some standard log files. Log by facility.
#
:msg, contains, "indrop" -/var/log/indrop.log
& ~
#
:msg, contains, "outdrop" -/var/log/outdrop.log
& ~
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
#daemon.* -/var/log/daemon.log
kern.* -/var/log/messages
#iptables log
kern.debug -/var/log/iptables.log
#lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
#user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
#mail.info -/var/log/mail.info
#mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
#
# Logging for INN news system.
#
news.crit /var/log/news/news.crit
news.err /var/log/news/news.err
news.notice -/var/log/news/news.notice
#
# Some "catch-all" log files.
#
#*.=debug;\
# auth,authpriv.none;\
# news.none;mail.none -/var/log/debug
#*.=info;*.=notice;*.=warn;\
# auth,authpriv.none;\
# cron,daemon.none;\
# mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg :omusrmsg:*
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warn /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
Plik /etc/rsyslog.d/10-iptables.conf (custom rules for rsyslog)
Kod: Zaznacz cały
:msg, contains, "indrop" -/var/log/indrop.log
& stop
:msg, contains, "outdrop" -/var/log/outdrop.log
& stop
Dodam jeszcze, ze system markowania pakietow "prefix" dziala a dowod ponizej:
Kod: Zaznacz cały
Sep 1 20:40:10 robin-desktop kernel: [ 7847.662243] indropIN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.1.1 LEN=59 TOS=0x00 PREC=0x00 TTL=64 ID=32509 DF PROTO=UDP SPT=47980 DPT=53 LEN=39
Sep 1 20:40:10 robin-desktop kernel: [ 7847.663218] outdropIN= OUT=lo SRC=127.0.0.1 DST=127.0.1.1 LEN=53 TOS=0x00 PREC=0x00 TTL=64 ID=32510 DF PROTO=UDP SPT=42336 DPT=53 LEN=33
Sep 1 20:40:10 robin-desktop kernel: [ 7847.663235] indropIN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.1.1 LEN=53 TOS=0x00 PREC=0x00 TTL=64 ID=32510 DF PROTO=UDP SPT=42336 DPT=53 LEN=33
Sep 1 20:40:10 robin-desktop kernel: [ 7847.673861] outdropIN= OUT=lo SRC=127.0.0.1 DST=127.0.1.1 LEN=59 TOS=0x00 PREC=0x00 TTL=64 ID=32512 DF PROTO=UDP SPT=41896 DPT=53 LEN=39
Sep 1 20:40:10 robin-desktop kernel: [ 7847.673878] indropIN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.1.1 LEN=59 TOS=0x00 PREC=0x00 TTL=64 ID=32512 DF PROTO=UDP SPT=41896 DPT=53 LEN=39
Sep 1 20:40:10 robin-desktop kernel: [ 7847.675087] outdropIN= OUT=lo SRC=127.0.0.1 DST=127.0.1.1 LEN=53 TOS=0x00 PREC=0x00 TTL=64 ID=32513 DF PROTO=UDP SPT=33267 DPT=53 LEN=33
Sep 1 20:40:10 robin-desktop kernel: [ 7847.675098] indropIN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=127.0.0.1 DST=127.0.1.1 LEN=53 TOS=0x00 PREC=0x00 TTL=64 ID=32513 DF PROTO=UDP SPT=33267 DPT=53 LEN=33
Zalozeniem jest zapisywanie logow iptables wg prefiksow do odpowiednich plikow.
Niestety, mimo iz staralem sie zastosowac Wasze rady z podanego powyzej watku, pliki:
- indrop.log
- outdrop.log
pozostaja puste, mozecie pomoc w rozwiazaniu tego problemu ?
Pozdro.