Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonarqube2hdf output issues - null on mandtory fields #6196

Open
Jiri-Stary opened this issue Aug 7, 2024 · 2 comments
Open

sonarqube2hdf output issues - null on mandtory fields #6196

Jiri-Stary opened this issue Aug 7, 2024 · 2 comments
Labels
hdf-converters Issue related to the HDF Converters library

Comments

@Jiri-Stary
Copy link

I run sonarqube2hdf

`docker run --rm -w /share -v ${sarif_files_path}:/share -e SONAR_HOST_URL -e SONAR_TOKEN_GOLDENFROG mitre/saf:1.4.8 convert sonarqube2hdf -n ${{ inputs.SONAR_PROJECT_KEY || steps.sonar-properties.outputs.project-key}} -u $SONAR_HOST_URL --auth $SONAR_TOKEN -o ./hdf/sonarqube_scan.json "

`
and afterwards i need to manually modify couple fields so i can convert it to sarif

using :


        - name: SARIF Multitool
          if: ${{  always()  && steps.sonarqube-query-json.outcome == 'success' }}
          uses: microsoft/[email protected]
          with:
                # Command to be sent to SARIF Multitool
                command: 'convert  ./hdf/sonarqube_scan.json -t Hdf --output ./hdf/sonarqube_scan.sarif'

The issue:

sonarqube2hdf command is generating "null" where SARIF multitool expect a specific value.
My workround is to use sed and replace null with empty values which does work:

There are 2 problematic fields which are "mandatory" - version , code

"profiles": [
{
"name": "Sonarqube Scan",
"version": null,`

Could you take a look on this please?

@Amndeep7
Copy link
Contributor

Thanks for bringing this to our attention @Jiri-Stary. We'll take a look.

@Amndeep7 Amndeep7 transferred this issue from mitre/saf Sep 17, 2024
@Amndeep7 Amndeep7 added the hdf-converters Issue related to the HDF Converters library label Sep 17, 2024
@Amndeep7
Copy link
Contributor

Hi @Jiri-Stary. It seems like the SARIF multi-tool currently has an issue which is making it impossible for me to test locally: "BUG: Fix ERR999.UnhandledEngineException: System.IO.FileNotFoundException: Could not find file when a file name or directory path contains URL-encoded characters.". We will need to wait until that bugfix is released before I can test any changes I make using that utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hdf-converters Issue related to the HDF Converters library
Projects
None yet
Development

No branches or pull requests

2 participants