Skip to content

Importer: Burp REST API (Fix #3447) - #3542

Merged
madchap merged 20 commits into
DefectDojo:devfrom
damiencarol:add_burp_suite_pro
Jan 17, 2021
Merged

madchap merged 20 commits into
DefectDojo:devfrom
damiencarol:add_burp_suite_pro

Conversation

@damiencarol

Copy link
Copy Markdown
Contributor

this PR fixes #3447

@madchap

madchap commented Dec 24, 2020

Copy link
Copy Markdown
Contributor

You seem to be missing quite a few files to have this done properly.

You can take a look at some parsers at Import Scans and see what's left to do.

@madchap

madchap commented Dec 24, 2020

Copy link
Copy Markdown
Contributor

Also, you did mean Burp Pro and not Enterprise, correct? Such as in here: https://portswigger.net/blog/burps-new-rest-api

If so, it may be good to take a look if this new ingestion could be merged with the existing Burp Pro importer to avoid having many "Burp Pro". E.g. by making some assumption on the type of file being uploaded (XML Vs JSON).

@valentijnscholten

Copy link
Copy Markdown
Member

Thanks. Everytime a dictionary is accessed like this issue_event["issue"]["type_index"] there's a chance of a KeyError, one of the most common reasons why we see imports failing after some time. Can you make all these cases "None-safe" by using something like issue_event.get('issue', None) etc.?

@damiencarol

Copy link
Copy Markdown
Contributor Author

@valentijnscholten for the "Non-safe" pb, it is covered by the if:

if "issue_found" == issue_event.get("type"):

If the event is issue_found, the attribute issue is here. I can move some to issue_event["issue"].get("type_index", None) but some attribute are mandatory. It doesn't make sense to not have them.

@valentijnscholten

Copy link
Copy Markdown
Member

that's what everybody thinks when they write a parser, and then after a year we get 500 errors because a field was added/removed/renamed

@damiencarol
damiencarol marked this pull request as draft December 26, 2020 09:47
@damiencarol

damiencarol commented Jan 3, 2021 •

Copy link
Copy Markdown
Contributor Author

@madchap I added the missing pieces. My pull request was not finished when you reviewed it 😅 . Regarding how to "class" this new parser, we can't use the other ones. This one is dedicated to the data of the REST API. It doesn't depend on Pro/Community/Business version and we can't rely on the file name as it is a JSON response from an API... so no file name.
These data are different from the previous XML/JSON parser that were exports from the GUI tool (manual action required).

@valentijnscholten As you requested, I added more dict.get('attr', 'def')

@damiencarol damiencarol changed the title Add export from Burp Suite Pro REST API (Fix #3447) Importer: Burp REST API (Fix #3447) Jan 3, 2021
@damiencarol
damiencarol marked this pull request as ready for review January 4, 2021 00:15
Comment thread dojo/tools/factory.py Resolved
@damiencarol
damiencarol requested review from a team and madchap January 11, 2021 12:42
@damiencarol damiencarol linked an issue Jan 17, 2021 that may be closed by this pull request
@damiencarol

Copy link
Copy Markdown
Contributor Author

@madchap fixed the typo you found. Good catch!

@madchap
madchap merged commit 337524e into DefectDojo:dev Jan 17, 2021
@damiencarol
damiencarol deleted the add_burp_suite_pro branch January 17, 2021 21:34
@madchap madchap mentioned this pull request Jan 19, 2021
9alexx3 pushed a commit to 9alexx3/django-DefectDojo that referenced this pull request Aug 12, 2026
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.

Burp suite json format

3 participants