Error executing CHECKMARX Scan through CLI

Viewed 2082

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

I am using above command to run scan on checkmarx through its CLI. It shows me this error:

[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
1 Answers

Try below one

First generate a token using below command

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

Note:Always use token for authentication with the server instead hard coding the username and password in the CLI command.

For more information you can visit 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

Related