Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Attached file in context of full export #686

Closed
nino-filigran opened this issue May 21, 2024 · 3 comments · Fixed by #687
Closed

Export Attached file in context of full export #686

nino-filigran opened this issue May 21, 2024 · 3 comments · Fixed by #687
Assignees
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)

Comments

@nino-filigran
Copy link

nino-filigran commented May 21, 2024

Use case

In context a full JSON export, create an export of all attached files (at least pdf, encoded in json)

Steps to reproduce:

  • Go in a report that has file attached (for instance a PDF)
  • click on Generate an export in full, JSON
  • check the export

Expected result:

  • files should be contained in the JSON in base64

Current Output:

  • files are not in the JSON
@nino-filigran nino-filigran added feature use for describing a new feature to develop needs triage use to identify issue needing triage from Filigran Product team and removed needs triage use to identify issue needing triage from Filigran Product team labels May 21, 2024
@SamuelHassine SamuelHassine added bug use for describing something not working as expected and removed feature use for describing a new feature to develop labels Jun 18, 2024
@SamuelHassine
Copy link
Member

Already in the source code of the Python library, opencti_stix2.py, lines 1938:

# Files
        if "importFiles" in entity and len(entity["importFiles"]) > 0:
            entity["x_opencti_files"] = []
            for file in entity["importFiles"]:
                url = (
                    self.opencti.api_url.replace("graphql", "storage/get/") + file["id"]
                )
                data = self.opencti.fetch_opencti_file(url, binary=True, serialize=True)
                entity["x_opencti_files"].append(
                    {
                        "name": file["name"],
                        "data": data,
                        "mime_type": file["metaData"]["mimetype"],
                        "version": file["metaData"].get("version", None),
                    }
                )

@SamuelHassine
Copy link
Member

Not sure why it is not working anymore....

@SamuelHassine SamuelHassine added this to the Release 6.1.12 milestone Jun 19, 2024
@aHenryJard aHenryJard self-assigned this Jun 19, 2024
@aHenryJard aHenryJard transferred this issue from OpenCTI-Platform/opencti Jun 20, 2024
@aHenryJard
Copy link
Member

FYI I transfered the issue from opencti project to client-python, since I need it on the PR.

@aHenryJard aHenryJard linked a pull request Jun 20, 2024 that will close this issue
5 tasks
@Kedae Kedae modified the milestones: Release 6.1.12, Release 6.2.0 Jun 20, 2024
@SamuelHassine SamuelHassine added the solved use to identify issue that has been solved (must be linked to the solving PR) label Jun 24, 2024
Kedae pushed a commit that referenced this issue Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug use for describing something not working as expected solved use to identify issue that has been solved (must be linked to the solving PR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants