Skip to content

Conversation

@kiblik
Copy link
Contributor

@kiblik kiblik commented May 16, 2025

Finish of #11300

@kiblik kiblik requested review from Maffooch and mtesauro as code owners May 16, 2025 15:30
@github-actions github-actions bot added New Migration Adding a new migration file. Take care when merging. apiv2 unittests ui labels May 16, 2025
@kiblik kiblik changed the title SLA config: allow to use it on all levels feat(SLA config): allow to use it on all levels May 16, 2025
@dryrunsecurity
Copy link

dryrunsecurity bot commented May 16, 2025

DryRun Security

This pull request reveals multiple security concerns including potential race conditions during SLA configuration updates, information disclosure risks through verbose error messages, configuration-based security vulnerabilities that could bypass access controls, and a potential authentication weakness involving hardcoded admin tokens in test environments.

💭 Unconfirmed Findings (4)
Vulnerability Potential Race Conditions
Description Multiple files show synchronization risks during SLA configuration updates, with async updating mechanisms that could potentially be exploited or cause service disruption. Specific risks are present in models.py, engagement/views.py, and unittests/test_finding_model.py.
Vulnerability Information Disclosure Risks
Description Detailed messages and popovers expose internal system processes and configuration details. Verbose error handling and configuration change messages could leak system internals, identified in files like engagement/views.py, forms.py, templates/dojo/view_eng.html, and test/views.py.
Vulnerability Configuration-based Security Risks
Description New setting SLA_CONFIG_ON_NON_PRODUCT_LEVELS could bypass existing access controls. Dynamic configuration loading without strict validation presents potential for unintended configuration behaviors, found in settings/settings.dist.py and models.py.
Vulnerability Potential Authentication Weakness
Description Hardcoded admin token used in test environment, which could indicate risky authentication practices if similar patterns exist in production. This was discovered in unittests/test_finding_model.py.

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

@kiblik kiblik marked this pull request as draft May 16, 2025 15:42
@kiblik kiblik force-pushed the sla_config_other_layers branch 2 times, most recently from 8fa0ca6 to 3fe613a Compare May 16, 2025 21:11
@kiblik kiblik marked this pull request as ready for review May 16, 2025 22:05
@Maffooch
Copy link
Contributor

Hi @kiblik I think the line of thinking from the previous comment is still valid here

@kiblik kiblik force-pushed the sla_config_other_layers branch from 3fe613a to 364ac7c Compare May 28, 2025 13:25
@kiblik kiblik force-pushed the sla_config_other_layers branch from 364ac7c to a1f2759 Compare May 28, 2025 15:32
@github-actions github-actions bot added the settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR label May 29, 2025
@kiblik kiblik marked this pull request as draft May 29, 2025 21:53
@kiblik kiblik force-pushed the sla_config_other_layers branch from 56169aa to 0c6eee3 Compare May 30, 2025 07:32
@kiblik
Copy link
Contributor Author

kiblik commented May 30, 2025

Hi @kiblik I think the line of thinking from the previous comment is still valid here

Hi @Maffooch,

  • regarding documentation/explanation (how does it work), the fields have a description which is accessible as a hint:
Screenshot 2025-05-28 at 17 39 42 Screenshot 2025-05-28 at 17 39 05
  • If it is necessary to add a couple of words to the documentation, I can write them down. Do you have a recommendation for which documentation page? Or should I create a new one?
  • Regarding performance, I changed the implementation to opt-in mode, so users can decide to enable it. Or can I which it to opt-out?

Are there any other doubts that I should fix or explain?

@kiblik kiblik marked this pull request as ready for review May 30, 2025 09:12
@kiblik
Copy link
Contributor Author

kiblik commented Jun 5, 2025

@Maffooch / @mtesauro, can I know your opinion, please?

@Maffooch
Copy link
Contributor

Maffooch commented Jun 6, 2025

The fear here is that we complicate the model, API, documentation, etc. Even if this feature were to be opt in thing from the UI, the code base cannot opt out

@kiblik
Copy link
Contributor Author

kiblik commented Jun 10, 2025

The fear here is that we complicate the model, API, documentation, etc. Even if this feature were to be opt in thing from the UI, the code base cannot opt out

I suppose the adjustment of the model was expected from the beginning (assignment of specific SLA Config needs to be stored somewhere), but this kind of concern has not been raised at the beginning when we were talking about implementation: #10025

I'm willing to scale it down only to Engagement if it would help (even though I still believe there is reason to have it on Test level as well).

Complexity of API? I'm not sure, as there are only two more fields (sla_configuration for Eng and Test) that users can assign. I see that there are new fields (e.g. pro in CommonImportScanSerializer for import and reimport - #12525) that are not usable by non-opensource-users, and they have been added without any complaints.

