Aspnetcore: 考虑将 .NET 程序集的 URL 更改为不以 .dll 结尾

创建于 2018-02-27  ·  104评论  ·  资料来源: dotnet/aspnetcore

我想在https://blazor-demo.github.io/上查看演示,我的公司防火墙阻止MicroApp.dll ,而其他 dll 下载成功。 由于很多软件都对下载/传输 Windows 二进制文件持偏执态度,也许值得对它们进行一些混淆? 或者,至少,重命名?

Components Big Rock area-blazor blazor-wasm enhancement

最有用的评论

YourAssembly.blazor怎么样? 如果任何网络开发人员查看开发工具以了解网站的构建方式,这可能是推广项目的好方法(非常非常轻微)? 或者也许只是我有时会发现一个网站是用 Vue.js 或其他什么东西构建的,并认为“哦,不错”:)

所有104条评论

这很有趣 - 感谢您让我们知道。 我们将考虑将 URL 更改为YourAssembly_dll或类似的东西,尽管我们是否默认这样做可能取决于我们是否获得更多关于此的报告,以及我们是否可以确定它是由于名称或更深检查有效载荷内容。

@SteveSandersonMS只是把我的 2c 放在这里。 遭受.dll-fobia影响的不仅仅是企业防火墙。 一些本地防病毒软件也有同样的问题。

@galvesribeiro是对的,更不用说如果我不熟悉发生的事情并且我看到一个网站试图下载一个 DLL,我就会离开那里! 在解决这个问题时考虑一下人们的看法:)

@joeizy是的,我完全同意你的观点,在大多数情况下阻止 dll 是正确的做法。 这就是为什么我们正在谈论重命名它,因为我们确定我们在做什么......

YourAssembly.blazor怎么样? 如果任何网络开发人员查看开发工具以了解网站的构建方式,这可能是推广项目的好方法(非常非常轻微)? 或者也许只是我有时会发现一个网站是用 Vue.js 或其他什么东西构建的,并认为“哦,不错”:)

简单的.bin怎么样?

我也喜欢 .bin 或 .blazor。

+1 “.bin”

.lib 或 .bin 或 .ilasm ?

所以我们可以对此做出明智的决定,如果我们有近似的重现步骤(或者至少在那个方向上有一些提示),那真的很有帮助。 例如,我们需要具体了解它是命名问题还是内容问题。

已知哪些特定的防火墙产品可以阻止.dll ,无论是默认情况下还是在通用配置中? 你能指出我可以安装和试用的东西吗? 或者如果没有,您是否至少知道它的名称,并且可能链接到它的任何配置文档?

@SteveSandersonMS我认为这不是一个特定的产品。 多种产品,特别是企业大量使用的产品,对文件类型进行了潮配置设置,特别是常见的如.exe、.dll、.so等。

该名称本身是第一个阻止程序,但是,_reduce_ 这个问题的一种方式,与自 .Net 2.0 以来我们处理 ClickOnce 的方式相同。 签署程序集。

问题是(1)它并不便宜,(2)即使您负担得起,获得这些证书的过程也非常复杂,甚至在某些国家/地区甚至无法获得,即使您获得了它,(3)证书公司/开发商通常需要一段时间才能被防病毒软件数据库“信任”。

对于 MSFT 发布的程序集,这并不是什么大新闻,因为我们知道每个发布的程序集,甚至是 OSS 的程序集,都是由 corpnet 策略签名的代码。 但想想其他开发人员、初创公司和 OSS 项目。 他们都会因此而受苦。

我记得在 Silverlight 流行的过去,如果我们想按需下载程序集,我们会将它们放在一个 xap 文件中(实际上是一个 zip 文件),然后使用
https://msdn.microsoft.com/en-us/library/cc190632 (v=vs.95).aspx

不确定是否有原因(除了将多个 dll 组合在一个文件中)。 我猜 Silverlight 团队应该熟悉防火墙问题(如果有的话)。

捆绑在一起的问题是,如果您需要更新其中 1 个 dll,则必须更新整个包...... Silverlight 模型对缓存或带宽不友好......

我不建议对 Blazor 使用捆绑。 我只是说,除了捆绑功能之外,也许 Silverlight 团队正在使用 xap 文件来避免防火墙问题。 当然,这只是一个猜测。

保留“.net”作为扩展名

我们现在已经进入了自行车脱落的领域。 因此,我特别要求提供有此问题的实际防火墙产品的具体示例

我认为它不是一个特定的产品

尽管如此,特定产品的示例以及发生这种情况的配置会有所帮助。

@SteveSandersonMS我理解那部分。 关键是修复一个特定的防病毒/防火墙的问题不会涵盖所有其他的,因为我们都知道每个都有自己的启发式、数据库、设置。 唯一可以涵盖所有内容的命名和签名规则的情况是:

  1. 像往常一样签署大会,并且;
  2. 确保命名不在_default_黑名单中

@SteveSandersonMS我在使用 ESET 的 NOD32 时看到了一些问题,并且看到活动扫描仪阻止了一些二进制文件的静默下载,从表面上看,这些似乎是没有数字签名的动态链接库。

感谢@grahamehorner 的信息。 你知道大致的复制步骤是什么吗? 如果我刚刚将 NOD32 安装到(一次性)Windows 机器上,是否足以使其无法打开https://blazor-demo.github.io/? 或者是否需要任何额外的配置?

来自https://www.paloaltonetworks.com/documentation/80/pan-os/pan-os/threat-prevention/set-up-file-blocking

文件阻止配置文件允许您识别要阻止或监控的特定文件类型。 对于大多数流量(包括内部网络上的流量),您将希望阻止已知携带威胁或没有实际上传/下载用例的文件。 目前,这些文件包括批处理文件、DLL、Java 类文件、帮助文件、Windows 快捷方式 (.lnk) 和 BitTorrent 文件。

