security.txt¶
security.txt 是一个提议的 IETF 标准,旨在允许独立的安全性研究人员轻松报告漏洞。该标准定义了一个名为 security.txt 的文本文件,应位于“/.well-known/security.txt”。为了向后兼容,该文件也可以放置在“/security.txt”。
在 OpenStack-Ansible 中,security.txt 在 HAProxy 中实现,因为所有公共端点都位于其后。它默认会将所有以 /security.txt 结尾的请求路径定向到文本文件,使用 HAProxy 中的 ACL 规则。
启用 security.txt¶
使用以下过程,使用 OpenStack-Ansible 将 security.txt 文件添加到您的部署中
根据标准编写
security.txt文件的内容。在
/etc/openstack_deploy/user_variables.yml文件中,将security.txt的内容定义在变量haproxy_security_txt_content中haproxy_security_txt_content: | # This is my example security.txt file # Please see https://securitytxt.org/ for details of the specification of this file
更新 HAProxy
# openstack-ansible haproxy-install.yml
高级 security.txt ACL¶
在某些情况下,您可能需要更改用于将请求重定向到 security.txt 文件的 HAProxy ACL,例如添加额外的域名。
HAProxy ACL 通过覆盖 haproxy_security_txt_service 内的变量 haproxy_map_entries 来更新。