Web Single Sign On Portal

bp websso-portal

提供用户通过网络浏览器使用现有的 IdP,通过单点登录页面进行身份验证的能力。Keystone 应该能够创建令牌并将其发布回请求者,以支持联合身份验证协议。

由于这是一个跨项目规范,horizon 的蓝图是:bp federated-identity

问题描述

在使用基于密码的身份验证时,Horizon 负责在用户和 Keystone 之间传输共享密钥。密码学安全的身份验证机制可以防止这种情况,因为它会导致各种中间人攻击场景。如果 Horizon 服务器受到损害,它将授予攻击者访问所有登录用户的密码权限。与企业目录结合使用时,这构成重大风险。

正确的流程是 * Horizon 将浏览器重定向到 Keystone * Keystone 重定向到 Discovery Service 或默认 IdP * 用户通过 IdP 特定的机制进行身份验证 * IdP 将浏览器重定向回 Keystone * Keystone 生成 Javascript 代码以将令牌 POST 回 Horizon * Keystone 将用户重定向到 Horizon。

Keystone 服务器需要启用重定向到 IdP,并接受 SAML 断言才能创建令牌。

提议的变更

Horizon 将实现一种选择首选身份验证方法的方式。从技术上讲,用户将被重定向到 Keystone 服务器上的不同路由。Keystone 将实现额外的路由/端点,以允许不同形式的登录。最初这些将是

  • 通过 SAML 进行联合身份验证

  • 通过 OpenID Connect 进行联合身份验证

对于 SAML 和 OpenID Connect,Horizon(或兼容的 WebUI)将重定向到适当的受保护的 Keystone URL(取决于实现方式,/v3/OS-FEDERATION/websso/{protocol}?origin=https%3A//horizon.example.com/v3/auth/websso/{protocol}?origin=https%3A//horizon.example.com)。

重要的是要提到 {protocol} 变量必须注册(并与发出断言的 identity provider 对象绑定)通过 OS-FEDERATION API。

识别要使用的 mapping 的算法

1) Fetch attribute storing identity provider identifier.
2) Fetch identity_provider basing on the previous value (return error
code if no such identity_provider was found).
3) Fetch protocol value from the URL (return error if no such
protocol was found tied to such identity_provider).
4) Fetch mapping id identified by identity_provider and protocol
ids.

执行 HTTP POST 到原始 webUI 的 Javascript。Keystone 将 POST 用户回的 URL 将存储在初始 URL 中。

请注意,Horizon 不会接受 POST 请求,因此处理此部分的函数需要免于 CSRF 错误。

拟议的工作流程在下面的 ASCII 图表中描述。

+----------------+      +----------------+      +----------------+
|                |      |                |      |                |
|    Horizon     |      |    Keystone    |      |Discover Service|
|                |      |                |      |     (IdP)      |
|                |      |                |      |                |
+---^----+----^--+      +--^---+----^---++      +---^-------+----+
    |    |    |            |   |    |   |           |       |
   (1)  (2a) (5b)         (2b)(3a) (4b)(5a)        (3b)    (4a)
    |    |    |            |   |    |   |           |       |
+---+----v----+------------+---v----+---v-----------+-------v----+
|                                                                |
|                          Web Browser                           |
|                                                                |
+----------------------------------------------------------------+

工作流程如下

1) A User with a web browser reaches Horizon

2a) Horizon issues an HTTP 301 Redirect response pointing the user to
the Keystone endpoint.

2b) The browser redirects the user to a Keystone ``websso`` endpoint,
``/auth/OS-FEDERATION/websso/{saml2/oidc}`` which is protected by
saml2 and openid connect Apache plugins respectively.

3a) Since the user doesn't have an active session, the user will be
redirected to their default IdP or Discover Service where an appropriate
IdP can be chosen. Keystone will produce an appropriate <saml2:Request>
request.

3b) The browser sends a <saml2:Request> request and authenticates with the
IdP.  The user also authenticates himself (e.g. with user/password
credentials)

4a) Once authentication is successful, the IdP issues a SAML assertion or
OpenID Connect claim, and redirects user back to the
``/auth/OS-FEDERATION/websso/{protocol}``.

4b) The browser redirect the user back to Keystone again, with the SAML
assertion or OpenID Connect claim.

5a) Keystone issues JavaScript code that executes upon loading by the
browser. The unscoped federated token is included in the HTML form.

5b) The user is being redirected back to the Horizon webpage, with the
unscoped federated token in the request.

备选方案

所有用户界面都可以保存在 Horizon 中,但随后敏感信息会超出 Keystone 服务的范围提供。Horizon 和任何其他 Web UI 需要与 Keystone WebSSO 过程进行深度集成,并且这两个系统将有效地成为一个紧密耦合的系统。

安全影响

描述对系统造成的任何潜在安全影响。需要考虑的一些项目包括

  • 此更改是否涉及敏感数据,例如令牌、密钥或用户数据?

  • 是的,令牌。

  • 此更改是否以可能影响安全性的方式更改了 API,例如访问敏感信息的新方式或登录的新方式?

  • 这是登录 Horizon 的一种新方式。

  • 此更改是否涉及使用或解析用户提供的数据?这可能是直接在 API 级别,或间接例如对缓存层的更改。否。

请注意,为了避免网络钓鱼和其他安全相关攻击(正在传输令牌),Keystone 需要一种机制来注册受信任的 Horizon URL(可能通过 API 或配置设置)。这将确保令牌不会发布回不受信任的方。

通知影响

其他最终用户影响

这主要是一个视觉特性。对 python-keystoneclient 没有影响。

性能影响

其他部署者影响

  • 此功能将基于对 Apache HTTPD 配置文件所做的更改启用。此后,最终部署者无需进行任何其他编辑。

  • 这些更改不应破坏当前的持续部署。

开发人员影响

实现

负责人

主要负责人

其他贡献者

工作项

django_openstack_auth

  • 添加一个新的 WEBSSO_ENABLED 选项

  • 允许用户选择联合身份登录的新按钮

  • 支持单个 IdP 的新设置 * WEBSSO_IDP_URL # IdP 的 SSO 的 URL * WEBSSO_IDP_ID # Keystone Identity provider ID * WEBSSO_PROTOCOL_ID # Keystone 协议 ID

  • 支持使用未限定范围的令牌登录

  • 执行验证令牌调用

keystone

  • 添加新的端点:/v3/auth/websso/{protocol}?origin=https%3A//horizon.example.com/v3/OS-FEDERATION/websso/{protocol}?origin=https%3A//horizon.example.com(分别受 mod_shib、mod_oidc 保护),处理联合身份验证协议(SAML2 或 OpenID Connect)的 websso 请求。

  • 添加逻辑将断言/声明的颁发者与 Keystone 后端中注册的 identity_provider 对象(通过 remote_id 属性)关联起来。

  • 更改中间件以允许响应中包含 HTML。

依赖项

此规范将依赖于 bp idp-id-registration 中交付的工作

文档影响

配置手册必须解释如何设置 Apache 服务器以暴露发现服务

参考资料

CERN 对 Keystone 的补丁支持 WebSSO https://github.com/cernops/keystone/commit/66dabd94b4ad32abca171cef9192210fec289235

CERN 对 Django-Openstack-Auth 的补丁支持 WebSSO https://github.com/cernops/django_openstack_auth/commit/b7e5b28a83a88b259bfaddbd754c70e1bb420447

添加 remote_id 属性到 identity_provider 对象的补丁集 https://review.openstack.org/#/c/142743/

Discovery Service 规范:http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-idp-discovery.pdf