Repository navigation
Conversation
"SonarQube Scan" imports of /api/issues/search and /api/hotspots/search JSON titled findings as <rule>_<key>, while "SonarQube API Import" uses the SonarQube message. Use the message here too (truncated like the API importer), falling back to <rule>_<key> when the message is empty. The title is not part of the SonarQube Scan dedup hash, so existing findings still match on reimport and keep their old title. Closes DefectDojo#16115
|
This pull request modifies sensitive codepaths in
Configured Sensitive Codepath Modified by Non-Allowed Author in
|
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/db_migrations/0299_finding_test_numsev_index.py' matches configured sensitive codepath pattern 'dojo/db_migrations/*.py' and was modified by 'cvas22' (commit 23f3ee2) who is not in the allowed authors list. |
Configured Sensitive Codepath Modified by Non-Allowed Author in dojo/finding/models.py (drs_5b4143cf)
| Vulnerability | Configured Sensitive Codepath Modified by Non-Allowed Author |
|---|---|
| Description | File 'dojo/finding/models.py' matches configured sensitive codepath pattern 'dojo/finding/*.py' and was modified by 'cvas22' (commit 23f3ee2) who is not in the allowed authors list. |
Comment to provide feedback on these findings.
Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]
Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing
All finding details can be found in the DryRun Security Dashboard.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16115.
Summary
When you import SonarQube REST API JSON (
/api/issues/search,/api/hotspots/search, or a zip of those files) as SonarQube Scan, each finding was titled<rule>_<key>, for exampletypescript:S1533_fjoiewfjoweifjoihugu-. SonarQube API Import titles the same issues with SonarQube'smessage. This PR makes SonarQube Scan use themessagetoo:message. A message longer than 511 characters is cut to 507 characters plus..., the same rule asdojo/tools/api_sonarqube/importer.py.messageis empty, the title falls back to<rule>_<key>.ruleandkeyare still in the description, andunique_id_from_toolis unchanged.Effect on existing data
cwe,severity,file_path), and the detailed mode dedups onunique_id_from_tool. So on reimport, existing findings still match, keep their old<rule>_<key>title, and are not duplicated or closed.legacydedup algorithm, which matches on title. There, the first reimport after upgrading re-creates findings with the new title and closes the old ones. The parser docs now say this.Changes
dojo/tools/sonarqube/sonarqube_restapi_json.py: newget_title()helper, used for all four finding types.unittests/tools/test_sonarqube_parser.py: updated the 9 old title assertions and addedtest_parse_json_file_issue_16115_title_from_message, which covers a normal message, the empty-message fallback and truncation. It fails without the parser change.unittests/scans/sonarqube/issue_16115.json: a small fabricated fixture.docs/content/supported_tools/parsers/file/sonarqube.md: a new "Finding Title" section.