MISP / MISP/misp-modules

The function of extracting events into pdf is not functioning properly.

Open
#455 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
377
Forks
280
Avg merge
2d 2h
Merged PRs (30d)
10

Description

Work environment
Questions Answers
Type of issue Bug
OS version (server) Ubuntu
OS version (client) Win10
PHP version 7.2
MISP version / git hash 2.4.126(150b66da2fb7b2cfe45477f62c12ac8716d247d7)
Browser chrome
Expected behavior

event -> Download as -> Pdfexport
Events are extracted as pdf.

Actual behavior

event -> Download as -> Pdfexport
The generated pdf has a file size of 0.

Steps to reproduce the behavior

event -> Download as -> Pdfexport
Due to the large number of Galaxies the event, it occurs when the "General information" in the PDF file is over 1 page.
(For example, you have 80 Galaxies in an event.)

Logs, screenshots, configuration dump, ...

misp-modules - ERROR - Something went wrong:
Traceback (most recent call last):
File "/var/www/MISP/venv/lib/python3.6/site-packages/misp_modules/init.py", line 201, in post
response = yield tornado.gen.with_timeout(timeout, self.run_request(jsonpayload))
File "/var/www/MISP/venv/lib/python3.6/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, *self.kwargs)
File "/var/www/MISP/venv/lib/python3.6/site-packages/misp_modules/init.py", line 189, in run_request
response = mhandlers[x['module']].handler(q=jsonpayload)
File "/var/www/MISP/venv/lib/python3.6/site-packages/misp_modules/modules/export_mod/pdfexport.py", line 68, in handler
pdf = reportlab_generator.get_base64_from_value(reportlab_generator.convert_event_in_pdf_buffer(misp_event, config))
File "/var/www/MISP/PyMISP/pymisp/tools/reportlab_generator.py", line 1772, in convert_event_in_pdf_buffer
export_flowables_to_pdf(curr_document, misp_event, flowables, config)
File "/var/www/MISP/PyMISP/pymisp/tools/reportlab_generator.py", line 1739, in export_flowables_to_pdf
onLaterPages=static_drawer.set_template, # Pagination for all other page
File "/var/www/MISP/venv/lib/python3.6/site-packages/reportlab/platypus/doctemplate.py", line 1291, in build
BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker)
File "/var/www/MISP/venv/lib/python3.6/site-packages/reportlab/platypus/doctemplate.py", line 1056, in build
self.handle_flowable(flowables)
File "/var/www/MISP/venv/lib/python3.6/site-packages/reportlab/platypus/doctemplate.py", line 942, in handle_flowable
raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Flowable <Table@0x7FAFB9D92630 1 rows x 2 cols(tallest row 947)> with cell(0,0) containing
'<Paragraph at 0x7fafb9d8a240>Tags'(554.9291338582678 x 947.1023622047245), tallest cell 947.1 points, too large on page 2 in frame 'normal'(554.9291338582678 x 801.5433070866144
) of template 'Later'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in PyMISP/pymisp/tools/reportlab_generator.py at convert_event_in_pdf_buffer and export_flowables_to_pdf, following the ReportLab LayoutError shown in the issue. Reproduce the event PDF export with enough Galaxies for the General information section to exceed one page. Done means the export produces a non-empty PDF without this layout error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.