Skip to content

Conversation

@DocArmoryTech
Copy link

Resolves #190

Currently, when MISP report objects are being created, the report-file object includes only the url for the PDF of the report, and not the actual data.

This PR:

  • exposes the falconpy Intel.get_report_pdf() through a new IntelAPIClient.get_report_pdf() function.
  • updates generation of the report-file (attachment) to MISP report objects to include the PDF document

DocArmoryTech and others added 6 commits February 21, 2025 15:30
introduces `IntelAPIClient.get_report_pdf(report_id)` in order to expose the falconpy `Intel.get_report_pdf()` function.
Uses the newly exposed `IntelAPIClient.get_report_pdf(report_id)` function to download Crowdstrike-report attachments and includes them as `report-file` attachments (alongside the url)
In an as yet undetermined/undiagnosed scenario, `get_pdf_report(...)` returns a `dict` and thereby causes an error in converting the expect byte array to an IO stream.

This commit: 
- ensures a `pdfreport` is in fact a `byte` array before attempting upload to misp via an IO stream.
- reverts to the original (no `add_attributed( ..., data=...`) if `pdfreport` is not a `byte` array generation of `attachments`
- Removed unnecessary `attributes` list and directly added attributes to `rpt`
- Improved handling of `attachments` for various report types:
 - CSA and CSIT `report.details` contains `attachments` 
 - CSECR, CSDR, CSID `report` contains `attachments`)
CSECR = "Courtesy Report"
CSID = "Intrusion Digest"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unable to download pdf

1 participant