-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Settings SHA: The Removal #11299
Settings SHA: The Removal #11299
Conversation
DryRun Security SummaryThe pull request primarily focuses on updates to the unit tests, configuration management, and release management processes of the DefectDojo application, with minimal impact on the application's security posture. Expand for full summarySummary: The code changes in this pull request primarily focus on updates to the unit tests, configuration management, and release management processes of the DefectDojo application. None of the changes appear to introduce any obvious security vulnerabilities, and the overall impact on the application's security posture is minimal. The key changes include the removal of unused imports and functionality from the unit tests, simplification of the configuration loading process by removing an integrity check for the While the changes do not directly impact the security of the application, it's important to ensure that the security-related settings in the Files Changed:
Code AnalysisWe ran
|
Q: If |
@kiblik Taking a step back, I'm curious the benefit you thought came from the current sha256sum of settings.dist.py. To me, it was a signal to users that they shouldn't be editing settings.dist.py but using local_settings.py for their deploy customizations. Your reply focuses more on hash codes so I'm wondering if I missed something about the original intent of adding that sha256sum check. |
Thank you @mtesauro. Good point, I haven't described my story behind it. |
What if we just add this information to the documentation? |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There is already a pretty good entry in the documentation warning about the changing What scares me about moving deduplication settings out of settings.py is that I fear they may not be configurable without rebuilding images. If that were not an issue, and the task was still to move ~85 dedupe settings to the parser level, it makes me wonder: Is all of that work (and potential migration woes/instability on update) worth it to keep an integrity check? |
It is sorta humorous to me that removing the integrity check is causing conflicts around the integrity check 😅 |
It seems like the only way to make this less painful would be to auto-generate the checksum at PR merge and/or release time, rather than asking developers to manage it. This would prevent merge conflicts while preserving the original intent, which I think has some value. Today, auto-generation only happens as part of automated merges, e.g. dev -> master, but it could in principle be extended to all PR merges that affect the settings file. This would require a flag (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need to announce the removal of this check in our release notes, but just wanted to note that we included it in the release notes in the original PR
Hi everybody,
On the other hand, we might totally turn around perspective: Do not build walls but ask the question "Why are people editing these files"? In my opinion, it might be tightly connected to the quality of documentation and the way how it is written. This is not about blaming somebody. I was also participating on it in some way. If Configuration section in docs starts with the words "The main settings are stored in
Hint (for somebody who will implement a validator): >>> from dojo.settings import settings
>>> for key, (key_type, default) in settings.env.scheme.items():
... print(f"Key:{key}\tType:{key_type}\tDefault:{default}")
...
Key:DD_SITE_URL Type:<class 'str'> Default:http://localhost:8080
Key:DD_DEBUG Type:<class 'bool'> Default:False
Key:DD_TEMPLATE_DEBUG Type:<class 'bool'> Default:False
Key:DD_LOG_LEVEL Type:<class 'str'> Default:
Key:DD_DJANGO_METRICS_ENABLED Type:<class 'bool'> Default:False
Key:DD_LOGIN_REDIRECT_URL Type:<class 'str'> Default:/
... |
Sorry, I'm late to this party, have had some non-DefectDojo stuff keeping me from engaging at my normal level - it seems to me that we should do thing in phases / iteratively.
The irony of having this PR have a merge conflict for the very thing we're wanting to remove isn't lost on me. 🤕 FWIW, I'm going to go ahead and approve this with the understanding that @Maffooch can sort out the merge conflict before it's actually merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Conflicts have been resolved. A maintainer will review the pull request shortly. |
DD could help admins by displaying the effective settings/environment on a page. With some care around secrets / obfuscation. Or/additionally they could be displayed on start-up. Hopefully this will help admins before they come to #slack or @github. Was it ever considered to only apply the check on official releases, or builds made from |
Following the introduction of the settings.dist.py integrity check, it has made contributing to DefectDojo more challenging. As PRs are merged with settings changes for parsers, vulnerability IDs, and new environment variables, everyone else with similar changes will now have conflicts. At times this could impact many people at once, and even multiple times within a singe PR.
Thought the integrity check is a great idea in enforcing that settings.dist.py not be touched, the tradeoff for ease of development is a turnoff for contributors
[sc-8583]