-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Finding Groups: Respect minimum severity and active/verified rules when pushing to JIRA #12475
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
base: bugfix
Are you sure you want to change the base?
Finding Groups: Respect minimum severity and active/verified rules when pushing to JIRA #12475
Conversation
🟡 Please give this pull request extra attention during review.This pull request contains multiple security risks, including a confirmed mass assignment vulnerability in a test file, potential information disclosure through error logs and test data, and various configuration and categorization risks that could expose internal system details or compromise security thresholds.
|
Vulnerability | Potential Mass Assignment Vulnerability |
---|---|
Description | The code is potentially vulnerable to Mass Assignment because it uses System_Settings.objects.update(**{field: value}) which allows dynamic attribute setting without explicit validation |
django-DefectDojo/unittests/dojo_test_case.py
Lines 65 to 90 in d9efd8a
return decorator | |
def with_system_setting(field, value): | |
"""Decorator to temporarily set a value in System Settings.""" | |
def decorator(test_func): | |
@wraps(test_func) | |
def wrapper(*args, **kwargs): | |
old_value = getattr(System_Settings.objects.get(), field) | |
# Set the flag to the specified value | |
System_Settings.objects.update(**{field: value}) | |
try: | |
return test_func(*args, **kwargs) | |
finally: | |
# Reset the flag to its original state after the test | |
System_Settings.objects.update(**{field: old_value}) | |
return wrapper | |
return decorator | |
class DojoTestUtilsMixin: | |
def get_test_admin(self, *args, **kwargs): |
💭 Unconfirmed Findings (6)
Vulnerability | Potential Information Disclosure |
---|---|
Description | Risks include detailed error logging in Jira helper that could expose internal system details, and test VCR YAML files revealing network configurations, IP addresses, and account information. |
Vulnerability | Potential Configuration and Authentication Risks |
---|---|
Description | Involves hardcoded authentication tokens in test files and conditional status enforcement in Jira templates that might introduce configuration-dependent security behaviors. |
Vulnerability | Severity Misclassification Risks |
---|---|
Description | Includes downgrading vulnerability severities in npm audit test fixtures and changing severity mapping from 'Trivial' to 'Lowest' in test data, potentially obscuring actual risk levels. |
Vulnerability | Potential Threshold and Categorization Vulnerabilities |
---|---|
Description | Concerns include potential severity threshold bypass in finding group processing and detailed findings categorization that might expose internal classification criteria. |
Vulnerability | Potential Test Data Exposure |
---|---|
Description | Test sample filenames and VCR recordings might inadvertently contain sensitive scan or network information, risking unintended data leakage. |
Vulnerability | Potential Typo-Related Risks |
---|---|
Description | A typo in the method name get_jira_priortiy() could potentially lead to unexpected system behavior or method invocation errors. |
All finding details can be found in the DryRun Security Dashboard.
Per request I've also added syncing of the JIRA Priority field for finding groups based on the current list of qualified findings in the group. |
Fixes #12454 and [sc-11185]
In Defect Dojo single JIRA issues are only pushed of they are "qualified" to be pushed to JIRA:
Active
Verified
(if Verified status is enforced globally or for the JIRA integration)jira_minimum threshold
This PR now enforces these same rules for Finding Groups.
At first I tried to model this the same as for findings where the
status()
method inside the model calculates the status. But I didn't want to clutter themodels.py
with JIRA related logic, so I put everything indojo/jira_link/helper.py
as much as possibleChanges to the Finding Group JIRA issue:
Description is updated. At first I filtered out any findings not matching the active/verified/severity criteria. But this may get confusing if findings get resolved in Defect Dojo they just disappear from JIRA until the JIRA ticket is empty. Same for changes in Severity or Verified fields in findings. The JIRA Group Issue now shows two tables. The first contains findings matching the criteria ("qualified findings"), the second findings that do not match the criteria ("non-qualified findings"). This way JIRA users will always have an overview of the full group.
Status is based on qualified findings
Priority is based on qualified findings
SLA Deadline and due date is based on qualified findings.
Unit tests have been updated, but I can imagine this PR would be a good one to test manually in the UI.