【问题标题】:Azure Devops - Classic Pipeline - OWASP Zap Scanner Test - Powershell TaskAzure Devops - 经典管道 - OWASP Zap 扫描仪测试 - Powershell 任务
【发布时间】:2021-11-03 10:32:25
【问题描述】:

尝试在 Azure Devops 发布管道中将 ZAP XML 转换为 NUnit XML 以进行 OWASP ZAP 安全测试,在 Powershell 任务中出现以下错误。请帮忙

2021-09-06T09:39:32.4736044Z ##[section]Starting: Convert ZAP XML to NUnit XML
2021-09-06T09:39:32.4744197Z ==============================================================================
2021-09-06T09:39:32.4744531Z Task         : PowerShell
2021-09-06T09:39:32.4744804Z Description  : Run a PowerShell script on Linux, macOS, or Windows
2021-09-06T09:39:32.4745074Z Version      : 2.190.0
2021-09-06T09:39:32.4745298Z Author       : Microsoft Corporation
2021-09-06T09:39:32.4745622Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
2021-09-06T09:39:32.4746679Z ==============================================================================
2021-09-06T09:39:32.6192068Z Generating script.
2021-09-06T09:39:32.6225079Z ========================== Starting Command Output ===========================
2021-09-06T09:39:32.6236523Z [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/home/vsts/work/_temp/55afabcf-833e-4c93-8d60-c067a14be9ab.ps1'
2021-09-06T09:39:33.5525712Z [91mTransformOWASPReport: [0m/home/vsts/work/r1/a/_Testing/Transform.ps1:28
2021-09-06T09:39:33.5527142Z [96mLine |
2021-09-06T09:39:33.5529111Z [96m  28 | [0m … ransformOWASPReport -XLSTPath $XLSTPath -OWASPFile [96m$OWASPFile[0m -Transf …
2021-09-06T09:39:33.5530107Z [96m     | [91m                                                      ~~~~~~~~~~
2021-09-06T09:39:33.5531096Z [91m[96m     | [91mCannot bind argument to parameter 'OWASPFile' because it is an
2021-09-06T09:39:33.5531923Z [96m     | [91mempty string.
2021-09-06T09:39:33.5781242Z ##[error]PowerShell exited with code '1'.
2021-09-06T09:39:33.5816175Z ##[section]Finishing: Convert ZAP XML to NUnit XML

【问题讨论】:

  • 请发布您的PowerShell代码
  • 尝试检查安全测试 - dzone.com/articles/…,同时检查 Zap 发布管道 - medium.com/@sudhinsureshr/…
  • 感谢您的回复,我已关注链接,但在 Azure Devops 发布管道中遇到以下错误
  • [command]/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command 。 '/home/vsts/work/_temp/e7d92189-3fed-4c20-b768-b9d991d2e2b2.ps1' [91mParentContainsErrorRecordException: [0m/home/vsts/work/_temp/e7d92189-3fed-4c20-b768-b9d991d2e2b2.ps1:6 [ 0m [96m$XslTransform.Load($XslPath)[ [91m ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [91mException调用“加载”与“ 1” 参数:“找不到 [91mfile '/home/vsts/work/r1/a/OWASPToNUnit3.xslt'。” ##[错误]PowerShell 以代码“1”退出。 ##[section]整理:PowerShell脚本

标签: xml powershell azure-devops azure-pipelines-release-pipeline devsecops


【解决方案1】:

问题已解决,我们在 PS 变量中给出了正确的路径。

【讨论】:

    猜你喜欢
    • 2022-09-30
    • 2019-07-08
    • 2018-03-28
    • 2016-06-26
    • 1970-01-01
    • 1970-01-01
    • 2021-11-29
    • 2020-08-27
    • 1970-01-01
    相关资源
    最近更新 更多