iJorgen
Regular Contributor
Is there any way to make the system-log more clean and efficient regarding blocked events from the firewall? Today lots of info are logged that's not really needed, so by optimizing it around 3 times more entries will fit in the same log-size. Today a blocked entry looks something like this (333 chars):
For me something like this is more than enough (108 chars):
Can you change what "kernel" outputs in the system-log or is it hard-coded?!
EDIT: I found some clues in IPTABLES and SkyNet source-code...
Code:
May 15 10:02:56 kernel: [BLOCKED - INBOUND] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=106.225.212.148 DST=xx.xx.xx.xx LEN=60 TOS=0x00 PREC=0x00 TTL=41 ID=8109 DF PROTO=TCP SPT=42618 DPT=6379 SEQ=1262446180 ACK=0 WINDOW=29200 RES=0x00 SYN URGP=0 OPT (0CD7E8640GF3B5A7075EBA490000000005768312) MARK=0x8000000
For me something like this is more than enough (108 chars):
Code:
May 15 10:02:56 kernel: [BLOCKED - INBOUND] SRC=106.225.212.148 DST=xx.xx.xx.xx PROTO=TCP SPT=42618 DPT=6379
Can you change what "kernel" outputs in the system-log or is it hard-coded?!
EDIT: I found some clues in IPTABLES and SkyNet source-code...
Code:
IPSET-rule:
-A logdrop_ip -j LOG --log-prefix "DROP_IP " --log-tcp-sequence --log-tcp-options --log-ip-options
SkyNet:
iptables -t raw -C PREROUTING -i "$iface" -m set ! --match-set Skynet-MasterWL src -m set --match-set Skynet-Master src -j LOG --log-prefix "[BLOCKED - INBOUND] " --log-tcp-sequence --log-tcp-options --log-ip-options 2>/dev/null || fail="${fail}#14 "
iptables -t raw -C PREROUTING -i br+ -m set ! --match-set Skynet-MasterWL dst -m set --match-set Skynet-Master dst -j LOG --log-prefix "[BLOCKED - OUTBOUND] " --log-tcp-sequence --log-tcp-options --log-ip-options 2>/dev/null || fail="${fail}#15 "
Last edited: