Bug 606889 - Fix enforcement of direction of traffic for rules describing incoming traffic
Fix enforcement of direction of traffic for rules describing incoming traffic
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-22 12:42 EDT by Stefan Berger
Modified: 2010-11-11 09:50 EST (History)
7 users (show)

See Also:
Fixed In Version: libvirt-0_8_1-12_el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-11-11 09:50:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stefan Berger 2010-06-22 12:42:32 EDT
Description of problem:

The below patches fix a network filtering / security problem due to network traffic filtering rules not enforcing the direction in which for example a TCP connection is established; also give user control over the enforcement of the direction of the traffic by adding a new attribute to the XML.


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

libvirt-0.8.1-9.el6

Steps to Reproduce:
1. Create an nwfilter containing the following XML fragment:

  [...]
   <rule action='accept' direction='in' priority='500'>
      <tcp dstportstart='22'/>
   </rule>
  [...]

2. Create a VM referencing the nwfilter with above fragment
3. Start the VM
  
Actual results:

A filtering rule for the above will created that looks like this if dumped using iptables -L -n:

[...]
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22
[...]


Expected results:

The rule that we would like to have would be this one here:

[...]
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22 state NEW,ESTABLISHED
[...]

Additional info:

Please add the following two patches in the order shown below -- both apply cleanly to recent -9.

ID                                      ,proposed patch name

2dce970162b3e45c796dfab9da8490c7b18b4533,libvirt-0.8.1-nwfilter-state-match-on-incoming-traffic.patch
51d3fb02768bb10fbba70e9c4466456c0488ced6,libvirt-0.8.1-nwfilter-xml-attribute-for-state-match.patch

[ git log -p -n 1 ${id} > ${patch} ]
Comment 2 RHEL Product and Program Management 2010-06-22 13:13:24 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 5 Dave Allan 2010-06-29 22:13:43 EDT
libvirt-0_8_1-12_el6 has been built in RHEL-6-candidate with the fix.

Dave
Comment 6 dyuan 2010-07-01 05:17:46 EDT
Verified PASSED with libvirt-0.8.1-13.el6.

# cat filter.xml 
<filter name='filter'>
  <rule action='accept' direction='in' priority='500'>
    <tcp dstportstart='22'/>
  </rule>
  </filter>

start VM referencing the nwfilter with above fragment

# iptables -L -n

[...]
Chain FI-vnet0 (1 references)
target     prot opt source               destination         
RETURN     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp spt:22 state ESTABLISHED 

Chain FO-vnet0 (1 references)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:22 state NEW,ESTABLISHED 
[...]
Comment 7 releng-rhel@redhat.com 2010-11-11 09:50:54 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.