checkmarx-ts / checkmarx-cxflow-github-action

Checkmarx CxFlow GitHub Action with SARIF output
GNU General Public License v3.0
52 stars 53 forks source link

Fix Issue with Checkmarx URL in CxFlow GitHub Action - Handle /cxrestapi Path #84

Closed satyamchaurasiapersistent closed 2 months ago

satyamchaurasiapersistent commented 2 months ago

PR Description: Timestamp when the issue happened: 2024-07-24 13:10:21

Detailed Flow: The issue was identified in the CxFlow GitHub action where the Checkmarx URL is provided differently, leading to different outcomes.

Scenario 1: When the Checkmarx URL is provided through an environment variable:

env: checkmarx_url: https://codescan.elsevier.com steps:

This configuration resulted in an error:

2024-07-24 13:10:21.912 ERROR 6 --- [ main] c.c.s.s.CxAuthService [wG965Yj3] : Error occurred while obtaining Access Token. Possibly incorrect credentials 2024-07-24 13:10:21.914 ERROR 6 --- [ main] c.c.s.s.CxAuthService [wG965Yj3] : org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html

Scenario 2: When the Checkmarx URL is passed directly without using an environment variable: steps:

This configuration worked fine, without any errors.

Root Cause: In the first case, the /cxrestapi path was not automatically appended to the access token endpoint URL, resulting in a 404 Not Found error during the token acquisition process.

Special Configurations: No special configurations were applied, the issue was isolated to the difference in how the URL was provided.

Outcome of the Webex Meeting with the Customer: During the Webex meeting, it was confirmed that the issue is caused by the absence of the /cxrestapi path when the URL is provided through an environment variable. The customer was advised to ensure the correct endpoint path is appended to avoid the error.

Previous Info: Timestamp when the issue happened: NA Detailed Flow: In the CxFlow GitHub action, the behavior changes depending on how the Checkmarx URL is provided.

Attachments: Attached are the log files for both scenarios to illustrate the differences in behavior and the resulting error.