runCxConsole scan -v -CxServer https://TEST.Checkmarx.com -projectName PROJECTNAME -CxUser Guest -CxPassword ***** -Locationtype folder -locationpath "C:\Users\GuestName\Desktop\Desktop\PROJECTNAME\WebApp.zip" -preset Default
我正在使用上面的命令通过其 CLI 对 checkmarx 运行扫描。 它向我显示了这个错误:
[2018-10-22 13:50:53,192 ERROR] Error executing SAST scan command: Failed to initialize SAST scan prerequisites: com.checkmarx.cxconsole.clients.general.exception.CxRestGeneralClientException: Failed to get teams: Failed to get teams: status code: 500. Error message:<!DOCTYPE html>
[2018-10-22 13:50:53,192 ERROR] Failure - General error occurred - error code 1
最佳答案
试试下面的一个
首先使用下面的命令生成一个token
runCxConsole.cmd GenerateToken -v -CxUser username -CxPassword admin -CxServer http://localhost
CHECKMARX_HOME/runCxConsole.sh Scan -v -CxServer <checkmarx server details> -ProjectName "<project name>" -cxToken <token> -locationtype folder -locationpath "<file/path>" -preset "Checkmarx Default" -reportcsv CX_Scan.csv -ReportPDF CX_Scan.pdf
注意:始终使用 token 对服务器进行身份验证,而不是在 CLI 命令中对用户名和密码进行硬编码。
更多信息您可以访问https://checkmarx.atlassian.net/wiki/spaces/SD/pages/222232891/Authentication+Login+to+the+CLI https://checkmarx.atlassian.net/wiki/spaces/SD/pages/1929937052/GitLab+Integration
关于command-line-interface - 通过 CLI 执行 CHECKMARX 扫描时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52928867/