Rest Framework Tests: Isolate tests by request type#10387
Conversation
|
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and 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 changes in this pull request are focused on improving the overall quality and security of the REST API implementation in the DefectDojo application. The main changes involve adding comprehensive unit tests for various REST API endpoints, covering different request types (Retrieve, List, Create, Update, Delete) and permission types (Object-based, Configuration-based). The tests ensure that the API endpoints are functioning as expected and that the responses are compliant with the defined OpenAPI 3 schema. From a security perspective, the changes address key aspects such as sensitive data handling, authorization checks, schema validation, and severity validation. These improvements help identify and prevent potential security vulnerabilities that may arise from incorrect or unexpected API behavior. Files Changed:
Powered by DryRun Security |
In an attempt to isolate various functions of the rest framework tests to create a more dependable testing environment, I stumbled upon the real issue here. When running the delete preview test (this is the one that is consistently failing), the first step in the test is to first get all objects in the database by calling the LIST endpoint, and then getting the first one in the list
The problem here is that MySQL and Postgres may be sorting things differently (from the minimal reading I have done so far) and can give a theory for why these issues only really appeared when switching databases for the unit tests
The solution here is going to be to add another parameter that will allow for specifying the ID of each test to making update/delete requests within these tests
[sc-6382]