@SteveSandersonMS我正在等待与远程管理 NOD32 的 IT 管理团队会面,它的配置是为了找出他们更改/自定义的内容(如果有的话),因为我还收到了来自 NOD32 系统的自动电子邮件,说明我下载/安装不受信任的软件可能违反了公司的安全政策。 当我发现或有其他信息时,我会回复。

我想知道如果 .dll 被打包成 .nupkg 并在下载后由 blazor 解包/加载,它们是否会/会被阻止?

目前,这些文件包括批处理文件、DLL、Java 类文件、帮助文件、Windows 快捷方式 (.lnk) 和 BitTorrent 文件。

这就是我要说的......无论产品如何,这都是常规(通常不基于 IT)公司的任何 IT 管理员将阻止的文件类型的_default_列表......

顺便说一句,如果 WPF 团队中有人使用 .xap,他们可以清楚地告诉任何人他们在当天发布“浏览器中的 WPF”时所面临的问题并面临_exactly_ 同样的问题。

_all_ 防病毒软件开始_信任_该扩展程序需要一段时间。

我遇到过同样的问题。 在公司网络内测试样本。 一个 DLL 文件被报告为被阻止。 这基本上使得无法向同事演示。 让 DLL 文件被解除阻塞可能是一个非首发。

查看官方约定页面...
http://webassembly.github.io/spec/core/binary/conventions.html

包含二进制格式的 WebAssembly 模块的文件的推荐扩展名是“.wasm”,推荐的媒体类型是“application/wasm”。

所以看起来要做的第一件事就是将文件重命名为 .wasm,如果它们仍然被阻止,则需要解除防火墙的阻止。

我不认为将文件重命名为.wasm是一个好主意。 DLL 不是 Wasm 模块,它们是(当前)由 Mono Wasm 运行时解释的 .NET 程序集(阅读更多)。 只有 Mono 运行时是 Wasm 模块。 但是,由于防火墙,尤其是在企业场景中,我也投票支持将 DLL 重命名为其他名称。

当我尝试访问https://blazor-realworld.azurewebsites.net/时,防病毒 AVG 版本 18.1.3044 也阻止了 DLL 文件

我不认为将文件重命名为 .wasm 是一个好主意。 DLL 不是 Wasm 模块,它们是(当前)由 Mono Wasm 运行时解释的 .NET 程序集(阅读更多)。 只有 Mono 运行时是 Wasm 模块。

问题在于“其他”扩展将是什么,因为现有扩展都不适用(直接在浏览器沙箱中解释的 .NET MSIL 有效负载是一个全新的安全概念),而公司防火墙已经允许使用 wasm。

从安全的角度来看,.xap 的处理可能不是一个很好的参考,因为它绕过了与 wasm 不同的浏览器安全沙箱。

是的,DLL 文件包含 MSIL,因此在技术上是正确的,它们不是严格的二进制 wasm。 但它们之所以被命名为 DLL,是因为它们是以本地 Win32 DLL 命名的,尽管它们只是共享 PE 格式的一个片段,并且无论如何在内部大多是不同的。 同样,wasm 是 Webassembly 的“本机”库格式,出于同样的原因,将托管库命名为DLL:s是有意义的(即使它们在内部与本机 DLL:s 完全不同),它也有意义将它们命名为wasm。 从安全角度来看,DLL 意味着“本地执行”,而 wasm 意味着“浏览器执行”。 为了符合 wasm 格式,也许 .NET 程序集可以作为数据嵌入,以使其成为具有魔术初始字符串的有效 wasm 等。

这里的想法是有一个类比:wasm 之于 MSIL 就像 PE 之于 MSIL:一种包装容器格式。 先例:

https://docs.microsoft.com/en-us/dotnet/standard/assembly-format

.NET 二进制格式基于 Windows PE 文件格式。 事实上,.NET 类库是符合 Windows PE 的,乍一看似乎是 Windows 动态链接库 (DLL) 或应用程序可执行文件 (EXE)。 这在 Windows 上是一个非常有用的特性,它们可以伪装成本机可执行二进制文件并获得一些相同的处理(例如,操作系统加载、PE 工具)。

如果 Blazor 模型不能 100% 地与现有防火墙配合使用,那么它几乎是一个表演障碍。 它应该像 Javascript 一样毫不费力地通过所有防火墙。 如果我是防火墙管理员,我不确定是否要为每种具有自己的 IL 格式的新语言添加一个新的白名单条目。

如果 Blazor 模型不能 100% 地与现有防火墙配合使用,那么它几乎是一个表演障碍。

@SteveSandersonMS抱歉,如果您以前回答过这个问题,但您认为这是可以解决的吗?

当然! 我们将根据需要更改 URL 或内容格式。

如果这可以优先考虑下一个里程碑,那就太好了。 真的会减轻人们的担忧,即由于潜在的公司安全障碍,它会成为阻碍

@JonnyGibson正如史蒂夫之前提到的,我们确实计划解决这个问题,但本着 Blazor 是一个实验项目的精神,我们现在正在优先考虑那些不太为人所知的工作。 我们很确定我们知道如何解决这个问题。

这是另一个例子:
blazor antivirus

也许一个解决方案是让开发人员定义应用程序的扩展,直到防火墙和 AV 在白名单中添加对决定的任何扩展的支持。

关于我之前关于让开发人员定义扩展的评论,这也将允许开发人员创建具有不同扩展的应用程序来测试防火墙和防病毒行为。

@jonparker @torhovland在我看来,与定义可能会或可能不会被阻止的扩展相反,我们需要找到一种方法来确保它永远不会被阻止。 没有人会使用会导致网站在某些(很可能)情况下被阻止的框架。

删除扩展的想法似乎是合理的,应该尽快尝试。 我还没有看到任何其他问题与成为一个展示者一样接近。

删除扩展的想法似乎是合理的,应该尽快尝试。

