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

[frontend/backend] Marking definitions for uploaded files (#5823) #6735

Merged
merged 6 commits into from May 2, 2024

Conversation

ValentinBouzinFiligran
Copy link
Member

@ValentinBouzinFiligran ValentinBouzinFiligran commented Apr 17, 2024

Proposed changes

  • marking step added before file upload
  • marking form added on free text upload form
  • fileMarkings key passed on global upload query
  • fileMarkings key passed on entity upload query

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@ValentinBouzinFiligran ValentinBouzinFiligran marked this pull request as ready for review April 23, 2024 15:42
@Kedae Kedae added the filigran team use to identify PR from the Filigran team label Apr 24, 2024
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 68.59%. Comparing base (e8ca0e1) to head (e62d026).
Report is 20 commits behind head on master.

Files Patch % Lines
...pencti-platform/opencti-graphql/src/domain/file.js 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6735      +/-   ##
==========================================
+ Coverage   68.06%   68.59%   +0.52%     
==========================================
  Files         538      545       +7     
  Lines       65801    66485     +684     
  Branches     5578     6527     +949     
==========================================
+ Hits        44786    45603     +817     
+ Misses      21015    20882     -133     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ValentinBouzinFiligran ValentinBouzinFiligran changed the title Issue/5823 [frontend/backend] Marking definitions for uploaded files (#5823) Apr 25, 2024
@Kedae Kedae linked an issue Apr 25, 2024 that may be closed by this pull request
@Kedae
Copy link
Member

Kedae commented Apr 25, 2024

File marking resolution in Content tab of an entity with file creation doesn't work

@Kedae
Copy link
Member

Kedae commented Apr 25, 2024

Additionnaly : we are missing default file marking of entity when missing + we need to check the importFiles

@Kedae Kedae removed their request for review April 29, 2024 06:51
@labo-flg
Copy link
Member

I've done some tests with a Malware and the Stix json export.
I managed to get one export with content + file markings to TLP;GREEN but when I try with TLP;RED I get

line 1980, in prepare_export\n if stix_core_relationship[\"to\"][\"id\"] != entity[\"x_opencti_id\"]\nTypeError: 'NoneType' object is not subscriptable

Copy link
Member

@aHenryJard aHenryJard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are changing uploadImport mutation, it could be great to add at least one resolver test that covers it.

@labo-flg
Copy link
Member

I've tested the upload, access check is OK.

@labo-flg
Copy link
Member

labo-flg commented May 2, 2024

Since you are changing uploadImport mutation, it could be great to add at least one resolver test that covers it.

There is no resolver tests for file domain yet.

This would require significant work, let's split this in another PR.

@ValentinBouzinFiligran ValentinBouzinFiligran merged commit 09fb80e into master May 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Marking definitions for uploaded files
4 participants