We currently have the following rule in the post firewall section of our puppet code:
tripleo::firewall::rule{ '998 log all':
proto => 'all',
jump => 'LOG',
}
The problem is that with this rule we log every single packet which is rather suboptimal:
Jul 10 05:05:03 overcloud-controller-1 kernel: IN=vlan20 OUT= MAC=1a:1a:0a:72:8a:0c:ba:ac:11:55:28:28:08:00 SRC=172.16.2.10 DST=172.16.2.14 LEN=228 TOS=0x00 PREC=0x00 TTL=64 ID=59388 DF PROTO=UDP SPT=43036 DPT=5405 LEN=208
Jul 10 05:05:03 overcloud-controller-1 kernel: IN=vlan20 OUT= MAC=1a:1a:0a:72:8a:0c:ba:ac:11:55:28:28:08:00 SRC=172.16.2.10 DST=172.16.2.14 LEN=228 TOS=0x00 PREC=0x00 TTL=64 ID=59391 DF PROTO=UDP SPT=43036 DPT=5405 LEN=208
Jul 10 05:05:03 overcloud-controller-1 kernel: IN=vlan20 OUT= MAC=1a:1a:0a:72:8a:0c:ba:ac:11:55:28:28:08:00 SRC=172.16.2.10 DST=172.16.2.14 LEN=228 TOS=0x00 PREC=0x00 TTL=64 ID=59392 DF PROTO=UDP SPT=43036 DPT=5405 LEN=208
...
(undercloud) [stack@undercloud stonith-scalingup-issue]$ grep IN=vlan20 sosreport-overcloud-controller-1-20180710070209/var/log/messages |wc -l
8682
Let's start by ratelimiting this to a burst of 15 messages
and 20 messages per minute. According to [1] this means that
we will have 15 messages logged before the 20 messages per minute
limit kicks in.
Let's also add a parameter so that an operator can override this
in case the defaults are not suitable for her/him.
[1] https://netfilter.org/documentation/HOWTO/packet-filtering-HOWTO-7.html
Change-Id: Ie8fe28e582bdcf51b819d5ca7f979b0a21597768
Closes-Bug: #1781171