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

Ruff: Add PLR04 and fix PLR0402 #11713

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Conversation

kiblik
Copy link
Contributor

@kiblik kiblik commented Feb 2, 2025

Add all PLR04* rules and fix manual-from-import (PLR0402)

Copy link

dryrunsecurity bot commented Feb 2, 2025

DryRun Security Summary

The code changes update DefectDojo's configuration and model definitions by enhancing the Ruff linter settings and improving the handling of finding deduplication during deletion operations in the Engagement and Finding models, with a focus on maintaining data integrity and security.

Expand for full summary

Summary:

The provided code changes are primarily focused on updates to the configuration and model definitions of the DefectDojo application, an application security engineering tool. The changes in the ruff.toml file update the configuration of the Ruff linter, a Python code linter, to include additional linting rules. The changes in the dojo/models.py file update the delete() methods of the Engagement and Finding models to handle the deduplication of findings and related data more effectively.

From an application security perspective, the changes in the ruff.toml file do not directly impact the application's security, as they are focused on improving code quality and maintainability. However, it's worth reviewing the exclusions in the [lint.per-file-ignores] section to ensure that they do not inadvertently introduce any potential security vulnerabilities.

The changes in the dojo/models.py file are more security-relevant, as they ensure that the deduplication process is properly handled when deleting engagements and findings. Proper handling of duplicate data is crucial for maintaining data integrity and preventing potential security issues that could arise from orphaned or inconsistent data. These changes are an important improvement to the DefectDojo application's security and data management functionalities.

Files Changed:

  1. ruff.toml: The changes in this file update the configuration of the Ruff linter, a Python code linter, to include a new linting rule ("PLR04") in the [lint] section. While these changes do not directly impact the application's security, it's worth reviewing the exclusions in the [lint.per-file-ignores] section to ensure that they do not inadvertently introduce any potential security vulnerabilities.

  2. dojo/models.py: The changes in this file update the delete() methods of the Engagement and Finding models to call helper functions (prepare_duplicates_for_delete() and finding_delete()) from the dojo.finding.helper module before deleting the engagement or finding. These changes are important for ensuring that the deduplication process is properly handled, which is crucial for maintaining data integrity and preventing potential security issues that could arise from orphaned or inconsistent data.

Code Analysis

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

View PR in the DryRun Dashboard.

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.

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

@mtesauro mtesauro merged commit f9e9e6c into DefectDojo:dev Feb 12, 2025
73 checks passed
@kiblik kiblik deleted the ruff_PLR0402 branch February 12, 2025 07:16
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

Successfully merging this pull request may close these issues.

5 participants