AWS ELK - SAML SSO 在浏览器中有效,但在 iFrame 中无效

AWS ELK - SAML SSO works in browser but not in iFrame

我正在我的应用程序中实现 SSO:

场景:1直接在浏览器中使用Kibana

当我访问时,Kibana URL 例如这样- https://xxx-yyy.eu-central-1.es.amazonaws.com/_plugin/kibana/ 它将我重定向到 keycloak 登录页面。成功登录 keycloak 后,它会重定向到 Kibana,在那里我可以看到分配给我的用户的适当角色(基于我创建的映射)。

到目前为止一切正常!

场景:2 在外部门户中嵌入仪表板

我在 Kibana 中有一个仪表板,我已将其共享为嵌入式 iFrame。 iFrame 代码已添加到我注册为 OPEN ID Connect 客户端的门户中。

当我访问我的门户时,它成功地将我重定向到 Keycloak 的登录页面,并让我对 Keycloak 进行身份验证。当嵌入式 iFrame 获得渲染时,它显示错误 400:错误请求,无效请求 ID

以下请求在 iFrame 中执行失败:

Request URL: https://xxx-yyy.eu-central-1.es.amazonaws.com/_plugin/kibana/_opendistro/_security/saml/acs
Request Method: POST
Status Code: 400 
Remote Address: 54.93.149.42:443
Referrer Policy: strict-origin-when-cross-origin

:authority: xxx-yyy.eu-central-1.es.amazonaws.com
:method: POST
:path: /_plugin/kibana/_opendistro/_security/saml/acs
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: max-age=0
content-type: application/x-www-form-urlencoded
origin: https://keycloakdomain.com
referer: https://keycloakdomain.com/
sec-fetch-dest: iframe
sec-fetch-mode: navigate
sec-fetch-site: cross-site
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56

SAMLResponse: PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2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vc2FtbDpBdXRobkNvbnRleHRDbGFzc1JlZj48L3NhbWw6QXV0aG5Db250ZXh0Pjwvc2FtbDpBdXRoblN0YXRlbWVudD48c2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PHNhbWw6QXR0cmlidXRlIE5hbWU9IktpYmFuYUJhY2tlbmRSb2xlcyIgTmFtZUZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmF0dHJuYW1lLWZvcm1hdDpiYXNpYyI+PHNhbWw6QXR0cmlidXRlVmFsdWUgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4c2k6dHlwZT0ieHM6c3RyaW5nIj4va2V5Y2xvYWstaXNjby1hZG1pbjwvc2FtbDpBdHRyaWJ1dGVWYWx1ZT48L3NhbWw6QXR0cmlidXRlPjwvc2FtbDpBdHRyaWJ1dGVTdGF0ZW1lbnQ+PC9zYW1sOkFzc2VydGlvbj48L3NhbWxwOlJlc3BvbnNlPg==

我已经验证了上面的 SAML 响应,我可以看到响应是正确的。

这是上述请求的 SAML AuthNRequest:

<?xml version="1.0"?>
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="ONELOGIN_3cfebb00-f57a-480b-8d28-ce6da4459aae" Version="2.0" IssueInstant="2021-02-05T08:59:05Z" Destination="https://login.innoveo.com/auth/realms/master/protocol/saml" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="https://search-isco-development-kzxpiyjo7fi5budbovwmocpeoi.eu-central-1.es.amazonaws.com/_plugin/kibana/_opendistro/_security/saml/acs">
  <saml:Issuer>
 https://search-isco-development-kzxpiyjo7fi5budbovwmocpeoi.eu-central-1.es.amazonaws.com
 </saml:Issuer>
  <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" AllowCreate="true"/>
</samlp:AuthnRequest>

问题不在于 ELK 或 SAML 的工作方式,我们发现问题在于称为“SameSiteCookie”的新浏览器安全属性。

默认情况下,现代浏览器不允许跨域共享 cookie,这就是问题所在。

当我在浏览器中手动更改此设置时,一切开始正常工作。

对于 Elastic 版本的 ELK - 有一个名为 - xpack.security.sameSiteCookies 的设置 对于 ELK 的 Open Distro 版本 - 有一个名为 - opendistro_security.cookie.sameSite

的设置

如果您使用的是 AWS ElasticSearch 服务,则无法设置 opendistro_security.cookie.sameSite 这是一个限制,迫使我们移出 AWS ElasticSearch。