Bug 1297162

Summary: log option does not appear to work with a forward-port rich rule
Product: [Fedora] Fedora Reporter: Sam Varshavchik <mrsam>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jpopelka, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-15 15:59:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sam Varshavchik 2016-01-10 02:06:13 UTC
Description of problem:

The "log" option appears to be completely ignored for the "forward-port" rich rule. There's no error, add-rich-rule succeeds, but a logging iptables rule does not get created.

Version-Release number of selected component (if applicable):

firewalld-0.3.14.2-4.fc23.noarch

How reproducible:

always

Steps to Reproduce:
1. The default rsyslog.conf in fedora logs all *.info messages to /var/log/messages
2. Add a forward-port rule with the "log" option. For example:

firewall-cmd --add-rich-rule 'rule family="ipv4" forward-port port="8369" protocol="tcp" to-port="80" to-addr="192.168.0.2" log level="info" limit value="1/h"'

3. Use telnet, appropriately, to establish a new connection that uses this NAT rule.

Actual results:

Nothing gets logged to /var/log/messages

Expected results:

According to the firewalld.richlanguage man page, I can expect to have the connection logged via syslog:

   Log
           log [prefix="prefix text"] [level="log level"] [limit value="rate/duration"]

       Log new connection attempts to the rule with kernel logging for example
       in syslog. 

Additional info:

Examining what firewalld does with iptables, it doesn't look like there's any iptables LOGGING entry. I see the forward port rule in the nat table, and that's pretty much it.

Comment 1 Thomas Woerner 2016-07-15 15:59:14 UTC
This has been fixed with firewalld version 0.4.1.2.