Skip to content
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

Fix async fincding import #11784

Closed

Conversation

FirePanda169
Copy link

Description

Adding missing decorator for findings import function

Test results

...

@github-actions github-actions bot added docker settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR apiv2 docs unittests integration_tests ui parser helm localization labels Feb 10, 2025
Copy link

DryRun Security Summary

The pull request addresses multiple security concerns in the DefectDojo project, including sensitive information exposure, configuration risks, and potential vulnerabilities, while also implementing security improvements across GitHub Actions workflows, Docker configurations, and Python scripts.

Expand for full summary

The pull request introduces updates to multiple GitHub Actions workflow files, Docker configurations, and various Python scripts across the DefectDojo project. Key security findings include:

  1. Sensitive Information Exposure:

    • Docker Compose file contains default credentials (database password: 'defectdojo')
    • Kubernetes tests script exposes admin password retrieval
    • Multiple entrypoint scripts print potentially sensitive configuration details
  2. Configuration Risks:

    • Default admin user settings with predictable credentials
    • HTTP (not HTTPS) used in some connectivity checks
    • Broad environment variable configurations
    • Potential supply chain risks from direct GitHub repository dependencies
  3. Potential Vulnerabilities:

    • Insecure curl requests with --insecure flag
    • Hardcoded Chrome and ChromeDriver URLs
    • Default TLS certificate generation with predictable details
    • Permissive file permissions in some Docker configurations
  4. Security Improvements:

    • Pinned GitHub Actions to specific commit hashes
    • Non-root user configurations in Docker images
    • Specific image SHA256 hash pinning
    • Improved error handling in shell scripts

No single critical vulnerability was identified, but the cumulative security observations suggest a need for careful configuration management and credential handling in the DefectDojo project.

Code Analysis

We ran 9 analyzers against 30 files and 3 analyzers had findings. 6 analyzers had no findings.

Analyzer Findings
Configured Codepaths Analyzer 17 findings
Sensitive Files Analyzer 2 findings
Authn/Authz Analyzer 4 findings

Overall Riskiness

🔴 Risk threshold exceeded.

We've notified @mtesauro, @grendel513.

View PR in the DryRun Dashboard.

@FirePanda169 FirePanda169 changed the base branch from bugfix to dev February 10, 2025 14:28
@FirePanda169
Copy link
Author

There is also a suggestion for optimization. Use asynchronous import only if more than 1 task will be created. For one chunk, it will definitely be useful.
Perhaps make the threshold 2 * ASYNC_FINDING_IMPORT_CHUNK_SIZE.
What do you think?

if settings.ASYNC_FINDING_IMPORT:
rewrite to
if settings.ASYNC_FINDING_IMPORT and settings.ASYNC_FINDING_IMPORT_CHUNK_SIZE < len(parsed_findings):

@Maffooch
Copy link
Contributor

Hi @FirePanda169 there is a good chance that the async importer will be deprecated soon per the quarterly update discussion: #11199

I do not have details at this time when the final call will be made on that, but it is an experimental feature that has some unexpected behaviors, and I would advise against using it

@FirePanda169
Copy link
Author

it's sad because importing a lot of findings becomes a problem without a solution.
I tried to come up with something to use Finding.objects.bulk_create(...). But the rewritten save method doesn't let me do it easily.

@valentijnscholten
Copy link
Member

valentijnscholten commented Feb 10, 2025

nvm, didn't saw the existing replies.

@Maffooch
Copy link
Contributor

@FirePanda169 after talking amongst the other moderators, we have decided to move forward with deprecating this feature. Please make plans to disable async import

@Maffooch Maffooch closed this Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apiv2 docker docs helm integration_tests localization parser 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.

3 participants