为了让我们测试任何修复,我们需要能够重现或至少调查尽可能多的有问题的环境。 为了帮助我们解决此问题,请继续提供有关您遇到 Blazor 应用程序被阻止问题的环境的详细信息。 感谢所有已经报道过此事的人!

我还没有看到任何其他问题与成为一个展示者一样接近。

从长远来看,我们并不太关心这个问题。 我们非常有信心通过某种形式的应用程序打包或应用程序转换来处理这个问题。 但是,在我们获得更多关于具体问题的数据之前,我们将推迟设计解决方案。

WebSense 是我的公司网络用来控制 Web 访问的工具。 我很确定阻止 Blazor 的问题只是他们明确的可执行文件下载阻止。
https://www.websense.com/content/support/library/web/hosted/admin_guide/exten_block.aspx

看起来 AVG 阻止了我的 blazor 项目。 https://files.gitter.im/aspnet/Blazor/Oc8w/image.png
blazor antivirus

我可以确认我也有过 AVG 阻止我的网站的经验。 我的朋友在不禁用 AVG 的情况下无法访问该网站。 据我所知,他使用了默认的防病毒设置。

DLL 扩展没有问题...随着 AOT 编译的进行,DLL 将不会被分发,因为我知道 DLL 用于更快的开发循环。 不要花时间在这上面,让 AOT 工作,这就是目标。

一口井……#897 是重复的。

这是我的错误
image

也许我们可以将扩展设置为 UpdateIndex 中的参数,我们可以从命令行获取它(默认为“dll”): https ://github.com/aspnet/Blazor/blob/dev/src/Microsoft.AspNetCore.Blazor

如果我就此发送 PR,是否会考虑?

请解决这个问题,它是唯一阻止我在企业中测试的项目。

如果您将 IIS 与 rewrite url 模块一起使用,则快速修复建议:

  • 您可以通过 .wasmnet 或任何东西在输出中更改所有“.*.dll 文件。他将编辑脚本标签的内容(https://docs.microsoft.com/en-us/iis/extensions/url-rewrite -module/creating-outbound-rules-for-url-rewrite-module)
  • 将此扩展名重写为 dll,以便将好的文件发送到浏览器(或在部署后重命名 dll 文件)

您也许可以使用 .net core https://docs.microsoft.com/fr-fr/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-2.1&tabs=aspnetcore2x来做到这一点

只是另一个想法:我注意到这些防火墙和安全产品中的大多数都不会阻止 .zip 文件。 事实上,很多时候当我试图下载一个我在某些公司网络上被阻止的 .dll 文件时,我注意到同一文件的 .zip 版本几乎总是会通过阻止。

所以我们可以简单地将 MyLib.dll 打包为 MyLib.zip(在 zip 中包含一个 MyLib.dll 文件)。 问题在于,与使用 .NET 程序集解压缩压缩存档内容的 WASM/MONO 相比,浏览器本身解压缩文件内容的速度会更快。 解压缩至少会减速 2 到 3 倍。

但是有一个解决方案:我们可以将 MyLib.dll 文件打包为 MyLib.zip 并使用零压缩,然后将其留给 Web 服务器来压缩文件(使用客户端浏览器在请求文件时支持的任何压缩格式)。 当浏览器下载该文件时,它会在访问 Mono/WebAssembly 之前本机解压缩接收到的内容。 因此,Mono 运行时只需要解压缩 .zip 文件(此时它是原始未压缩的 zip 存档)。

我希望没有人被上述内容混淆。 我只是建议我们使用 .zip 作为未压缩的容器格式; 然后让 Web 浏览器和 Web 服务器以它们通常对任何请求文件的方式处理压缩和解压缩。 举一个具体的例子:

  1. 2 MB mscorlib.dll 被压缩成 2 MB mscorlib.zip(注意我们将压缩设置为 NONE)。
  2. Web 浏览器请求 mscorlib.zip(发送支持压缩方法的常用 Accept-Encoding 标头)。
  3. Web 服务器将 mscorlib.zip 的内容压缩到 700 MB 并将其发送到服务器,因此包大小与现在相同)
  4. Web 浏览器(Chrome 或 Edge 等)本机解压缩内容,Mono 运行时将接收原始的 2 MB mscorlib.zip 文件,WASM Mono 可以非常快地将其解压为原始 .dll,因为没有使用任何内部压缩那个原始的 zip 存档。

因此,这只是包含在存储桶中的另一个建议。 我对其他想法的想法建议:

  • 我希望仅删除扩展名就足够了,因为 MyLib.dll 变成了 MyLib 或更早的 MyLib_dll 建议。
  • 我也同意应该可以将程序集“打包”为 .wasm 文件中的数据(但内部仍为 IL 格式),就像 .NET 程序集使用 PE 格式并以 .dll 作为扩展名一样。 所以我们可以有一个 MyLib.wasm,它在内部将 IL 存储为数据。 我在这里看到的唯一缺点是,当我们进行真正的 AOT 编译时,可能很难直观地判断 .wasm 文件是包含 IL 还是本机 (WASM) 编译的代码。

.dll将是正确的扩展名,应保留为默认值。 通过将扩展名更改为.zip来隐藏文件的意图并不是最佳解决方案,因为它会产生混淆。 完全不使用扩展名并将文件命名为somedllname_v1_0_0_4321_ab5e8d5b97d141aca3c54776e82d2355可能会更好
(即项目名称、文件版本和 SHA-256 哈希)

一个更大的问题是,当前的 AV 扫描仪(启发式地)检测获取额外代码的例程。 在 AV 供应商做出调整以支持.wasm之前,该问题没有真正的解决方案。 所以最好联系 AV 供应商并将其报告为错误,以便他们修复它。

我 100% 同意 @MovGP0。 AV 供应商必须更新他们的软件。 他们使用不同的算法来检测恶意代码,这些算法必须足够聪明才能阻止病毒并允许合法软件使用。 我相信每个现代 AV 扫描仪都会检查每个存档、zip、7z、rar 等的内容。更改文件扩展名或伪打包不是一个长期的解决方案。

