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

updated anchore engine parser for upto date output format #11805

Open
wants to merge 3 commits into
base: bugfix
Choose a base branch
from

Conversation

pUrGe12
Copy link
Contributor

@pUrGe12 pUrGe12 commented Feb 12, 2025

Description

According to the discussion at #11552 I have updated the anchore engine parser for the relevant output format.

Test results

Have tested it locally using the provided file in #11552. I didn't have more files so haven't tried others.

Documentation

Have updated the docs to include the relevant information

Checklist

This checklist is for your information.

  • Make sure to rebase your PR against the very latest dev.
  • Features/Changes should be submitted against the dev.
  • Bugfixes should be submitted against the bugfix branch.
  • Give a meaningful name to your PR, as it may end up being used in the release notes.
  • Your code is flake8 compliant.
  • Your code is python 3.11 compliant.
  • If this is a new feature and not a bug fix, you've included the proper documentation in the docs at https://github.com/DefectDojo/django-DefectDojo/tree/dev/docs as part of this PR.
  • Model changes must include the necessary migrations in the dojo/db_migrations folder.
  • Add applicable tests to the unit tests.
  • Add the proper label to categorize your PR.

Copy link

dryrunsecurity bot commented Feb 12, 2025

DryRun Security Summary

The pull request modifies the Anchore Engine parser and documentation while introducing various security concerns including information exposure risks, input validation weaknesses, file handling vulnerabilities, severity mapping issues, and critical vulnerabilities in test data.

Expand for full summary

The pull request updates the Anchore Engine parser and related documentation, modifying JSON structure, vulnerability parsing, and test cases across multiple files. Security findings include:

  1. Potential Information Exposure:
  • Hardcoded file paths with potential timestamps in parser code
  • Full image digest and internal path details in documentation example
  • Prints full image hash in vulnerability description
  1. Input Validation Concerns:
  • Limited JSON input validation
  • Relies on .get() method with default values
  • Potential for silent failures with malformed input
  • No explicit schema validation
  • Accepts "Unknown" as a valid vulnerability ID
  1. File Handling Risks:
  • No explicit file size or type validation
  • Potential resource exhaustion with large files
  • User-provided file path without sanitization
  1. Severity Mapping Issues:
  • Converts "negligible" and "unknown" severities to "Info"
  • May mask potential security risks
  1. Critical Vulnerabilities in Test Data:
  • Multiple critical CVEs detected (e.g., CVE-2024-50379 with CVSS 9.8)
  • Extensive list of vulnerabilities across different severity levels

Code Analysis

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

View PR in the DryRun Dashboard.

@pUrGe12
Copy link
Contributor Author

pUrGe12 commented Feb 13, 2025

I think I am going astray. Does changing the parser and data input require some database config changes as well?

@mtesauro
Copy link
Contributor

@pUrGe12 There was an fix added to 2.43.2 that was released yesterday that should fix the tests that are failing for you.
Can you rebase this PR?

@pUrGe12
Copy link
Contributor Author

pUrGe12 commented Feb 14, 2025

That didn't work. Should I rebase onto master, cause now I did onto bugfix? Also, is there a way to run the docker tests locally?

@Maffooch
Copy link
Contributor

@pUrGe12 it looks like the failing tests are related to the anchore changes made in this PR

@pUrGe12
Copy link
Contributor Author

pUrGe12 commented Feb 15, 2025

Can you let me know why that's happening?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants