机器人
2023.4
False
横幅背景图像
机器人用户指南
上次更新日期 2024年4月3日

包签名验证

包签名是 NuGet 包用于证明其来自受信任来源的一种方法。使用证书验证签名者的身份,对包进行签名。当部署设置为检查包签名验证时,UiPath 会根据 NuGet.config 文件中的可用信息进行验证,以查找请求的证书,确保使用的包来自允许的作者或存储库。

如要深入了解包签名验证的工作原理,请务必阅读关于 NuGet.config 文件的 Microsoft 指南中该节中的详细说明。

配置包签名验证

验证模式

  • accept - 允许安装未签名的包。
  • require - 要安装包,其签名详细信息必须与 NuGet.configtrustedSigners 部分中的签名详细信息匹配。

强制使用签名包

要强制使用签名包,必须将 Nuget.config 文件中的 signatureValidationMode 参数设置为 require。该文件位于 %ProgramFiles%\UiPath\Studio。您可以通过以下两种方式之一进行操作:
  • 在安装过程中,通过在 命令行 中使用选项 ENFORCE_SIGNED_EXECUTION=1进行安装。

    例如,下列命令将安装 Studio、机器人(作为 Windows 服务),并强制在 UiPath 环境中使用经签名的包:

    UiPathStudio.msi ADDLOCAL=DesktopFeature,Studio,Robot,RegisterService ENFORCE_SIGNED_EXECUTION=1UiPathStudio.msi ADDLOCAL=DesktopFeature,Studio,Robot,RegisterService ENFORCE_SIGNED_EXECUTION=1
  • 安装完成后,通过手动编辑 NuGet.config 文件。

    如果在安装后设置参数,则更改将在您执行以下操作后生效:

    1. 重新启动机器人服务。
    2. %ProgramFiles%\UiPath\Studio\Packages%userprofile%\.nuget\packages 删除所有现有的 .NuGet 包。
    3. 重新启动 Studio/Assistant。

添加可信来源

若要下载、安装并运行使用特定证书签名的包,请将所需证书添加为可信来源。

为此,修改安装文件夹中 NuGet.config 文件的 <trustedSigners> 部分。
注意:有关如何添加或删除活动订阅源的更多信息,请参阅本文档

将 UiPath 添加为受信任的签名者

打开安装文件夹中的 NuGet.config 文件并添加以下值:
<config>
     <add key="signatureValidationMode" value="require" />
</config>
<trustedSigners>
   <author name="UiPath">
      <certificate fingerprint="D179174EBC1E180D656BFB15BE369DEA8A17C178230FAC7771BF5446940C290C" hashAlgorithm="SHA256" allowUntrustedRoot="false"/>
      <certificate fingerprint="ABD1E1BB749DDC96B46A1DBD91B93A2D8B3B5572D1E20A52F6165ED96FC117E0" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
   </author>
   <repository name="UiPathRepository" serviceIndex="https://gallery.uipath.com/api/v3/index.json">
      <certificate fingerprint="D179174EBC1E180D656BFB15BE369DEA8A17C178230FAC7771BF5446940C290C" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
      <certificate fingerprint="ABD1E1BB749DDC96B46A1DBD91B93A2D8B3B5572D1E20A52F6165ED96FC117E0" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
   </repository>
</trustedSigners><config>
     <add key="signatureValidationMode" value="require" />
</config>
<trustedSigners>
   <author name="UiPath">
      <certificate fingerprint="D179174EBC1E180D656BFB15BE369DEA8A17C178230FAC7771BF5446940C290C" hashAlgorithm="SHA256" allowUntrustedRoot="false"/>
      <certificate fingerprint="ABD1E1BB749DDC96B46A1DBD91B93A2D8B3B5572D1E20A52F6165ED96FC117E0" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
   </author>
   <repository name="UiPathRepository" serviceIndex="https://gallery.uipath.com/api/v3/index.json">
      <certificate fingerprint="D179174EBC1E180D656BFB15BE369DEA8A17C178230FAC7771BF5446940C290C" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
      <certificate fingerprint="ABD1E1BB749DDC96B46A1DBD91B93A2D8B3B5572D1E20A52F6165ED96FC117E0" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
   </repository>
</trustedSigners>

添加可信作者

若要添加可信作者,您需要打开位于 %ProgramFiles%\UiPath\Studio\NuGet.configNuGet.config 文件。然后,按照上述示例提供 certificatefingerprinthashAlgorithm。查阅此页面,以了解关于证书指纹的更多信息。

添加可信存储库

添加可信存储库的方式基本与添加作者相同,区别是必须同时添加 serviceIndex
下例中将一个可信存储库添加到 NuGet.config 文件:
<trustedSigners>    
<repository name="UiPath Repository" serviceIndex="https://uipath.repository">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
</repository>
</trustedSigners><trustedSigners>    
<repository name="UiPath Repository" serviceIndex="https://uipath.repository">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
</repository>
</trustedSigners>

添加可信所有者

一个存储库可能包含多个作者签名的包。这时可以使用 <owners> 标签,以仅允许安装由可信作者签名的包。
<owners> 标签之间添加可信作者,如下例中所示:
<trustedSigners>
<repository name="UiPath Repository" serviceIndex="https://uipath.repository">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
<owners>Author1;Author2</owners> 
</repository>
</trustedSigners><trustedSigners>
<repository name="UiPath Repository" serviceIndex="https://uipath.repository">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
<owners>Author1;Author2</owners> 
</repository>
</trustedSigners>

v2021.2 行为

从 v2021.2 版本开始,安装时 Nuget.config 文件中填充以下用于包签名验证的设置:
  • 安装时,Nuget.config 文件中不再填充 signatureValidationMode 参数
  • 安装时,UiPath 不再作为存储库和作者填充在 Nuget.config 文件的 trustedSigners 标签中。

影响:

  • 如果使用包签名验证,则必须手动将所有受信任的签名者(包括 UiPath)添加到 NuGet.config 文件中。
  • 如果未使用包签名验证,则 NuGet.config 文件中应不存在 trustedSigners 标签。
  • 如果使用 NuGet.org 订阅源,则由于 NuGet 宣布整个存储库已签名,因此需要同时为接受和要求模式添加订阅源。

要解决上述问题,您需要将 UiPath 添加为受信任的签名者

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.