Documentation? Well, a good product should have good documentation. I'm willing to add it. I just asked where to place it - to keep it as clean as possible - I'm happy to keep it polished and organised.

I agree that adding more and more code to a project makes it harder to maintain. It is the reason regular cleanup of not well-written or not used parts (like Google Sheets or async-eval) should be performed. But I suppose it should not be the reason to stop the development of features that people are happy to use and willing to maintain.

@kiblik
Copy link
Contributor Author

kiblik commented Jun 16, 2025

@Maffooch, did my description help explain why I still believe my idea is reasonable and should be part of the implementation?

@dogboat
Copy link
Contributor

dogboat commented Jul 2, 2025

I appreciate all the work and thought that's been put into this. That said, I'm not certain I agree with the need for SLAs at these levels.

One concern I have isn't just about the complexity this adds to the code; I also worry about what this does to the experience for new/inexperienced DD users. DD has a ton of settings already, and layering on additional "this thing overrides this thing overrides this thing" is a lot for someone inexperienced to wrangle with... and forget about. I think for users that Know What They're Doing ™️ this isn't a problem; but for someone with less experience, I could see them changing an SLA, forgetting about it, and being confused as to what's going on. Or imagine yourself setting DD up for the very first time: there's already a ton of decisions to make, and this adds more. All for functionality that I don't think has been really requested since DD's inception.

Even though it's essentially feature-flagged via setting, it is still yet another setting new users have to make a decision about, and in line with other comments already made it does introduce complexity to reasoning about how the program works.

Just my two cents.

@kiblik
Copy link
Contributor Author

kiblik commented Jul 2, 2025

I appreciate all the work and thought that's been put into this. That said, I'm not certain I agree with the need for SLAs at these levels.

One concern I have isn't just about the complexity this adds to the code; I also worry about what this does to the experience for new/inexperienced DD users. DD has a ton of settings already, and layering on additional "this thing overrides this thing overrides this thing" is a lot for someone inexperienced to wrangle with... and forget about. I think for users that Know What They're Doing ™️ this isn't a problem; but for someone with less experience, I could see them changing an SLA, forgetting about it, and being confused as to what's going on. Or imagine yourself setting DD up for the very first time: there's already a ton of decisions to make, and this adds more. All for functionality that I don't think has been really requested since DD's inception.

Even though it's essentially feature-flagged via setting, it is still yet another setting new users have to make a decision about, and in line with other comments already made it does introduce complexity to reasoning about how the program works.

Just my two cents.

Thank you @dogboat for reaction. I'm happy for this kind of feedback.

I agree that DD became quite large, complex and hard to understand for new users. But as you also mentioned, this is opt-in functionality.
From my experience, new users are usually trying to start a minimal setup and then tune the setting. So I'm sure I agree with "another setting new users have to make a decision about". Testing all possible settings for new users is not in place on daily basis in my opinion.

Regarding, "changing an SLA, forgetting about it, and being confused as to what's going on". I can imagine to add a helper (shown when you hover over SLA value) which might describe policy, how the value was evaluated (like "SLA calculated based to Engagement level override").

@blakeaowens
Copy link
Contributor

@kiblik The main concern I have with this feature is performance. Each time an SLA model instance is changed, or a new one is assigned to a Product, all Findings within it have to have their sla_expiration_date re-calculated. Adding more places for a user to set an SLA directly adds to the potential number of finding.save() operations that will need to be completed to ensure all SLA data is always up-to-date.

@mtesauro
Copy link
Contributor

mtesauro commented Jul 5, 2025

@kiblik I think we've heard from a majority of the DefectDojo moderators/contributors and given the community at large a chance to chime in here. This PR has been open since May so ~2 months of time seems sufficient to gather feedback.

FWIW, I still hold with my initial response to the prior PR here even with the smaller scope of the current PR.

Based on the preponderance of the commenters in this an #11300 those who don't want to add this functionality to DefectDojo have argued:

  • Complexity add in both code and a users use of DefectDojo isn't worth this feature add
  • Performance concerns especially when changing which SLA applies to which findings
  • Lack of a significant desire for this change from the larger DefectDojo community based on feedback here and the prior PR.

We've given amble time for the community to weigh in on this and there's not been a noticeable push from the larger DefectDojo community for this feature add now (or in the prior PR). Those that have commented here have raised concerns about potential negative consequences of the proposed change. So, I think the next action to take is to unfortunately close this PR.

I appreciate your thoughtful replies to the comments on this and the prior PR. You've always done stellar work on DefectDojo and been a positive example to anyone contributing to an open source project. Please know that your professionalism has been noticed beyond just the core moderators to this project.

@mtesauro mtesauro closed this Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apiv2 New Migration Adding a new migration file. Take care when merging. settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR ui unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants