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

Allow None Option for Active/Verified on Import/Reimport to Mirror UI Options #11447

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

hblankenship
Copy link
Collaborator

@hblankenship hblankenship commented Dec 20, 2024

The help on the Active/Verified options for the Import and Reimport Scan APIs is misleading. The help says 'Override the active setting from the tool' and 'Override the verified setting from the tool' which suggests that True means 'Yes, do that', and False would mean 'No, don't override the tool'. However, viewed that way, there is no way to set the Active/Verified, just a way to say 'override' it with "something". The UI allows for a third option: "None" which means do NOT override the tool instead of Override the Tool with This Setting. This PR allows the API to also have a 'None' option and updates the help text to match what is given in the UI.

fixes #11235

[sc-9259]

@github-actions github-actions bot added the apiv2 label Dec 20, 2024
Copy link

DryRun Security Summary

The pull request updates the help text for active and verified fields in the CommonImportScanSerializer class within the dojo/api_v2/serializers.py file, allowing more flexible configuration of finding statuses while maintaining a focus on potential security considerations.

Expand for full summary

Summary:

The code changes in this pull request are related to the dojo/api_v2/serializers.py file, which contains serializers for various models in the Defect Dojo application. The key changes involve updating the help text for the active and verified fields in the CommonImportScanSerializer class. These fields can now be used to force the findings to be active/inactive or verified/not verified, or to default to the original tool settings (None).

From an application security perspective, these changes do not introduce any obvious security concerns. However, it's important to ensure that the validation logic in these serializers is robust and that they properly handle edge cases and malformed input to prevent potential security vulnerabilities, such as injection attacks or unauthorized data modifications. Additionally, it's worth reviewing the overall security practices and controls in the Defect Dojo application, such as input validation, access control, and logging, to ensure that the application is secure and resilient against common web application security threats.

Files Changed:

  • dojo/api_v2/serializers.py: The changes in this file update the help text for the active and verified fields in the CommonImportScanSerializer class. These fields can now be used to force the findings to be active/inactive or verified/not verified, or to default to the original tool settings (None). The changes do not introduce any obvious security concerns, but it's important to ensure that the validation logic in the serializers is robust and that the application's overall security practices are sound.

Code Analysis

We ran 9 analyzers against 1 file and 0 analyzers had findings. 9 analyzers had no findings.

View PR in the DryRun Dashboard.

@hblankenship hblankenship linked an issue Dec 20, 2024 that may be closed by this pull request
2 tasks
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 15b3b5a into bugfix Dec 27, 2024
74 checks passed
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.

When importing a Github scan via API the Status of the finding is wrong
5 participants