Open jnow677 opened 3 years ago
thanks in advance
you edit source code of
cuckoo/apps/api.py
@app.route("/tasks/report/<int:task_id>") @app.route("/v1/tasks/report/<int:task_id>") @app.route("/tasks/report/<int:task_id>/<report_format>") @app.route("/v1/tasks/report/<int:task_id>/<report_format>") def tasks_report(task_id, report_format="json"):
thanks a lot , but I want to receive the analysis report as a JSON format but in zipped file when requesting this endpoint GET /tasks/report the report in JSON format may be 300 mega but if it is zipped it maybe just 2 mega
I found these endpoints
`@app.route("/tasks/report/
but I still stuck in zipping the json report and adding new format as "zip" : "report.zip" def tasks_report(task_id, report_format="json"): formats = { "json": "report.json", "html": "report.html", }
bz_formats = {
"all": {"type": "-", "files": ["memory.dmp"]},
"dropped": {"type": "+", "files": ["files"]},
"package_files": {"type": "+", "files": ["package_files"]},
}
tar_formats = {
"bz2": "w:bz2",
"gz": "w:gz",
"tar": "w",
}
if report_format.lower() in formats:
report_path = cwd(
"storage", "analyses", "%d" % task_id, "reports",
formats[report_format.lower()]
)
elif report_format.lower() in bz_formats:
bzf = bz_formats[report_format.lower()]
srcdir = cwd("storage", "analyses", "%d" % task_id)
s = io.BytesIO()`
Hello wonderful cuckoo team,
please is it possible to get a zip file containing the JSON report when using theses endpoint GET /tasks/report
because when dealing with a large report "bigger than 300 mega in the report" curl will be interrupted.
thanks