Neutron安全组API
Wiki地址:https://wiki.openstack.org/wiki/Neutron/SecurityGroups
API扩展
API扩展时代码的"前端"部分,其处理整个工程使用的REST-ful API
的定义。
REST-ful API: https://git.openstack.org/cgit/openstack/neutron/tree/neutron/extensions/securitygroup.py
数据库 API
安全组API扩展添加了一些Neutron中到数据库层的方法.
Agent RPC
这部分代码在工程存储在数据库中之后,处理来自它们的请求。它涉及到所有运行在计算节点的L2代理的消息传递,以及在每个Hypervisor上修改IPTables规则。
-
- SecurityGroupServerRpcMixin - 定义RPC API,插件使用其与运行在计算节点上的agent通信
- SecurityGroupServerRpcMixin - Defines the API methods used to fetch data from the database, in order to return responses to agents via the RPC API
-
- SecurityGroupServerRpcApi 定义可被agent调用的API方法,返回运行在Neutron控制器上的插件
- SecurityGroupAgentRpcCallbackMixin 定义在执行agent调用的动作之后,插件可使用的agent回调方法.
IPTables 驱动程序
-
prepare_port_filter
获取一个port参数, 其为包含port信息及security_group_rules 的 dictionary对象 -
prepare_port_filter
附加port到内部的 dictionary:filtered_ports,其使用来跟踪内部状态 -
每个安全组在IPtables中有一个
chain
. -
IptablesFirewallDriver
具有将安全组规则转换为iptables命令的方法