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

Request/Response API CRUD Endpoints #11365

Merged
merged 19 commits into from
Dec 19, 2024
Merged

Request/Response API CRUD Endpoints #11365

merged 19 commits into from
Dec 19, 2024

Conversation

hblankenship
Copy link
Collaborator

Added an endpoint with full CRUD for Request/Response Pairs.

[sc-8980]

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

dryrunsecurity bot commented Dec 3, 2024

DryRun Security Summary

The pull request focuses on enhancing Defect Dojo's handling of Burp Suite scan data by introducing a new ViewSet, serializer, and unit tests for managing raw request and response information while potentially deprecating an existing model.

Expand for full summary

Summary:

The code changes in this pull request are focused on the handling and management of Burp Suite scan data within the Defect Dojo application. The key changes include:

  1. Removal of the BurpRawRequestResponse Model: The changes involve the removal of the BurpRawRequestResponse model from the unittests/test_apiv2_methods_and_endpoints.py file, which suggests that the functionality related to Burp Suite integration is being deprecated or removed from the application.

  2. Addition of the BurpRawRequestResponseViewSet: A new BurpRawRequestResponseViewSet has been added to the Django REST Framework (DRF) API version 2 of the Dojo application. This ViewSet is responsible for handling the API endpoints related to Burp raw request and response data.

  3. Implementation of the BurpRawRequestResponseMultiSerializer: A new serializer class called BurpRawRequestResponseMultiSerializer has been added to handle the serialization and validation of Burp raw request and response data.

  4. Unit Tests for Burp Raw Request and Response Handling: The changes include the addition of new unit tests in the unittests/test_rest_framework.py file to test the functionality of the BurpRawRequestResponse API endpoint, including the ability to create, update, and delete records.

From an application security perspective, the changes related to the handling of Burp Suite scan data are generally positive, as they provide the ability to store and manage this sensitive information within the Defect Dojo application. However, it's important to ensure that the implementation of these features follows best practices for handling sensitive data, such as proper sanitization and validation of user input, appropriate access controls, and secure storage and transmission of the raw request and response data.

Files Changed:

  1. unittests/test_apiv2_methods_and_endpoints.py: The changes involve the removal of the BurpRawRequestResponse model, which suggests that the functionality related to Burp Suite integration is being deprecated or removed from the application.
  2. dojo/urls.py: The changes include the addition of a new BurpRawRequestResponseViewSet to the Django REST Framework (DRF) API version 2 of the Dojo application.
  3. dojo/api_v2/serializers.py: The changes introduce a new BurpRawRequestResponseMultiSerializer class to handle the serialization and validation of Burp raw request and response data.
  4. dojo/api_v2/views.py: The changes include the implementation of the BurpRawRequestResponseViewSet, which is responsible for handling the API endpoints related to Burp raw request and response data.
  5. unittests/test_rest_framework.py: The changes include the addition of new unit tests to test the functionality of the BurpRawRequestResponse API endpoint, including the ability to create, update, and delete records.

Code Analysis

We ran 9 analyzers against 5 files and 1 analyzer had findings. 8 analyzers had no findings.

Analyzer Findings
Sensitive Files Analyzer 1 finding

View PR in the DryRun Dashboard.

@hblankenship hblankenship marked this pull request as ready for review December 5, 2024 17:24
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

dojo/api_v2/serializers.py Outdated Show resolved Hide resolved
dojo/api_v2/views.py Outdated Show resolved Hide resolved
dojo/api_v2/serializers.py Outdated Show resolved Hide resolved
dojo/api_v2/serializers.py Outdated Show resolved Hide resolved
dojo/api_v2/serializers.py Outdated Show resolved Hide resolved
unittests/test_rest_framework.py Outdated Show resolved Hide resolved
dojo/api_v2/views.py Outdated Show resolved Hide resolved
@Maffooch Maffooch merged commit c195368 into dev Dec 19, 2024
75 checks passed
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