OSSN/OSSN-0035
< OSSN
Horizon Dashboard 未启用 HTTP 严格传输安全 (HSTS)
总结
对于在生产环境或面向互联网的场景中使用 Horizon 的部署者,强烈建议配置 HTTP 严格传输安全 (HSTS)。
受影响的服务 / 软件
Horizon, SSL, TLS, Apache, Nginx
讨论
HTTP 严格传输安全 (HSTS) 强制所有与服务器的通信都通过 SSL 进行。 这可以缓解 SSL-Strip 等攻击的威胁,该攻击会替换线路上的链接,去除 https 前缀,并可能允许攻击者查看线路上的机密信息。
HSTS 可以在 Apache 和 Nginx 中启用,这两种方式是扩展 Horizon 的主要方式。
建议的操作
如果使用 Apache httpd 托管 Horizon,请将以下内容添加到 Apache httpd 配置文件中的相关 'VirtualHost' 条目中
Header add Strict-Transport-Security "max-age=15768000"
我们还建议使用 mod_rewrite 确保所有访问 Horizon 的用户都进入安全页面。 为此,请将以下内容添加到您的 Apache httpd 配置文件中
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
如果使用 Nginx 托管 Horizon,请将以下内容添加到您的 Nginx 配置文件中
add_header Strict-Transport-Security max-age=15768000;
与往常一样,在将其部署到生产环境之前测试这些配置设置,以便捕获任何错误或缺陷。
联系方式 / 参考文献
- 作者:Robert Clark, HP
- 此 OSSN: https://wiki.openstack.org/wiki/OSSN/OSSN-0035
- SSL Strip: http://www.thoughtcrime.org/software/sslstrip
- 原始 LaunchPad Bug: https://bugs.launchpad.net/horizon/+bug/1191050
- OpenStack Security ML:openstack-security@lists.openstack.org
- OpenStack Security Group:https://launchpad.net/~openstack-ossg
- HTTP 严格传输安全: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security