这是一个问题似乎很愚蠢,因为阻塞是由于遗留原因。 Blazor for DLL 有两种情况:

  1. 在浏览器中运行解释的 IL 代码:在这种情况下,DLL 中的 IL 代码只是原始数据,并且不会比浏览器正在处理的 JPG 或 XML 文件更具威胁性。 这是因为下载的 IL 正在被完全解释。 安全产品与此无关,与网站正在处理的任何 GIF、XML 或 TXT 文件无关。

或(将来)

  1. IL 代码将 AOT 编译为 .wasm。 在这种情况下,IL 代码会生成 .WASM,唯一的问题应该是这些安全产品如何处理 .wasm 文件。

关于“打包”的另一点是,这正是许多 javascript 框架已经为减少对服务器的请求所做的事情:让一些服务器端脚本动态地将多个单独的脚本文件合并到一个文件中。 我个人希望看到一些智能服务器端处理程序可以动态组合 20 个小型 (5k) DLL 以减少初始服务器请求,并让我作为开发人员在页面加载期间有选择地对其进行一些控制。

但我认为 Blazor 团队现在已经收到了我们的反馈,并且会做任何明智的事情和/或提供选择。

我要指出,我们必须等到每个人都更新他们的安全产品的观点是行不通的,因为不仅仅是产品,现有的大公司也不会真正对其网络基础设施进行配置更改。 这将真正损害 Blazor 的使用,因为它不仅仅是关于 AV 扫描仪,它还试图告诉新闻集团或必和必拓等大公司的 IT 部门的员工进行网络配置更改。 文化正在发生变化,但如果这会导致 Blazor 问题,这些部门中仍有许多员工根本不会在意(或会积极微笑)☹。

  • 我相信每个现代 AV 扫描仪都会检查每个存档、zip、7z、rar 等的内容。
    我在过去十年中的个人经验是,在 .zip 格式中,通常一切都很好。 如果文件是 .exe 或 .dll,事情通常会被阻止。 在 zip 存档中,大多数产品只有在检测到 zip 存档中实际已知的恶意软件签名时才会阻止 zip 文件(不仅仅是因为里面有一个 .dll)。 但我承认每种产品都是不同的,所以这里没有任何保证。
    来自:Andrzej-W [email protected]
    发送:2018 年 6 月 6 日,星期三 5:38 AM
    收件人:aspnet/Blazor [email protected]
    抄送:jiggyswift [email protected] ; 评论[email protected]
    主题:回复:[aspnet/Blazor] 考虑将 .NET 程序集的 URL 更改为不以 .dll 结尾(#172)

我 100% 同意 @MovGP0 https://github.com/MovGP0 。 AV 供应商必须更新他们的软件。 他们使用不同的算法来检测恶意代码,这些算法必须足够聪明才能阻止病毒并允许合法软件使用。 我相信每个现代 AV 扫描仪都会检查每个存档、zip、7z、rar 等的内容。更改文件扩展名或伪打包不是一个长期的解决方案。


您收到此消息是因为您发表了评论。
直接回复此邮件,在 GitHub 上查看https://github.com/aspnet/Blazor/issues/172#issuecomment-394834055 ,或将帖子静音https://github.com/notifications/unsubscribe-auth/AmF6aIkiXWAVe282A0YSh_a7bgmGPGN7ks5t5t4OgaJpZM4SUpej

在我浏览了mono wasm 示例站点后,公司安全团队的两个人来到了我的办公桌前,该站点下载了hello.exe 。 我认为它是由“Symantec Endpoint Protection”拾取的。

谢谢哈利。 在带你出门之前,他们有没有给你时间把所有东西都装进一个盒子里? 最好的故事。

来自:Harry McIntyre [email protected]
发送:2018 年 6 月 7 日星期四晚上 8:36
收件人:aspnet/Blazor [email protected]
抄送:jiggyswift [email protected] ; 评论[email protected]
主题:回复:[aspnet/Blazor] 考虑将 .NET 程序集的 URL 更改为不以 .dll 结尾(#172)

在我浏览了 mono wasm 示例站点https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.hipbyte.com后,公司安全团队的两个人来到我的办公桌前


您收到此消息是因为您发表了评论。
直接回复此邮件,在 GitHub 上查看https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faspnet%2FBlazor%2Fissues%2F172%23issuecomment-395374377&data=02 %7C01%7C%7Cf21af207f881447e8d5d08d5cc627621%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636639645609018105&SDATA = A9rl39HzRP7w9mzRkqPKrG4zsHJKkVIy2jwJ0e9nc3g%3D&保留= 0 ,或静音螺纹https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub。 COM%2Fnotifications%2Funsubscribe-AUTH%2FAmF6aG9lvmy2g93BQQmI-5mbrGICanCxks5t6QIPgaJpZM4SUpej&数据= 02%7C01%7C%7Cf21af207f881447e8d5d08d5cc627621%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636639645609018105&SDATA = yZhLQXXqqp0hLEtD3mTowdoI4EpBu5qNNR0UI4tZDm8%3D&保留= 0

也许有用:

来自https://www.cisco.com/c/en/us/td/docs/security/firepower/623/configuration/guide/fpmc-config-guide-v623/file_policies_and_advanced_malware_protection.html

如果文件是存档文件(例如 .zip 或 .rar 存档文件),系统最多可以检查最外层存档文件(级别 0)下的三层嵌套文件。 您可以检查最大文件大小以存储高级访问控制设置的存档文件。
如果任何单个文件与具有阻止操作的文件规则匹配,则系统会阻止整个存档,而不仅仅是单个文件。 系统还可以阻止超过指定嵌套级别的档案,或者其内容被加密或无法检查的档案。

另一个链接(滚动到“文件类型功能”):
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk105318&js_peid=P-14d3e69bf07-10000

我找到了这里描述的解决方法: https://remibou.github.io/Change-Blazor-DLL-extension-with-ASPNET-Core/。 它可能对每个案例和 AV 都没有帮助,但它是一个起点。

@RemiBou伙计……太棒了:) 很好地抓住了使用 URLRewrite 的方法! 👍

关于 dll 扩展替换的主题,我想推动 wasm 扩展(即使技术上不正确),因为 github 页面、cloudflare 和可能大多数 CDN 已经在处理“application/wasm”的压缩,但不是“application/ octet-stream”,因此默认 Blazor 应用程序的重量约为 3.2 MB,只有 mono.wasm 使用 brotli 压缩。 最终,当 AOT 编译到位时,无论如何 Blazor 库已经成为 wasm,不是吗?

我刚刚使用 wasm 扩展测试了@RemiBou技巧,并在将 dll 推送到 gh-pages 之前重命名了它们,现在冷刷新应该是 1.9 MB:太棒了! 谢谢@RemiBou!

但是我的 Avast 防病毒软件一开始就发疯了,因为所有那些虚假的 wasm 文件都感染了 DRep,而且我得到了与@jorisvergeer相同的警报窗口。 经过快速搜索后,我认为从一个声誉比我最近创建的子域更好的站点下载假的 wasm 库可以解决问题,但我现在只是在猜测。

有关客户端 blazor 应用程序如何从公司内部失败的示例,请参阅随附的 PDF 文件。 从开发人员的角度来看,这是一个令人沮丧的问题,因为我们受制于我们无法控制的东西。

如果我们可以尝试将 dll 预编译为 wasm 文件,然后能够下载它们,那就太棒了。 (希望这会奏效)

403forbidden.pdf

上一篇文章中的 403 禁止消息是由我们的 zscaler 防火墙生成的。

为这个问题带来可见性和优先级以便在未来的冲刺中得到考虑的最佳方式是什么?

@rynowak @SteveSandersonMS @mkArtakMSFT我们需要确保我们有解决方案,因此进入 blazor-wasm 里程碑。

我创建了一个文档,描述了我现在用来解决被 zScaler 阻止的 dll 的解决方案。

https://github.com/jucchytil/CSBNotes/blob/master/Notes.md

我怀疑我们可能需要为 WASM 文件考虑类似的解决方案,因为防火墙制造商可能需要一段时间才能在未来几年内接受 wasm 文件是安全的。

我真的很期待 PublishSingleFile/PublishTrimmed/TargetFramework=wasm 所以我们只有一个相对较小的文件可以在服务工作者中管理。

你的意见?

谢谢丹!
我很感激这得到了一些关注。
我将我的临时解决方案发布到https://github.com/aspnet/AspNetCore/issues/5477
希望它可以在某种程度上有所帮助。

来自: Daniel Roth [email protected]
发送:2019 年 10 月 11 日星期五上午 10:33
至:aspnet/AspNetCore [email protected]
抄送:jucchytil [email protected] ; 评论[email protected]
主题:回复:[aspnet/AspNetCore] 考虑将 .NET 程序集的 URL 更改为不以 .dll 结尾 (#5477)

@rynowak https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Frynowak&data=02%7C01%7C%7Cecf83fca357f4abe690d08d74e604c75%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637064047810603291&sdata=N5o8HJ7%2FM1UInuoFp1HXbY9AqDhM8BCm %2F0IGZujyqqI%3D&保留= 0 @SteveSandersonMS https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSteveSandersonMS&data=02%7C01%7C%7Cecf83fca357f4abe690d08d74e604c75%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0 %7C637064047810613296&SDATA = vDuSWWEJ0CGf7ex7TStTMrHH1E27V5eza%2FMJKIkr%2BeY%3D&保留= 0 @mkArtakMSFT https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FmkArtakMSFT&data=02%7C01%7C%7Cecf83fca357f4abe690d08d74e604c75 %7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637064047810623307&sdata=ltzBUDC4c8o9kPvFmBlIOHN1B%2BUI2Fj%2FspG4WCIo%2BD8%3D&reserved=0我们需要确保我们有一个解决方案,所以进入 blazor 里程碑。


您收到此消息是因为您发表了评论。
直接回复此邮件,在 GitHub 上查看https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Faspnet%2FAspNetCore%2Fissues%2F5477%3Femail_source%3Dnotifications%26email_token %3DAEBYRE4UUUJDL3KHNPOYYJ3QOCMCVA5CNFSM4GK4V5L2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBALS2Y%23issuecomment-541112683和数据= 02%7C01%7C%7Cecf83fca357f4abe690d08d74e604c75%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637064047810633312&SDATA = qxqf5LstFcAUsEgSImIxMMOw33sNOgku09qw%2FJp3Z18%3D&保留= 0 ,或退订https://eur01.safelinks.protection.outlook.com/?url= HTTPS%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-AUTH%2FAEBYRE2MQUF65CHXQD54OWDQOCMCVANCNFSM4GK4V5LQ&数据= 02%7C01%7C%7Cecf83fca357f4abe690d08d74e604c75%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637064047810643323&SDATA = yx154tNWkGvXlXbVJNjvswed9hG0zr91HFqIhMVLCfo%3D&保留= 0

只是在他的博客上跟进 Daniel Roth 的请求,他要求我在此处发布我的网络托管服务提供商的名称,以便您可以测试这个问题。 博客评论可以在这里找到:- https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0/#comment -955

有问题的托管服务提供商是 infinityfree.net。 它们是免费的,所以很容易尝试!

基本上,在上传站点时,他们的服务器会从 _framework\bin\ 文件夹中删除大约一半的 DLL。 我原本以为出了什么问题,并反复尝试上传丢失的文件。 最终他们似乎“坚持”了下来,好像他们的服务器放弃了病毒检查新文件,一天后仍然存在(尽管他们最终可能会被扫除)。

无论如何,请为合适的解决方案添加我的投票,例如重命名 DLL。

@andyste1感谢您的信息。 您是否检查并确认如果文件被重命名,它们不会被删除? 如果托管公司基于内容而不是名称来执行此操作,那么重命名不一定是解决方案。

重命名可能没有多大帮助 - 已经可以使用 woraround 来实现这一点。
对我来说,问题在于文件的 PE 格式——反病毒程序 Sophos 会在我重命名时阻止文件,因为它也会扫描文件的内容。 幸运的是,Sophos 允许通过 HTTPS(不是 HTTP)下载 DLL(PE 格式)文件。

@lertoo我们正在讨论可能从程序集中删除 PE 元数据以减小大小,但它也可能有助于解决这个问题。

本期诺顿杀毒版本: https ://forums.asp.net/t/2161027.aspx

很可能不仅是文件扩展名,而且文件头也会导致某些偏执软件出现问题。 当问题与标头有关时,混淆将无济于事,除非启动 Blazor VM 的 JS 不会以某种方式手动替换它们在内存中,但这是一个很长的目标。

我目前的解决方法是在我的 CI/CD 管道中提供每个 DLL 的 Base64 编码版本,使用服务工作者从防火墙中检测 DLL 的 403,下载 DLL 文本文件的 Base64 版本,并将 Base64 转换回服务工作者中的 DLL,然后将其缓存到浏览器中。

如果我们可以将 DLL 转换为 WASM 文件,我会很想知道问题是否会消失,因为 WASM 文件对我来说似乎可以通过,但对于所有防火墙来说可能并非如此。

另一个 Blazor WebAssembly 误报:

image

自 2018 年初以来,我一直在等待这个问题得到解决 :) 我喜欢/喜欢 blazor,但如果 dll 无法更改,这似乎是一个潜在的表演终结者

@JonnyGibson感谢您的耐心等待! 我们正在努力为今年 5 月即将发布的版本解决此问题。

这是一个很长的问题,所以我试图在这里总结所有这些:

杀毒软件

  • NOD32 (ESET)
  • AVG 诉 18.1.3044 (+3)
  • 网络流量扫描
  • 阿瓦斯特 (+3)
  • 赛门铁克端点保护
  • zScaler

重命名提案

  • .blazor (+35)
  • .bin (+3)
  • .lib
  • .ilasm (+6)
  • .net (+14)
  • .wasm (-8)
  • [自定义] (+1)
  • [没有]

人们使用的解决方法

  • 重命名扩展
  • BASE64 编码 DLL

一般注意事项

  • .DLL 和 .EXE 是许多企业在防火墙级别阻止的扩展,作为一项策略。
  • 有报道称防病毒软件也报告了重命名的扩展

@mkArtak
您可能还想在摘要中的某处包含 zScaler,因为这就是阻止我下载的原因。

一种测试方法是将所有可执行文件转换为 wasm 文件,因为我不记得 zScaler 遇到过问题。

在客户端 blazor 解决这些问题并获得更好的初始下载时间之前,我暂时转向了 Angular。

我花了很多时间试图让客户端 blazor 工作,并决定等到平台更加成熟一些。
https://github.com/jucchytil/CSBNotes/blob/master/Notes.md

@javiercn让我们在这里跟踪文件扩展名重命名工作,我将提交一个单独的问题,以便与防病毒提供商就此进行跟进。

需要采取的行动

🎫
我刚刚创建了一个新问题,我们将尝试收集所有阻止 Blazor WASM 应用程序的特定软件。 请提供特定于您的案例的信息,如下所述: https ://github.com/dotnet/aspnetcore/issues/19552

附带说明一下,像 github pages 和 cloudflare 这样的 CDN 正在使用开箱即用的 wasm 扩展压缩资产,同时为 dll 文件提供未压缩版本。 如果我没记错的话,Azure CDN 的行为方式应该相同。

我们今天经历了这一点。 取消对 DLL 下载的限制不会成为一种选择。 不仅对我们来说,而且我们的客户也不太可能取消该限制 - 所以我们真的需要解决这个问题,否则我们的 Blazor 项目将陷入困境(雇主不愿意使用服务器端)。

我相信我们的防火墙是帕洛阿尔托。

@mrpmorris您能否将详细信息放在https://github.com/dotnet/aspnetcore/issues/19552中,因为这是我们收集它们的地方,以便我们可以与供应商合作。

@mrpmorris更改扩展解决了您方案中的问题?

@javiercn

我刚刚更新了那个问题。 似乎切换到 https 对我们有用,这是有道理的。 我们不能确定我们的客户是否愿意有同样的例外。

我很乐意检查重命名选项。 您是否有关于如何让 Blazor 使用 .wasm 扩展或其他内容的说明的链接? 目前我只是右键单击我的网络服务器项目并直接选择Publish到 Azure Web 应用程序。

@mrpmorris您可以在此处查看说明
https://github.com/dotnet/aspnetcore/pull/19558#issuecomment -594461263

@mrpmorris请注意,这些说明仅适用于我们最新的 3.2.0-preview2 版本,从 3.2.0-preview1 升级需要使用我们尚未发布的步骤进行一些工作。 您可能要等到我们本月晚些时候发布。

@danroth27我认为你还没有发布 preview2... :)

