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

searching FindSecBugs findings in SonarQube API with cwe URL parameter #303

Closed
lcapellino opened this issue Mar 10, 2020 · 1 comment
Closed

Comments

@lcapellino
Copy link

searching FindSecBugs findings in SonarQube API with cwe URL parameter

I was tyring to search for issues in a project in SonarQube via the API. Especially for those that are marked as sql-injections (CWE-89). For Example

http://localhost:9000/api/issues/search?componentKeys=projectkey&cwe=89

I noticed that FindSecBugs rules are not shown if you search by the CWE-89 id. The only way to display FindSecBugs rules is to use cwe=unknown as a url parameter.

Is there a way to add CWE details to FindSecBugs rules via the API?

I did some research and maybe found a solution to this:

For example: The default Java Rules are written in JSON and have additional elements that give information about the rule. e.g.:

//The standard Java rules have this 
  "securityStandards": {
    "CWE": [
      564,
      89,
      20,
      943
    ],
    "OWASP": [
      "A1"
    ]
  }

This example is from: https://github.com/SonarSource/sonar-java/blob/master/java-checks/src/main/resources/org/sonar/l10n/java/rules/java/S2077_java.json

The rules from FindSecBugs do not have this element, can you simply add this to the rules.xml?

Component Version
SonarQube Community EditionVersion 8.0 (build 29455)
Sonar-FindBugs 3.11.1
@gtoison
Copy link
Contributor

gtoison commented Dec 3, 2021

Sorry for the belated answer
Correct me if I misunderstood but this is the same problem as what was discussed here: #392

@gtoison gtoison closed this as completed Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants