Bug 2017048 - Security group mode (stateless/stateful) not updated in OVN
Summary: Security group mode (stateless/stateful) not updated in OVN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-neutron
Version: 17.0 (Wallaby)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: beta
: 17.0
Assignee: OSP Team
QA Contact: Eran Kuris
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-25 13:42 UTC by Christophe Fontaine
Modified: 2022-09-21 12:17 UTC (History)
12 users (show)

Fixed In Version: openstack-neutron-18.4.1-0.20220630190835.cbcece5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 12:17:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1952653 0 None None None 2021-11-29 17:53:22 UTC
OpenStack gerrit 816600 0 None master: MERGED neutron: ovn: update ACL actions on stateful field change (Ic4621dfaedb83287845e3336ba846b054230f087) 2022-06-30 21:05:08 UTC
Red Hat Issue Tracker OSP-10543 0 None None None 2021-11-15 12:33:44 UTC
Red Hat Product Errata RHEA-2022:6543 0 None None None 2022-09-21 12:17:36 UTC

Description Christophe Fontaine 2021-10-25 13:42:14 UTC
Description of problem:
When we switch back and forth between stateful to stateless security group, the ACL rules in OVN are not updated.

The new ACL rules are created according to the SG mode though.

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

openstack-neutron-common-15.3.5-2.20210608154815.el8ost.4.noarch
openstack-neutron-15.3.5-2.20210608154815.el8ost.4.noarch
python3-neutron-15.3.5-2.20210608154815.el8ost.4.noarch
openstack-neutron-ml2-15.3.5-2.20210608154815.el8ost.4.noarch

How reproducible:
Always

Steps to Reproduce:
1. The pre created SG is stateful
$  openstack security group show default -c stateful -f value
True

In a controller, we can list the ACLs as "allow-related"
[heat-admin@overcloud-controller-0 ~]$ sudo podman exec -ti ovn_controller ovn-nbctl list ACL

_uuid               : e31f56a6-a373-4f0f-b690-dafd7b964d99
action              : allow-related
direction           : to-lport
external_ids        : {"neutron:security_group_rule_id"="459deec0-a4b2-4c5a-af5d-fe6c66346fef"}
log                 : false
match               : "outport == @pg_26f1270b_efaa_4948_826d_c227e7808ca5 && ip4 && ip4.src == 0.0.0.0/0 && udp"
meter               : []
name                : []
priority            : 1002
severity            : []



2. Switch to stateless SG:
$ openstack security group set --stateless default

Yet, the "list ACL" command shows that the rule still uses conntrack (allow-related).

3. We create a new rule:
openstack security group rule create default --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0


Actual results:

The rules are a mix of allow-related and allow-stateless:

[heat-admin@overcloud-controller-0 ~]$ sudo podman exec -ti ovn_controller ovn-nbctl list ACL


_uuid               : fb970be6-493c-424a-b133-66dcbe3aedee
action              : allow-stateless
direction           : to-lport
external_ids        : {"neutron:security_group_rule_id"="4ef8bc9c-7450-43c5-9878-c01037b72240"}
log                 : false
match               : "outport == @pg_26f1270b_efaa_4948_826d_c227e7808ca5 && ip4 && ip4.src == 0.0.0.0/0 && tcp && tcp.dst == 22"
meter               : []
name                : []
priority            : 1002
severity            : []

_uuid               : 18cc8207-6489-49d9-bb57-31ed04b04726
action              : allow-related
direction           : to-lport
external_ids        : {"neutron:security_group_rule_id"="2698c7f8-176e-4bfb-b6c6-7314272e6dd8"}
log                 : false
match               : "outport == @pg_26f1270b_efaa_4948_826d_c227e7808ca5 && ip4 && ip4.src == 0.0.0.0/0 && tcp"
meter               : []
name                : []
priority            : 1002
severity            : []



Expected results:
All rules should be "allow-stateless" or "allow-related" when we update the security group to stateless or stateful.

Comment 2 Ihar Hrachyshka 2022-04-15 01:32:39 UTC
The feature was is in 17.0+ only, changing version to reflect that.

Comment 12 errata-xmlrpc 2022-09-21 12:17:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543


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