Skip to content

Conversation

kiblik
Copy link
Contributor

@kiblik kiblik commented Jan 24, 2025

Add rule PLW0127 and fix it

Copy link

dryrunsecurity bot commented Jan 24, 2025

DryRun Security Summary

The code changes encompass minor optimizations and bug fixes across multiple Python files related to security scanning tool parsers, including improvements to compliance result parsing, location handling, and vulnerability information extraction, with no significant security implications.

Expand for full summary

Summary:

The provided code changes cover several Python files related to different security scanning tools and their corresponding parsers. The changes appear to be mostly minor optimizations and bug fixes, with no significant security implications. However, it's important to review the overall functionality of these parsers to ensure they are effectively handling and processing security-related information.

The key changes include:

  1. Removal of redundant code in the __parse_anchore_compliance function of the parser.py file, which handles parsing Anchore compliance results.
  2. Improvements to the handling of the locations list in the _build_common_output function of the mend/parser.py file, ensuring the output does not exceed a specific character limit.
  3. Minor fixes to the get_item() function in the npm_audit_7_plus/parser.py file, which is responsible for parsing the output of the NPM Audit tool.
  4. A minor change to the get_finding_trace_info function in the govulncheck/parser.py file, which handles parsing the output of the Govulncheck scanner for Go applications.
  5. An update to the ruff.toml configuration file, adding a new linting rule to the Ruff linter.

Overall, these changes appear to be focused on improving the functionality and robustness of the various security scanning tool parsers, without introducing any significant security vulnerabilities. However, it's important to ensure that the parsers are properly handling and processing security-related information, as they play a crucial role in the application's overall security posture.

Files Changed:

  1. dojo/tools/dsop/parser.py: The changes in this file are related to the __parse_anchore_compliance function, which handles parsing the "Anchore Compliance Results" sheet in an XLSX file. The changes remove a redundant line of code and do not introduce any security implications.

  2. dojo/tools/mend/parser.py: The changes in this file are focused on the _build_common_output function, which handles the locations list. The changes ensure that the total length of the concatenated locations does not exceed a specific character limit, which is an important security enhancement.

  3. dojo/tools/npm_audit_7_plus/parser.py: The changes in this file are minor, removing a redundant variable assignment in the get_item() function. The overall parser functionality appears to be well-designed for handling the output of the NPM Audit tool.

  4. dojo/tools/govulncheck/parser.py: The changes in this file are a minor fix to the variable assignment in the get_finding_trace_info function, which is responsible for extracting vulnerability information from the Govulncheck scanner output.

  5. ruff.toml: The changes in this file update the ruff.toml configuration, adding a new linting rule to the Ruff linter. This change is not directly related to security, but it can help improve the overall code quality and maintainability of the project.

Code Analysis

We ran 9 analyzers against 5 files and 0 analyzers had findings. 9 analyzers had no findings.

View PR in the DryRun Dashboard.

@kiblik kiblik requested a review from Maffooch January 25, 2025 10:14
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

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

@Maffooch Maffooch merged commit 4306a58 into DefectDojo:dev Feb 6, 2025
73 checks passed
@kiblik kiblik deleted the ruff_PLW0127 branch February 6, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants