我想修改一个已部署的Sakai安装,以允许从几个校园媒体服务器的iframes。iframe的一个例子是https://mediaserver.example.edu/p/player.html。在部署的Tomcat中编辑策略文件的最简单方法是什么?
发布于 2014-06-11 18:30:06
反制是一个开源的API和html扫描器,并且更干净。Sakai2.9或更高版本将此作为其安全套件的一部分,以保护用户免受恶意用户创建的标记造成的跨站点脚本攻击。
Sakai包括一组默认的配置,这些配置经过社区测试,很可能满足大多数用户的需求。这些选项包括低安全选项和高安全性选项(high是默认的)。要强制Sakai使用低安全性设置,可以添加Sakai配置属性,如下所示(将此设置为false,默认为高安全性):
content.cleaner.default.low.security=true高和低设置之间的主要区别是屏蔽外部内容的未知站点(如vidoes或iframes)。High只允许有限的受信任站点列表。低允许任何网站的内容。两者都有防止与javascript相关的注入攻击的广泛规则。
Antisamy配置文件是基于XML的(更多细节请参见Antisamy开发者指南 )。标准的高安全性和低安全性文件位于"kernel/sakai-kernel-impl/src/main/resources/antisamy/".下的Sakai源代码中。这些可以用作本地自定义版本的基础。要覆盖包含的文件,只需将自定义版本放在Sakai主目录(通常是TOMCAT_ home /sakai)中,例如:
${sakai.home}/antisamy/high-security-policy.xml
${sakai.home}/antisamy/low-security-policy.xml对于特定的用例,您可能会修改以下部分(接近xml文件的顶部),如注释中所示:
<!-- SAKAI customized trusted sites listing:
This is where we specify what Flash/embed/iframe src to allow
To add a new host/site to this list:
Find this in the flashSites below: ...(download\.macromedia\.com/pub|...
Add in your site (e.g. "new.site.host.com/path": with escaped ".": "new\.site\.host\.com/path|"
Like shown here: (new\.site\.host\.com/path|download\.macromedia\.com/pub|
-->
<regexp name="flashSites" ...https://stackoverflow.com/questions/24169695
复制相似问题