django-DefectDojo icon indicating copy to clipboard operation
django-DefectDojo copied to clipboard

Kiuwan CSV Import silently drops some findings

Open flmarkus opened this issue 2 years ago • 6 comments

Bug description When importing a kiuwan CSV report file. Some findings are dropped silently.

The parser in https://github.com/DefectDojo/django-DefectDojo/blob/master/dojo/tools/kiuwan/parser.py does not contain the file column in the description. Therefore findings that have the same description and line content have the same hash even if they are found in different files. This will skip the last found file.

Steps to reproduce

  1. Create a new project
  2. Create a new engagement
  3. Import the testfile kiuwan-testscenario-missing-imports.csv which containes two findings
  4. Only the first finding is imported. The second one is dropped silently

Expected behavior Both findings from the test file are imported and displayed.

Deployment method

  • [ ] Docker Compose
  • [ ] Kubernetes
  • [ ] GoDojo
  • [X] DefectDojo Saas (Pro Account)

Environment information

  • DefectDojo Version 2.30.1 - Pro

Sample scan files kiuwan-testscenario-missing-imports.csv kiuwan-testscenario-missing-imports-working.csv

The second file contains the same import line from the first file to proof that the line itself does not contain any issues. It can imported successfully if the first line does not exist.

flmarkus avatar Jan 10 '24 11:01 flmarkus

This can be closed @mtesauro

manuel-sommer avatar Jan 10 '24 22:01 manuel-sommer

Thanks for the fast response @manuel-sommer.

Unfortunately this does not solve our issue. I tested you changes from the lasted dev branch.

In the attached test file I manually edited the CVE number to be able to better distinguish the results in the UI. In the real export from kiuwan the CVE is the same in both lines.

This file better refelcts this: kiuwan-testscenario-missing-imports.csv

The only difference is the file name. I created a pull request highlighting this change.

flmarkus avatar Jan 11 '24 12:01 flmarkus

@mtesauro Is it possible to open this issue again? Or should I file a new one?

flmarkus avatar Jan 11 '24 13:01 flmarkus

@flmarkus Yes. Re-opened

mtesauro avatar Jan 12 '24 00:01 mtesauro

This can be closed again @mtesauro https://github.com/DefectDojo/django-DefectDojo/pull/9316

manuel-sommer avatar Jan 19 '24 06:01 manuel-sommer

Thanks for accepting and merging my PR!

flmarkus avatar Jan 19 '24 12:01 flmarkus