orba / module-csp
0.1.0
2020-05-25 09:16 UTC
Requires
- php: ~7.1.3||~7.2.0||~7.3.0
- magento/framework: 102.0.*
- magento/module-backend: 101.0.*
- magento/module-config: 101.1.*
- magento/module-csp: 100.3.*
This package is auto-updated.
Last update: 2023-06-07 10:59:23 UTC
README
此模块在以下方面扩展了 Magento_Csp:
- 允许将 CSP 违规报告保存到日志文件中
- 添加缺失的 CSP 规则
它在不损害安全性的情况下改进了 Magento CSP 框架。
由于使用了 CSP 违规报告记录器,因此您不需要外部服务进行报告。
CSP 违规报告
如果启用配置 安全 > Orba CSP > 一般配置 > 使用内置报告
并且在 csp_whitelist.xml
中未指定 report-uri
,则 CSP 违规报告将被发送到端点 /csp/report/
并保存在 var/log/csp.log
。
注意:此功能仅在您未在 csp_whitelist.xml
中指定不同的 report-uri
时才有效,否则将被忽略。
可以通过 商店 > 配置 > 安全 > Orba CSP > 一般配置
中的链接下载日志文件。
附加 CSP 规则
该模块将额外的资源(如 fonts.googleapis.com
和 www.google.com/recaptcha/
)列入白名单。
安装
composer require orba/module-csp
bin/magento module:enable Orba_Csp
bin/magento setup:upgrade
配置
安全 > Orba CSP > 一般配置 > 使用内置报告
- 如果启用且在 csp_whitelist.xml
中未指定 report-uri
,则 CSP 违规报告将被发送到端点 /csp/report/
并保存到日志文件中。