Neutron/FWaaS/FWaaS-ServiceGroup
在 FWaaS 中,管理员可以使用端口范围和协议在防火墙规则中定义流量类型。但我们没有灵活的方式允许用户在同一规则中指定多种流量类型。为了支持不同的流量类型,具有相同的源地址、目标地址和动作,需要创建不同的规则。这使得定义防火墙规则的过程难以扩展,因此需要一个新的 FWaaS 扩展
with two resources service_group and service_object are added.
可以配置多个服务组和服务对象,以允许流量的灵活性和分组。服务对象被分组到服务组中,可以从其他 OpenStack 模块(例如防火墙规则、安全组等)引用。目前防火墙规则具有多个服务组,允许用户定义自己的组并使用它们,而不会影响其他用户。每个服务对象都可以定义一个超时值,该值可用于覆盖默认会话空闲超时值。
FWaaS SVG 测试
要设置防火墙和详细信息,请遵循防火墙测试页面 <https://wiki.openstack.org/wiki/Quantum/FWaaS/Testing> 列出了促进符合当前参考模型的的数据路径配置的命令
(neutron) service-group-create sgc Created a new service_group: +-----------------+--------------------------------------+ | Field | Value | +-----------------+--------------------------------------+ | description | | | id | 7bac1b2b-3c22-48da-b133-e295c8901de0 | | name | sgc | | service_objects | | | tenant_id | 3e7d8af46b474c239852105b2091259e | +-----------------+--------------------------------------+
(neutron) service-object-create --protocol tcp --source-port-range 10000:20000 soc sgc Created a new service_object: +------------------+--------------------------------------+ | Field | Value | +------------------+--------------------------------------+ | destination_port | | | icmp_code | | | icmp_type | | | id | 5a747451-7896-4d2b-90b3-d667b5306c5f | | name | soc | | protocol | tcp | | source_port | 10000:20000 | | tenant_id | 3e7d8af46b474c239852105b2091259e | | timeout | 0 | +------------------+--------------------------------------+
(neutron) firewall-rule-create --service-group sgc --service-group sgc1 --action allow Created a new firewall_rule: +------------------------+--------------------------------------+ | Field | Value | +------------------------+--------------------------------------+ | action | allow | | description | | | destination_ip_address | | | destination_port | | | enabled | True | | firewall_policy_id | | | id | 7a8423bc-dcfc-4460-b423-2420437b89bf | | ip_version | 4 | | name | | | position | | | protocol | | | shared | False | | source_ip_address | | | source_port | | | tenant_id | 3e7d8af46b474c239852105b2091259e | +------------------------+--------------------------------------+
Tempest 测试
Neutron API 测试
从 Neutron 的不同 API 测试的单独运行开始
仅使用 nosetests 以如下方式单独运行测试
/opt/stack/tempest$ nosetests tempest.api.network.test_service_groups.py