[openstack-dev] how to set default security group rules?

Paul Schlacter wlfightup at gmail.com
Fri Jun 9 07:18:59 UTC 2017


The following is the code, there is no configuration item to configure the
default rules

for ethertype in ext_sg.sg_supported_ethertypes:
                if default_sg:
                    # Allow intercommunication
                    ingress_rule = sg_models.SecurityGroupRule(
                        id=uuidutils.generate_uuid(), tenant_id=tenant_id,
                        security_group=security_group_db,
                        direction='ingress',
                        ethertype=ethertype,
                        source_group=security_group_db)
                    context.session.add(ingress_rule)

                egress_rule = sg_models.SecurityGroupRule(
                    id=uuidutils.generate_uuid(), tenant_id=tenant_id,
                    security_group=security_group_db,
                    direction='egress',
                    ethertype=ethertype)
                context.session.add(egress_rule)

On Fri, Jun 9, 2017 at 3:16 PM, Paul Schlacter <wlfightup at gmail.com> wrote:

>     I see the neutron code, which added the default rules to write very
> rigid, only for ipv4 ipv6 plus two rules. What if I want to customize the
> default rules?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170609/14a79de7/attachment.html>


More information about the OpenStack-dev mailing list