-
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
Add scm type to import-scan api method with auto_create_context #11055
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
DryRun Security SummaryThe pull request enhances the Defect Dojo application by adding support for handling the product's source code management (SCM) type, improving validation, enabling engagement deduplication, and adding an optional Expand for full summarySummary: The code changes in this pull request focus on enhancing the functionality of the Defect Dojo application, particularly in the areas of import and reimport processes. The key changes include:
From an application security perspective, the changes do not introduce any obvious security vulnerabilities. However, it's important to ensure that the input validation and sanitization processes throughout the application, especially in areas handling user-provided data, are robust and secure to mitigate risks such as SQL injection or cross-site scripting (XSS) attacks. Files Changed:
Code AnalysisWe ran
Riskiness🔴 Risk threshold exceeded. We've notified @mtesauro, @grendel513. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
Hi @dmarushkin thank you for your contribution! Though I like the approach you took, keeping the auto create context relevant to the necessities that the test and findings need is crucial in making this feature maintainable and easy to understand for newcomers. |
@Maffooch Actualy I looked for way to set default scm-type for all new projects in system settings and the way to set it for each particular project in meta-vars looks like counter-intuitive... Adding it in autocreate context was less affort change. What do you think about adding scm-type as another row in system settings as drop down list of supported options with default value? In finding render first choise is vaule from metavars, second is the one from settings. |
I think it may be better to stick with the work around that you proposed earlier for this particular use case
|
Ok, not a problem, thanks for your time here ) |
Hi guys!
I use private gitlab for my codebase, then I try to load any report into defectdojo via api import-scan with auto_create_context option it does not set scm-type for new project and file links for finding in UI do not render well.
So due to docs I should capcure response for loaded scan, parse created project_id and send another request to api/v2/metadata/ with payload {"project": <captured_project_id>, "name": "scm-type", "value":"gitlab"}. That's not convenient at all )
Please consider this change with additional field product_scm_type in api/v2/import-scan api method. If you set auto_create_context, project and product_scm_type, it will create meta field "scm-type" for the project with project itself and UI file links will be rendered fine acording with used scm.