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

API Tags: Add filter for AND expressions #11743

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

Maffooch
Copy link
Contributor

@Maffooch Maffooch commented Feb 5, 2025

When using the tags filter on a finding, the operation applied with multiple tags is an OR, but an AND expression would be desired. To avoid creating some breaking changes, this PR adds new filters with the filters for *tags__and in all the places where tag filters are currently used

[sc-10134]

Copy link

dryrunsecurity bot commented Feb 5, 2025

DryRun Security Summary

This PR implements AND-based tag filtering functionality across multiple files while maintaining security through proper parameter validation.

Expand for full summary

This PR adds new tag filtering capabilities across multiple test and filter files, introducing an AND-based tag filtering mechanism for various API endpoints. No direct security vulnerabilities were identified in the changes to unittests/test_tags.py, unittests/dojo_test_case.py, and dojo/filters.py. However, potential considerations include ensuring proper server-side validation of filter parameters to prevent potential injection or unauthorized filtering scenarios.

Code Analysis

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

View PR in the DryRun Dashboard.

@Maffooch Maffooch changed the title Api-filter-tag-and API Tags: Add filter for AND expressions Feb 5, 2025
@Maffooch Maffooch changed the title API Tags: Add filter for AND expressions API Tags: Add filter for AND expressions Feb 5, 2025
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

Copy link
Contributor

@dogboat dogboat left a comment

Choose a reason for hiding this comment

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

This is great! No real requests, just two questions.

@Maffooch Maffooch merged commit 0fb088f into DefectDojo:bugfix Feb 20, 2025
73 checks passed
@Maffooch Maffooch deleted the api-filter-tag-and branch February 20, 2025 22:44
Maffooch added a commit that referenced this pull request Feb 24, 2025
….0-dev (#11888)

* Update versions in application files

* Return Feedback about wrong File Format in ZAP (#11772)

* Return Feedback about wrong File Format in ZAP

* ruff

* Surveys: Correct Question 404 (#11862)

* Surveys: Correct Question 404

When editing a survey question, a 404 is presented for a valid object. At some point, the content type for Questions changed to `Defect Dojo` (the verbose name of the app) rather than `dojo` (the common name)

There is only one place where the name of the content type is accessed, so adding some backward compatible checks corrected the issue

[sc-10195]

* Update views.py

* API Tags: Add filter for `AND` expressions (#11743)

* API Tags: Add filter for `AND` expressions

* Fix some ruff stuff

* Small corrections

* Update dojo/filters.py

* Release Notes: 2.43.3 (#11857)

* add 2.43.0 changelog

* add 2.43.1

* v2.43.2

* 2.43.3

---------

Co-authored-by: Paul Osinski <paul.m.osinski@gmail.com>

* Docs Updates: Feb (#11791)

* exclude archived docs from search

* rm index files from search results

* fix typo - CWE to CVE

* update external_tools.md with additional windows options

* remove outdated github.io links

* specify that EPSS sync is pro-only

* add universal parser documentation

* add beta notice to Universal Parser

* Update universal_parser.md

* add back defectdojo.com/pricing links

* add scss change to fix 'central column' issue

* add rules engine Pro documentation

* change casing for screenshots

* create pro features list, add to header

* Rename Enabling_Deduplication_within_an_Engagement.png to enabling_deduplication_within_an_engagement.png

* Rename Enabling_Deduplication_within_an_Engagement_2.png to enabling_deduplication_within_an_engagement_2.png

* Rename Enabling_Deduplication_within_an_Engagement_3.png to enabling_deduplication_within_an_engagement_3.png

* Rename Enabling_Deduplication_within_an_Engagement_4.png to enabling_deduplication_within_an_engagement_4.png

---------

Co-authored-by: Paul Osinski <paul.m.osinski@gmail.com>

* Feb docs hotfix (#11870)

* Rename Enabling_Product-Level_Deduplication.png to enabling_product-level_deduplication.png

* Rename Enabling_Product-Level_Deduplication_2.png to enabling_product-level_ceduplication_2.png

* Rename enabling_product-level_ceduplication_2.png to enabling_product-level_deduplication_2.png

* Update versions in application files

* Update versions in application files

* Fixing flake 8

---------

Co-authored-by: DefectDojo release bot <dojo-release-bot@users.noreply.github.com>
Co-authored-by: Cody Maffucci <46459665+Maffooch@users.noreply.github.com>
Co-authored-by: manuelsommer <47991713+manuel-sommer@users.noreply.github.com>
Co-authored-by: Paul Osinski <42211303+paulOsinski@users.noreply.github.com>
Co-authored-by: Paul Osinski <paul.m.osinski@gmail.com>
Co-authored-by: Ross E Esposito <ross@defectdojo.com>
quirinziessler pushed a commit to quirinziessler/django-DefectDojo that referenced this pull request Feb 26, 2025
* API Tags: Add filter for `AND` expressions

* Fix some ruff stuff

* Small corrections

* Update dojo/filters.py
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