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

Sonarqube flow field contains dict #10290

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

manuel-sommer
Copy link
Contributor

self explanatory (see changes)

Copy link

dryrunsecurity bot commented May 29, 2024

Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.

DryRun Security Status Findings
Configured Codepaths Analyzer 0 findings
Sensitive Files Analyzer 0 findings
AppSec Analyzer 0 findings
Authn/Authz Analyzer 0 findings
Secrets Analyzer 0 findings

Note

🟢 Risk threshold not exceeded.

Change Summary (click to expand)

The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective.

Summary:

The code changes in this pull request focus on improving the handling and reporting of security vulnerabilities detected by the SonarQube static code analysis tool. The changes include updates to the findings_over_api.json file, which contains information about various security issues identified in the "testapplication" project, as well as modifications to the sonarqube_restapi_json.py script, which is responsible for processing the SonarQube REST API responses.

The changes to the findings_over_api.json file provide more detailed information about the identified vulnerabilities, including their CVSS scores, CWE references, and additional context in the form of "flow" entries. This enhanced reporting helps the application security team better understand the nature and impact of the detected issues, which is a positive step towards addressing them.

The updates to the sonarqube_restapi_json.py script focus on improving the robustness and reliability of the SonarQube integration. The changes include better handling of missing or empty values in the JSON data, consistent initialization of various fields, and the extraction of additional vulnerability information (such as CVE and GHSA references). These improvements help ensure that the SonarQube integration can effectively identify and report on security issues within the codebase, even when faced with incomplete or non-standard API responses.

Overall, these code changes demonstrate a proactive approach to application security, with the team actively working to enhance the visibility and reporting of security vulnerabilities. The application security engineer should review the changes to ensure that the additional details provided in the findings_over_api.json file are accurate and that the improvements to the sonarqube_restapi_json.py script do not introduce any unintended security issues.

Files Changed:

  1. unittests/scans/sonarqube/findings_over_api.json:

    • The changes in this file provide more detailed information about security vulnerabilities detected in the "testapplication" project, including their CVSS scores, CWE references, and additional context in the form of "flow" entries.
    • The file now includes details about a vulnerability with a CVSS score of 6.4, related to "Using Component with Known Vulnerability" (CWE-120), and another vulnerability with a CVSS score of 7.5, related to a known vulnerability in the "nimbus-jose-jwt" library (CVE-2023-52428).
  2. dojo/tools/sonarqube/sonarqube_restapi_json.py:

    • The changes in this file focus on improving the handling of missing or empty values in the JSON data returned by the SonarQube REST API.
    • The code now uses the get() method with a default value to handle cases where the JSON data does not contain certain keys or the values are empty, improving the robustness of the code.
    • The changes also include better handling of textRange, flows, tags, and codeVariants fields, ensuring consistent data processing.
    • Additionally, the code now includes improved handling of vulnerability information, extracting details about CVEs and GHSA references from the message field.

Powered by DryRun Security

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Maffooch Maffooch merged commit 409caf1 into DefectDojo:bugfix Jun 3, 2024
123 checks passed
@manuel-sommer manuel-sommer deleted the sonarqube_flowdict branch June 4, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants