- 入门指南
- 设置和配置
- 自动化项目
- 依赖项
- 工作流类型
- 控制流程
- 文件比较
- 自动化最佳实践
- 源代码控件集成
- 调试
- 日志记录
- 诊断工具
- 工作流分析器
- 变量
- 参数
- 导入的命名空间
- 编码自动化
- 基于触发器的 Attended 自动化
- 对象存储库
- ScreenScrapeJavaSupport 工具
- 扩展程序
- Studio 测试
- 故障排除
Studio 用户指南
Studio 中提供包签名功能,旨在确保 Studio 中发布的流程和库均能享有安全性与完整性。
NuGet 提供两种包签名方式,即按照作者或按照存储库。
强制使用签名包
要强制使用签名包,必须将 Nuget.config 文件中的 signatureValidationMode 参数设置为 require。该文件位于 %ProgramFiles%\UiPath\Studio。您可以通过以下两种方式之一进行操作:
- 在安装期间,通过从命令行中使用
ENFORCE_SIGNED_EXECUTION=1选项进行安装。例如,下列命令将安装 Studio、机器人(作为 Windows 服务),并强制在 UiPath 环境中使用经签名的包:UiPathStudio.msi ADDLOCAL=DesktopFeature,Studio,Robot,RegisterService ENFORCE_SIGNED_EXECUTION=1。 - 安装完成后,通过手动编辑
Nuget.config文件。 如果在安装后设置参数,则更改将在您执行以下操作后生效:- 重新启动机器人服务。
- 从
%ProgramFiles%\UiPath\Studio\Packages和%userprofile%\.nuget\packages删除所有现有的 .NuGet 包。 - 重新启动 Studio/Assistant。
默认情况下,UiPath 包使用存储库和作者签名。这表示您可以使用“管理包”下载并安装此类包,而无需执行任何其他操作。如需了解如何添加其他受信任的作者、存储库和/或所有者,请参阅此页面的以下部分。
当使用多个订阅源时,NuGet 将选择响应最快的订阅源。如果其中一个订阅源不包含已签名的包和依赖项,则 Robot 可能会收到未签名的包或依赖项,从而导致自动化失败。为避免这种情况,请确保所有已配置的订阅源都对包和依赖项进行签名。
添加可信来源
若要下载、安装并运行使用特定证书签名的包,请将此证书添加为可信来源。为此,可修改安装文件夹中的 nuget.config 文件,主要是 <trustedSigners> 部分。
添加可信作者
若要添加可信作者,您需要打开位于 %ProgramFiles%\UiPath\Studio\NuGet.config 的 NuGet.config 文件。然后,提供 certificatefingerprint 和 hashAlgorithm。查阅此页面,以了解关于证书指纹的更多信息。
将 allowUntrustedRoot 设为 true 或 false:
allowUntrustedRoot = "true"- 应允许受信任的签名者链接到不受信任的根。allowUntrustedRoot = "false"- 不应允许受信任的签名者链接到不受信任的根。
其条目应类似于下例所示:
<trustedSigners>
<author name="UiPath">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true"/>
</author>
</trustedSigners>
<trustedSigners>
<author name="UiPath">
<certificate fingerprint="1234512345123451234512345123123123123123123123123123112312312E5" hashAlgorithm="SHA256" allowUntrustedRoot="true"/>
</author>
</trustedSigners>
有关将 UiPath 添加为已信任签名者的更多信息,请参阅《机器人指南》中的“包签名验证”。
添加可信存储库
添加可信存储库的方式基本与添加作者相同,区别是必须同时添加 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>
为包签名
-
在 Studio 中,可以从“发布”窗口的“证书签名”选项卡中为流程和库的程序包签名。
-
In the Certificate signing tab, add the certificate path on your local machine. Use the
button to navigate to the path if needed. Only .pfx and .p12 certificate file formats are accepted. -
接着,根据需要输入“证书密码”并添加可选的证书“时间戳记程序”。单击“发布”。若有指定,生成的
.nupkg文件将使用证书和时间戳记程序签名。
时间戳是跟踪包签名日期和时间的安全方式。 若要进一步了解 NuGet 包签名语境中的时间戳记,可查阅此链接。
如果证书时间戳记程序无效,则单击“发布”按钮后 Studio 中将抛出含有项目名称的错误消息。“输出”面板中也将记录类似的错误消息。
如未强制执行签名验证,则无论程序包的签名状态如何,机器人都可正常执行使用 Studio v2019.4 先前版本创建的流程。
使用“批量更新命令行”工具对多个包进行签名,然后将其发布到某个位置。
使用“修复依赖项”功能时,项目中包含的未签名依赖项可能会妨碍系统解决其他依赖项。从项目中删除未签名的包以解决已签名的依赖性。