checkmarx-ltd / cx-flow

Checkmarx Scan and Result Orchestration
Apache License 2.0
88 stars 87 forks source link

ScaResolver concurrency problems still not resolved #1365

Closed nleach999 closed 1 month ago

nleach999 commented 2 months ago

Description

A followup to Issue #1128 - it was closed as fixed. The threading misdirection may have been fixed (not confirmed), but there is still an underlying concurrency problem in the naming of the report output directory.

Expected Behavior

When SCA Resolver is executed, the reports output directory should be unique enough that multiple running requests such that there will be no possible chance that multiple concurrent requests will generate the same report output directory.

This should be consistent with multiple threads running in the same CxFlow instance or multiple instances of CxFlow running as different processes on the same machine.

Actual Behavior

When a path for the resolver report output directory is generated, it should not be a simple timestamp. A busy system with multiple requests will have hard-to-predict clashes causing 2 or more instances of a running SCA Resolver to attempt to output to the same file.

Reproduction

  1. Use CxFlow with SCA Resolver.
  2. Observe the results output path as /tmp/<timestamp> as shown below.

2024-07-12 19:07:14.304 DEBUG 12102 --- [ main] c.c.s.s.s.ScaScanner [bnOMiMB6] : mandatory -s /home/ubuntu/gh-runner/_work/sv_test/sv_test/. -n nleach999-sv_test-master -r /tmp/2024071219071419458/.cxsca-results.json

Environment Details

Verified in CxFlow 1.7.02 and 1.7.0

itsKedar commented 1 month ago

Hi @nleach999,

Output Path has timestamp + random number up to 30000. Which should not cause concurrency problem.

Closing issue.

Thanks