WSO2 IS x509 身份验证器位于防火墙后面

问题描述 投票:0回答:1

我们需要哪些选项来配置 WSO2 IS x509Authenticator 以在仅允许 80 和 443 端口的防火墙后面工作?

如果我们这样设置x509 servlet

[custom_transport.x509.properties]
port="8443"
...
[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain:8443/x509-certificate-servlet"

那么我们将无法访问防火墙后面的这个端点。

所以我们为 nginx 配置设置这个位置。

location /x509-certificate-servlet {
    proxy_pass https://<is_server>:8443;

和x509

[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain/x509-certificate-servlet"

x509 成功验证用户身份并重定向到

https://mydomain:8443/commonauth
。由于防火墙屏蔽了 8443 端口,显然无法访问。

我见过类似的主题WSO2 Identity Server X509 Authentication Behind Proxy但它没有详细说明防火墙问题。

github问题上的评论https://github.com/wso2/product-is/issues/17484试图解释x509验证器工作流程。根据我在那里读到的内容,我得出结论,x509 servlet 重定向到它自己的 commonauth 端点,而不是服务器的端点。

因此我们有两个有效的相似端点

https://mydomain/commonauth
https://mydomain:8443/commonauth
。对于这一点,我认为无法通过同一服务器端口上的 nginx 位置进行分隔。因为第二个是不可配置的。

一种解决方案是为 x509 servlet 注册单独的域

[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain-x509/x509-certificate-servlet"
server {
    listen 443 ssl;
    server_name mydomain-x509;
    ssl_verify_client optional_no_ca;
...
    location / {
        proxy_pass https://127.0.0.1:8443;
        proxy_set_header X-SSL-CERT $ssl_client_escaped_cert;
...

但是 x509 servlet 再次重定向到

https://mydomain:8443/commonauth
所以这个方法也行不通。

有可行的解决方案吗?我错过了什么?

wso2 wso2-identity-server
1个回答
0
投票

我最近发表了一篇文章 [1],详细介绍了如何在多节点集群配置中设置 X509 身份验证器,由 NGINX 负责。在我的设置中,我将身份验证器托管在与 WSO2 身份服务器相同的端口上,即端口 9443。您可能会发现此方法有助于解决防火墙问题。您可以尝试一下并告诉我它是否适合您的情况吗?

[1] - https://medium.com/@dhaurapathirana/hosting-x509-certificate-authenticator-with-ssl-termination-in-a-wso2-is-multi-node-cluster-f4337971f6db

© www.soinside.com 2019 - 2024. All rights reserved.