如果您选择这样做,您可以按照此处的说明在夜间构建中尝试此操作。

如果您选择这样做,我建议您在之前和之后清除您的 nuget 包缓存。 考虑到清除缓存会影响整个机器(该机器中的所有应用程序)

我将等待 p2 版本发布,然后尝试一下。 谢谢!

@mrpmorris 3.2 Preview 2 现已推出! https://github.com/dotnet/aspnetcore/pull/19558#issuecomment -594461263 中建议的用于重命名文件的步骤是否适合您?

嗨伙计!

在最近的Blazor WebAssembly 3.2 Preview 2版本中,我们进行了一些更改,以便更轻松地重命名应用程序中的 .dll 文件,以解决干扰 Blazor WebAssembly 应用程序的代理/防火墙/防病毒软件。 我们希望遇到此问题的人在 Blazor WebAssembly 应用程序(独立或托管 ASP.NET Core)的已发布输出上尝试以下步骤,看看是否有帮助:

视窗

  • 在已发布输出的wwwroot目录中打开 PowerShell 提示符(例如,在yourapp\bin\Release\netstandard2.1\publish\wwwroot
  • 执行以下两行:
dir .\_framework\_bin | rename-item -NewName { $_.name -replace ".dll\b",".bin" }
((Get-Content .\_framework\blazor.boot.json -Raw) -replace '.dll"','.bin"') | Set-Content .\_framework\blazor.boot.json

Linux / macOS

  • 在您发布的输出的wwwroot目录中打开一个终端(例如,在yourapp/bin/Release/netstandard2.1/publish/wwwroot
  • 执行以下两行:
for f in _framework/_bin/*; do mv "$f" "`echo $f | sed -e 's/\.dll\b/.bin/g'`"; done
sed -i 's/\.dll"/.bin"/g' _framework/blazor.boot.json

请尝试这些步骤,并告诉我们进展如何。 如果您仍然遇到问题,请告诉我们! 如有必要,我们还有一些其他的想法可以尝试。

谢谢!

这对我有用。 虽然我不得不调整我在 Azure DevOps 上的发布步骤并停用它在最后生成一个 zip。

就我而言:

- task: DotNetCoreCLI<strong i="7">@2</strong>
  displayName: 'dotnet publish'
  inputs:
    command: 'publish'
    publishWebProjects: false
    zipAfterPublish: false
    projects: |
      **/ApplySupportTool.Server.csproj
    arguments: '--configuration $(buildconfiguration)  --output $(Build.ArtifactStagingDirectory)'

- task: PowerShell<strong i="8">@2</strong>
  displayName: Change Outputname
  inputs:
    targetType: 'inline'
    workingDirectory: $(Build.ArtifactStagingDirectory)\ApplySupportTool.Server\wwwroot
    script: |
         dir .\_framework\_bin | rename-item -NewName { $_.name -replace ".dll\b",".bin" }
         ((Get-Content .\_framework\blazor.boot.json -Raw) -replace '.dll"','.bin"') | Set-Content .\_framework\blazor.boot.json

@NPadrutt它在什么意义上起作用? 从某种意义上说,您最终观察到您的网站之前无法运行(由于某种防病毒或防火墙),并且 URL 的更改解决了这个问题? 如果是这种情况,您能否在https://github.com/dotnet/aspnetcore/issues/19552 之前发布有关防病毒/防火墙/等对您造成问题的详细信息? 谢谢!

@SteveSandersonMS好吧,我之前已经通过重写器解决了问题。 升级到 3.2 预览版 2 后,一个不再工作,应用程序再次被阻止。 有了上面它又可以工作了。

不幸的是,我无法告诉您我们的网络中有什么防火墙,而且我认为 AntiVirus (McAffee) 对此没有影响,因为在本地工作没有问题。

我办公室的某个人的 COVID-19 检测呈阳性,所以我的办公室看起来将关闭几周——这意味着我不会通过他们的防火墙访问文件。 对不起。

@mrpmorris没问题。 注意安全!

嗨伙计!

在最近的Blazor WebAssembly 3.2 Preview 2版本中,我们进行了一些更改,以便更轻松地重命名应用程序中的 .dll 文件,以解决干扰 Blazor WebAssembly 应用程序的代理/防火墙/防病毒软件。 我们希望遇到此问题的人在 Blazor WebAssembly 应用程序(独立或托管的 ASP.NET Core)的 _published output_ 上尝试以下步骤,看看是否有帮助:

@danroth27

我运行了脚本(我在 Windows 上开发,但我从 Linux 环境部署到另一个 Linux 环境,所以我使用提供的 Linux 脚本)并使用新名称进行部署,并且在加载页面时似乎正在加载文件新的扩展很好,该应用程序可以正常工作。 在我们的案例中,Avast 不再标记应用程序,也不再阻止下载。

由于大流行的情况,在我们检查公司防火墙情况之前还需要一点时间。

这是添加到构建中的一个足够简单的步骤,并且似乎没有任何缺点,因此我们将开始使用它。

谢谢!

@danroth27这是否会在某个时候成为默认设置,所以我们不需要执行此步骤? 如果 .dll 文件类型存在一般问题,是否真的有任何理由不只是移动到 .bin 或没有文件类型作为默认文件类型,而不是要求每个人都这样做?

即使文件不是“.dll”,病毒检查程序是否有机会检查它是否是 dll 文件?

@danroth27 @SteveSandersonMS
我在浏览器控制台中遇到很多与完整性失败或找不到文件有关的错误:

_framework/_bin/Blazored.LocalStorage.dll:1 Failed to load resource: the server responded with a status of 404 ()
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
Failed to find a valid digest in the 'integrity' attribute for resource '<URL>' with computed SHA-256 integrity '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='. The resource has been blocked.
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/BlazorStrap.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.AspNetCore.Blazor.HttpClient.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.AspNetCore.Components.dll:1 Failed to load resource: the server responded with a status of 404 ()
_framework/_bin/Microsoft.AspNetCore.Components.Authorization.dll:1 Failed to load resource: the server responded with a status of 404 ()
_framework/_bin/Microsoft.AspNetCore.Components.WebAssembly.Authentication.dll:1 Failed to load resource: the server responded with a status of 404 ()
_framework/_bin/Microsoft.AspNetCore.Authorization.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.AspNetCore.Components.Web.dll:1 Failed to load resource: the server responded with a status of 404 ()
_framework/_bin/Microsoft.AspNetCore.Components.Forms.dll:1 Failed to load resource: the server responded with a status of 404 ()
_framework/_bin/Microsoft.AspNetCore.Components.WebAssembly.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
admin:1 Unknown error occurred while trying to verify integrity.
admin:1 Unknown error occurred while trying to verify integrity.
admin:1 Unknown error occurred while trying to verify integrity.
admin:1 Unknown error occurred while trying to verify integrity.
admin:1 Unknown error occurred while trying to verify integrity.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
A cookie associated with a cross-site resource at <URL> was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at <URL> and <URL>.
blazor.webassembly.js:1 Error: Failed to start platform. Reason: TypeError: Failed to fetch
    at blazor.webassembly.js:1
    at blazor.webassembly.js:1
    at Object.throw (blazor.webassembly.js:1)
    at u (blazor.webassembly.js:1)
d.printErr @ blazor.webassembly.js:1
_framework/_bin/Microsoft.AspNetCore.Metadata.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Bcl.HashCode.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.CSharp.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.EntityFrameworkCore.Abstractions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Caching.Abstractions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.EntityFrameworkCore.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.EntityFrameworkCore.Relational.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Caching.Memory.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Configuration.Abstractions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Configuration.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Configuration.Json.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.DependencyInjection.Abstractions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.DependencyInjection.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Identity.Core.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Identity.Stores.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Logging.Abstractions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Logging.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Options.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.Extensions.Primitives.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Microsoft.JSInterop.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Mono.Security.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/MovingPicturesEvents.Core.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/MovingPicturesEvents.Services.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/mscorlib.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/MovingPicturesEvents.Web.Client.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/netstandard.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/Radzen.Blazor.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Collections.Immutable.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.ComponentModel.DataAnnotations.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Core.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Data.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Diagnostics.DiagnosticSource.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Linq.Dynamic.Core.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Net.Http.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Net.Http.Json.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Numerics.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Runtime.CompilerServices.Unsafe.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Text.Encodings.Web.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Text.Json.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Transactions.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Xml.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/System.Xml.Linq.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/WebAssembly.Bindings.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.
_framework/_bin/WebAssembly.Net.Http.dll:1 Failed to load resource: the server responded with a status of 404 ()
admin:1 Unknown error occurred while trying to verify integrity.

我尝试了@danroth27在 Windows 和 Linux Docker 容器上提到的步骤,结果相同。

使用 3.2 预览 4。

@radderz这个问题似乎不会影响所有环境——它特定于某些环境,并且通常是基于策略的。 如果我们切换到不同的文件扩展名,则不能保证这对所有人都有效。 因此,我们不会更改每个人的默认设置,而是继续执行计划,让遇到此问题的客户可以使用上面提供的技术自己控制文件扩展名。

当然,防病毒软件/代理/防火墙可能会对文件进行更深入的检查,而不仅仅是查看文件扩展名。 到目前为止,我们还没有听说有人被此阻止。 如果这成为一个问题,我们将采取其他缓解措施。

@mihaimyh看起来您的内容安全策略配置错误?

@mihaimyh看起来您的内容安全策略配置错误?

@danroth27你能说得更清楚些吗? 你在说什么安全策略? 即使在我认为没有实施安全策略的开发环境中,我也遇到了这些错误。

@mihaimyh抱歉,我想我将内容安全策略与子资源完整性混淆了。 看起来浏览器正试图通过integrity属性强制下载资产的哈希与标记中指定的哈希匹配,但缺少integrity属性。 这也可能与 Blazor 如何下载和缓存应用程序资源有关,它使用类似的基于哈希的策略来验证文件是否已更改。

@mihaimyh抱歉,我想我将内容安全策略与子资源完整性混淆了。 看起来浏览器正试图通过integrity属性强制下载资产的哈希与标记中指定的哈希匹配,但缺少integrity属性。 这也可能与 Blazor 如何下载和缓存应用程序资源有关,它使用类似的基于哈希的策略来验证文件是否已更改。

@danroth27好的,我相信我可以通过添加绕过完整性检查

<BlazorCacheBootResources>false</BlazorCacheBootResources>

到我的 .csproj 文件,但我仍然收到禁用完整性检查的 404 事件。

@mihaimyh如果您可以可靠地重现此问题,我建议为此问题打开一个新问题,因为它似乎与文件扩展名问题无关。 这将更容易吸引合适的人。

确保在“dll 重命名”脚本中添加类似的内容

# Remove compressed versions of blazor.boot.json because it still looks for .dll files
Remove-Item ".\_framework\blazor.boot.json.gz"
Remove-Item ".\_framework\blazor.boot.json.br"

大多数情况下,将下载预压缩的blazor.boot.json ,而不是“固定的” blazor.boot.json“.dll”文件而不是“.bin”文件发出请求,从而导致完整性问题。

因此,您必须删除压缩的 json 文件或重新压缩 blazor.boot.json,但我认为经历这些麻烦是不值得的。

希望有一天,这一切都可以由带有 csproj 标志的框架处理,例如

<BlazorBinariesExtension>.bin</BlazorBinariesExtension>

嗨伙计。 至此,我们已经记录了我们推荐的使用脚本更改已发布 .NET 程序集的文件扩展名的策略。 我认为@stavroskasidis的建议仍然是一个很好的建议,可以提供一种简单的内置方法来执行此操作,因此我打开了https://github.com/dotnet/aspnetcore/issues/21489来跟踪该建议。 在这一点上,我认为我们已经准备好结束这个问题了。 感谢大家提供的详细反馈!

从我可以看到从 .dll 重命名为 .bin 也必须在wwwroot/service-worker-assets.js中完成并删除或重新压缩wwwroot/service-worker-assets.js.brwwwroot/service-worker-assets.js.gz ,否则存在完整性问题浏览器的控制台。

此页面是否有帮助?
0 / 5 - 0 等级