IPSec Strongswan VPNaaS 驱动程序

https://blueprints.launchpad.net/neutron/+spec/ipsec-strongswan-driver

问题描述

Ubuntu 从 14.04 版本开始在主版本中支持 strongSwan。此驱动程序将为客户提供在 strongSwan 上运行的选择。

提议的变更

strongSwan 驱动程序与 openswan 驱动程序非常相似,除了它们的配置文件有很大的不同。

因此,目前实现的方法是

  • 基于 openswan_opts 创建一个 strongswan_opts。

  • 提供不同的配置文件模板。

  • 在文件 neutron/services/vpn/device_drivers/ipsec.py 中基于 OpenSwanProcess 创建一个 StrongSwanProcess 类(openswan 使用 pluto 和 whack,而 strongSwan 分别使用 ‘charon’ 和 ‘stroke’)。

  • IPsecDriver._update_nat 看起来它为 strongSwan 设置了正确的 iptables ipsec 所需的规则。

数据模型影响

无。

REST API 影响

最新的 strongSwan 5.x 版本与之前的版本具有不同的属性。例如,5.x 版本放弃了一些配置,如 plutostart、nat_traversal、virtual_private、pfs 等,并且一些配置也具有默认值,如 strictpolicy=no、charonstart=yes。

OpenSwan 与 strongSwan 5.x 的早期版本更相似,但与 strongSwan 5.x 不相似。最初的努力仅支持 5.x 并实现一个基于链接 [5] 中推荐配置的等效 psk 网间 VPN 服务,就像 openswan 过去所做的那样。未来的蓝图将扩展 strongSwan 的其他功能,如 API、认证模式、roadwarrior-to-net 等。

因此,此 strongSwan 驱动程序的初始实现提供的功能与 openSwan 驱动程序 [6] 相同

  • 连接两个私有网络的网间私有网络。

  • 每个租户可以进行多个 VPN 连接。

但参数略有不同,例如

  • 仅支持 IKEv2 策略,不支持 IKEv1。

  • 现在仅支持默认的 IPSec 策略和 DPD,未来的蓝图将扩展更多认证模式和更多加密算法。

因此,资源 API(服务、ikepolicy、ipsecpolicy、ipsec-site-connection)也将进行相应的代码调整。

安全影响

无。

通知影响

无。

其他最终用户影响

用户需要配置 strongSwan 驱动程序的 INI 文件。

性能影响

对 VPNaaS 性能没有影响。

IPv6 影响

其他部署者影响

无。

开发人员影响

无。

社区影响

无。

备选方案

其他替代方案将缺乏社区支持。

实现

负责人

主要负责人

张华 <joshua.zhang@canonical.com>

工作项

  • StrongSwanProcess 代码位于 neutron/services/vpn/device_drivers/ipsec.py 中

  • 制定最佳实践的配置文件

  • 单元测试和高级服务测试

  • 一个 netns 包装器,以支持在不同的命名空间中运行 strongSwan。

  • 更新 API 文档以反映 strongSwan 的功能。

  • 更新用户文档以指示如何使用 strongSwan 选项。

依赖项

测试

  • 单元测试

  • 高级服务测试

  • 功能测试

Tempest 测试

不适用。使用高级服务测试来覆盖。

功能测试

将添加新的 neutron 功能测试来覆盖以下场景。

  • 创建一个名为 test_vpnagent_create_process 的新功能测试

  • 覆盖配置项 vpn_device_driver= neutron.services.vpn.device_drivers.ipsec.StrongSwanDriver

  • 然后调用 create_process 方法来检查是否已启动 ipsec 进程,并且是否已正确创建 strongSwan 配置文件。

API 测试

不适用。

文档影响

用户文档

默认的 vpn_device_driver 仍然是 openSwan,因此需要在文件 /etc/neutron/vpn_agent.ini 中更新 vpn_device_driver 以使用 strongSwan,除了安装 strongSwan 包。 vpn_device_driver=neutron.services.vpn.device_drivers.ipsec.StrongSwanDriver

上述 API 文档也应在此努力中进行更新。

开发人员文档

无。

参考资料