【发布时间】:2020-08-08 13:19:51
【问题描述】:
在生产环境中禁用 HTTP TRACE 和 TRACK 方法是一种安全最佳做法。在基于 Apache2 的 Elastic Beanstalk 部署(例如 Python)中执行此操作的最佳方法是什么?
【问题讨论】:
标签: amazon-web-services apache amazon-elastic-beanstalk
在生产环境中禁用 HTTP TRACE 和 TRACK 方法是一种安全最佳做法。在基于 Apache2 的 Elastic Beanstalk 部署(例如 Python)中执行此操作的最佳方法是什么?
【问题讨论】:
标签: amazon-web-services apache amazon-elastic-beanstalk
设置TraceEnable Off (as suggested here) 只会禁用 TRACE 而不是 TRACK。您需要对 TRACK 请求使用重写引擎。
将以下内容添加到.ebextensions 中的一个.config 文件中:
files:
"/etc/httpd/conf.d/disable_trace_track.conf":
mode: "000644"
owner: root
group: root
content: |
TraceEnable Off
RewriteEngine on
<If "%{REQUEST_METHOD} == 'TRACK'">
RewriteRule .* - [F]
</If>
【讨论】: