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

Make the number of request/response pairs returned by the API configurable #9967

Merged
merged 10 commits into from
Apr 22, 2024

Conversation

hblankenship
Copy link
Contributor

Description
[sc-5238]
Implemented a new variable, DD_MAX_REQRESP_FROM_API, to allow a limit to the number of request/response pairs that are returned via the API. The default value is -1, meaning no limit to maintain current functionality.

Test results

Tested with multiple values for MAX_REQRESP_FROM_API: 5, 10, 18, 100, -1, -100
See included unittest for more
All tests pass

Documentation

Updated the DOCKER.md file to include updated instructions for running single or more tests in the container

Copy link

dryrunsecurity bot commented Apr 19, 2024

Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.

DryRun Security Status Findings
AppSec Analyzer (beta) 0 findings
Secrets Analyzer 0 findings
Authn/Authz Analyzer 1 findings
Configured Codepaths Analyzer 4 findings
Sensitive Files Analyzer 1 findings

Note

🔴 Risk threshold exceeded. Adding a reviewer if one is configured in .dryrunsecurity.yaml.

notification list: @mtesauro @grendel513

Tip

Get answers to your security questions. Add a comment in this PR starting with @DryRunSecurity. For example...

@dryrunsecurity What are common security issues with web application cookies?

Powered by DryRun Security

@github-actions github-actions bot added settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR apiv2 docs unittests labels Apr 19, 2024
@cneill cneill changed the title Hb dev reqresp branch Make the number of request/response pairs returned by the API configurable Apr 20, 2024
Copy link
Collaborator

@cneill cneill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment to make the environment variable's purpose a little clearer. I'm also not sure it makes sense to have a 0 value return 0 results here - I doubt anyone would want to force returning 0 req/resp pairs globally, but I'll leave that up to you to decide.

dojo/settings/settings.dist.py Outdated Show resolved Hide resolved
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

Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com>
@mtesauro mtesauro merged commit 65bc290 into DefectDojo:dev Apr 22, 2024
122 of 123 checks passed
hblankenship added a commit to hblankenship/django-DefectDojo that referenced this pull request Apr 26, 2024
…rable (DefectDojo#9967)

* limit req response via setting

* add unittest

* update running test documentation

* also must do here

* fix linting, add urls.py

* trailing space in a comment...

* switch back to finding - different test uses it

* change test data to not break

* reset data, use my own

* Update dojo/settings/settings.dist.py

Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com>

---------

Co-authored-by: Charles Neill <1749665+cneill@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apiv2 docs settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants