mercedes-benz / sechub

SecHub provides a central API to test software with different security tools.
https://mercedes-benz.github.io/sechub/
MIT License
260 stars 63 forks source link

Adjust CWE workaround for SARIF reports in light of KICS 1.7.13 update #3155

Closed haerter-tss closed 4 months ago

haerter-tss commented 4 months ago

Situation

In previous versions of KICS (prior to 1.7.12), SARIF reports did not include Common Weakness Enumeration (CWE) identifiers for findings. To address this, a workaround was implemented in SecHub that adds a default CWE to all findings to ensure that reports were compliant with expected standards.

Wanted

With the release of KICS version 1.7.12, some CWEs are now included for Docker findings. However, the current workaround in SecHub indiscriminately adds a default CWE to all findings, which can lead to inaccuracies in the reports where KICS already provides a CWE.

Solution

The workaround needs to be refined to check if a CWE is already present in the SARIF report for a finding. If a CWE is present, the workaround should not add a default CWE. This adjustment will ensure that the SARIF reports contain accurate CWE information when available from KICS, and fall back to the default CWE only when necessary.