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

SSCToSonarQube - using ssc.vulnerability.queryParam, with 2 or more attributes #77

Open
gnowynot opened this issue Jun 28, 2024 · 3 comments
Labels
question Further information is requested

Comments

@gnowynot
Copy link

Question

Hi,
I would like to ask whether it's possible to include 2 or more attributes in the command line for the json export,

Currently using this parameter --ssc.vulnerability.queryParam=analysis:Exploitable,
but I would like to know the command if including both the analysis:Exploitable and analysis:Bad practice

Thanks a lot.

@gnowynot gnowynot added the question Further information is requested label Jun 28, 2024
@rsenden
Copy link
Contributor

rsenden commented Jun 28, 2024

@gnowynot, the value of the --ssc.vulnerability.queryParam option is passed as the q request parameter to the SSC issues endpoint. The 'Issue Group, Filter & Search' section in the SSC REST Documentation states the following (but note that not all AWB syntax is supported by SSC, like regex-based searches):

image

Same syntax is used for the issue search box in SSC:

image

The only thing I'm not sure about is whether your should pass the URL-encoded or decoded syntax to the --ssc.vulnerability.queryParam option, so you'll need to experiment with this, for example either "--ssc.vulnerability.queryParam=analysis:exploitable analysis:bad practice", --ssc.vulnerability.queryParam=analysis:exploitable+analysis:bad%20practice or similar variants may work.

Please confirm whether you've been able to make this work, and what syntax you used exactly.

@gnowynot
Copy link
Author

gnowynot commented Jul 2, 2024

@gnowynot, the value of the --ssc.vulnerability.queryParam option is passed as the q request parameter to the SSC issues endpoint. The 'Issue Group, Filter & Search' section in the SSC REST Documentation states the following (but note that not all AWB syntax is supported by SSC, like regex-based searches):

image

Same syntax is used for the issue search box in SSC:

image

The only thing I'm not sure about is whether your should pass the URL-encoded or decoded syntax to the --ssc.vulnerability.queryParam option, so you'll need to experiment with this, for example either "--ssc.vulnerability.queryParam=analysis:exploitable analysis:bad practice", --ssc.vulnerability.queryParam=analysis:exploitable+analysis:bad%20practice or similar variants may work.

Please confirm whether you've been able to make this work, and what syntax you used exactly.

Thanks for your reply, unfortunately, it doesn't work though I tried all the combinations. It only reads the first part of the param, and returns the results.

e.g. ssc.vulnerability.queryParam=analysis:exploitable analysis:bad practice, only the results of analysis:exploitable are shown

The only problem I'm having now is how to pass both the filters to the q query parameter, I tried with a "+", but still a no.

@rsenden
Copy link
Contributor

rsenden commented Jul 2, 2024

@gnowynot I'd need to check in more detail then, but not sure when I'll have time for that. You may want to consider using fcli instead; see the fcli ssc action help sonarqube-sast-report command. We migrated most FortifyVulnerabilityExporter functionality to fcli and plan on deprecating FortifyVulnerabilityExporter by the end of this year.

The fcli action doesn't provide any explicit filtering options, but you can easily customize the built-in action to add those request parameters or even do customized client-side filtering for more advanced use cases.

You can also consider implementing a custom filter set (in a custom issue template) on SSC, which allows for more flexible server-side filtering compared to the ad-hoc q request parameter. For example, this will allow you to create a SonarQube Export filter set next to the default Security Auditor View and Quick View filter sets: https://www.microfocus.com/documentation/fortify-software-security-center/2420/SSC_Help_24.2.0/index.htm#SSC_UG/A_Issue_Templ.htm. Added advantage is that you can already check in SSC what vulnerabilities will be exported to SonarQube.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants