将 Apache 配置为 ASP.NET 核心非 SSL 应用程序的 HTTPS 反向代理是否存在安全问题?

Are there security issues configuring Apache as an HTTPS reverse proxy to an ASP.NET Core non-SSL application?

我不确定这是否已准备好用于生产环境。
本质上,我的 public URL (https://*.example.com) 有一个 SSL 证书,但我的 ASP.NET Core 2.1 应用程序(以及仅在端口 5000)从未配置为使用 HTTPS。

在 Apache 中,我配置了一个虚拟主机以将请求从端口 80 重定向到 443,然后另一个用于将端口 443(传入)反向代理到后端的 5000:

# Force usage of https for public requests
<VirtualHost *:80>
        ServerName aspnet01.example.com
        Redirect / https://aspnet01.example.com
</VirtualHost>

<VirtualHost *:443>
        ProxyPreserveHost On
        ProxyPass / http://127.0.0.1:5000/
        ProxyPassReverse / http://127.0.0.1:5000/
        ServerName aspnet01.example.com
        ServerAlias *.example.com
        ErrorLog /opt/bitnami/apache2/logs/aspnet01_error.log
        CustomLog /opt/bitnami/apache2/logs/aspnet01_access.log combined
</VirtualHost>

并且在防火墙上只打开了两个端口,80、443 和 22 用于服务器管理。 我想知道以这种方式发布我的应用程序有什么风险,我相信来自外部的流量是加密的并且没有人在嗅探我的内部网络。

更一般地说,将旧应用程序(不使用 HTTPS)放在反向代理后面是否足以认为它安全?

我在 Ubuntu 16.04 上使用 LAMP。提前致谢。

Kestrel 应用程序的安全性取决于您的反向代理配置和网络,但这通常是处理安全性的可接受方式,因为它减少了 Kestrel 和反向代理之间的网络开销。

根据 Microsoft 的文档:

A reverse proxy:

  • Can limit the exposed public surface area of the apps that it hosts.
  • Provide an additional layer of configuration and defense.
  • Might integrate better with existing infrastructure.
  • Simplify load balancing and secure communication (HTTPS) configuration. Only the reverse proxy server requires an X.509 certificate, and that server can communicate with the app's servers on the internal network using plain HTTP.

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1#when-to-use-kestrel-with-a-reverse-proxy