Skip to content

Add notification when finding is created via the API#13732

Merged
valentijnscholten merged 5 commits intoDefectDojo:devfrom
Juu:api-finding-notification
Nov 19, 2025
Merged

Add notification when finding is created via the API#13732
valentijnscholten merged 5 commits intoDefectDojo:devfrom
Juu:api-finding-notification

Conversation

@Juu
Copy link
Copy Markdown
Contributor

@Juu Juu commented Nov 18, 2025

This PR adds a notification trigger when a finding is created via the API, like this was already implemented for a finding creation in WebUI.

This was explicitly noted in the UI code with a comment:
TODO: but same should be implemented for API endpoint

@dryrunsecurity
Copy link
Copy Markdown

DryRun Security

🔴 Risk threshold exceeded.

This pull request includes edits to sensitive codepaths in dojo/api_v2/serializers.py and dojo/test/views.py, which triggered warnings that these file changes are considered sensitive and can be configured (including allowed authors and paths) in .dryrunsecurity.yaml. Review and validate these edits against your security/configuration policy before merging.

🔴 Configured Codepaths Edit in dojo/api_v2/serializers.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.
🔴 Configured Codepaths Edit in dojo/test/views.py
Vulnerability Configured Codepaths Edit
Description Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml.

We've notified @mtesauro.


All finding details can be found in the DryRun Security Dashboard.

Copy link
Copy Markdown
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
Copy Markdown
Contributor

@kiblik kiblik left a comment

Choose a reason for hiding this comment

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

Can you write some tests as well, please?

Comment thread dojo/api_v2/serializers.py
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. Can you ask copilot to add the tests as new methods in the TestNotificationTriggersApi class in test_notifications.py?

@valentijnscholten valentijnscholten added this to the 2.53.0 milestone Nov 19, 2025
@valentijnscholten valentijnscholten merged commit 50450e1 into DefectDojo:dev Nov 19, 2025
150 checks passed
Maffooch pushed a commit to valentijnscholten/django-DefectDojo that referenced this pull request Feb 16, 2026
* Add notification when finding is created via the API

* fix: add tests

* fix: Ruff linter COM812 errors

* fix: move tests to test_notifications.TestNotificationTriggersApi

* fix: W293 Blank line contains whitespace

---------

Co-authored-by: Julien Reitzel <jreitzel@veepee.com>
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.

7 participants