port-security can't be disabled if security groups are not enabled

Bug #1658682 reported by George Shuklin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Armando Migliaccio

Bug Description

If ml2 have settings

[DEFAULT]
extension_drivers = port_security

[securitygroup]
enable_security_group = False

and one is trying to disable port-security on a given port, he/she will fail:

neutron port-update fad58638-3568-4bcb-8742-d857d138056d --port-security-enabled=False

Port has security group associated. Cannot disable port security or ip address until security group is removed
Neutron server returns request_ids: ['req-12cd8a70-88ad-4d2b-bc3c-fcf574b088c4']

At the same time there is no way to use
neutron port-update fad58638-3568-4bcb-8742-d857d138056d --no-security-groups
:
Unrecognized attribute(s) 'security_groups'
Neutron server returns request_ids: ['req-1d2227c6-40a0-41e9-92a3-410168462635'

This cause drastic inconvenience for administrators who run openstack with disabled security groups: to disable port security one ought to disable security group on the same port, and forced to to enable security group on server just to disable security group on the port.

Version: 8.3 (mitaka).

description: updated
tags: added: sg-fw
Revision history for this message
Hirofumi Ichihara (ichihara-hirofumi) wrote :

In the config(enable_security_group = False), neutron doesn't expect users controls security-group by Neutron API. Can you remove security-group by Nova API and disable port-security?

Changed in neutron:
status: New → Incomplete
Revision history for this message
George Shuklin (george-shuklin) wrote :

That's a problem. We need to disable port security on few ports. Neutron rejects requests to disable port security complaining there is an security group in the port (it is invisible in neutron port-show but visible in database). We tried to disable security group and got error.

It is now a rather silly way to disable port security:

enable security groups in neutron-server.
disable security group in port
disable security groups in neutron-server.
disable port-security.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

It sounds like you found an incompatible combination of services that did not rejected: port_security extension and security groups go hand in hand. You can't really have one without the other (and nor it makes sense).

Personally I feel that option enable_security_group has outlived its life, as port_security = False has the same objective, but it's API driver, rather than config-driven.

Changed in neutron:
status: Incomplete → Confirmed
importance: Undecided → Wishlist
tags: added: rfe
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

We should consider deprecating the config option in favor of having the admin disabling port security on a network if he/she does not want packet filtering.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This means we may want to have port_security something that is *not* tunable, but always available in any deployment.

Revision history for this message
George Shuklin (george-shuklin) wrote :

It's perfectly valid case to have installation without security groups but with port security. Port security protects environment from forged traffic from guests, and security groups protects guests from incoming traffic.

For most cases default behavior is fine, but when we want to disable port security for some ports because (regardless of been disabled) there is a default security group on the port we can't remove (because security groups are disabled).

Changed in neutron:
status: Confirmed → Triaged
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

From today's drivers meeting, this is probably something that needs more discussion especially if it may involve potential upgrade issues.

Revision history for this message
Kevin Benton (kevinbenton) wrote :

Since the option still exists and its not deprecated, I think it's good to treat this as a regular bug to allow port security to be disabled when the security groups aren't.

Changed in neutron:
status: Triaged → Confirmed
importance: Wishlist → High
tags: removed: rfe
Changed in neutron:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/466158

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/466427

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/466428

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/newton)

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/466428

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/466158
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=b4687b235fd95d041f419fecda6bc93202699148
Submitter: Jenkins
Branch: master

commit b4687b235fd95d041f419fecda6bc93202699148
Author: Armando Migliaccio <email address hidden>
Date: Thu May 18 19:52:47 2017 -0700

    Allow port security updates even without security-groups enabled

    Port security is useful to enforce anti-spoofing rules, and
    those can operate even in the absence of security groups.

    This patch alters the existing code path to allow port_update
    operations even when the admin disables security_groups from
    the deployment.

    Closes-bug: 1658682

    Change-Id: If1d9a662e362639798ad93ff06d820852b0f0c99

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/466428
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=7cfa85865822f7930e4617c80710f5eb59f5a7a3
Submitter: Jenkins
Branch: stable/newton

commit 7cfa85865822f7930e4617c80710f5eb59f5a7a3
Author: Armando Migliaccio <email address hidden>
Date: Thu May 18 19:52:47 2017 -0700

    Allow port security updates even without security-groups enabled

    Port security is useful to enforce anti-spoofing rules, and
    those can operate even in the absence of security groups.

    This patch alters the existing code path to allow port_update
    operations even when the admin disables security_groups from
    the deployment.

    Closes-bug: 1658682

    (cherry picked from commit e49edd7ec32e302df7db44194076a55fd2b5d309)
    Change-Id: If1d9a662e362639798ad93ff06d820852b0f0c99

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ocata)

Reviewed: https://review.openstack.org/466427
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=dc8ef03d218aae56e4b348d0a2061a781c95c076
Submitter: Jenkins
Branch: stable/ocata

commit dc8ef03d218aae56e4b348d0a2061a781c95c076
Author: Armando Migliaccio <email address hidden>
Date: Thu May 18 19:52:47 2017 -0700

    Allow port security updates even without security-groups enabled

    Port security is useful to enforce anti-spoofing rules, and
    those can operate even in the absence of security groups.

    This patch alters the existing code path to allow port_update
    operations even when the admin disables security_groups from
    the deployment.

    Closes-bug: 1658682

    (cherry picked from commit e49edd7ec32e302df7db44194076a55fd2b5d309)
    Change-Id: If1d9a662e362639798ad93ff06d820852b0f0c99

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.4.0

This issue was fixed in the openstack/neutron 9.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.2

This issue was fixed in the openstack/neutron 10.0.2 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.0.0b2

This issue was fixed in the openstack/neutron 11.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.