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

[backend] display created field for csv mapper (#7226) #7966

Merged
merged 3 commits into from
Sep 19, 2024
Merged

Conversation

frapuks
Copy link
Member

@frapuks frapuks commented Aug 6, 2024

Proposed changes

  • Remove created from INTERNAL_ATTRIBUTES list
  • Display created field into csv mapper creation form

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

@frapuks frapuks added the filigran team use to identify PR from the Filigran team label Aug 6, 2024
@frapuks frapuks self-assigned this Aug 6, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.14%. Comparing base (031c567) to head (73e4a69).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7966   +/-   ##
=======================================
  Coverage   66.13%   66.14%           
=======================================
  Files         597      597           
  Lines       60375    60374    -1     
  Branches     6191     6192    +1     
=======================================
+ Hits        39930    39934    +4     
+ Misses      20445    20440    -5     

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

@frapuks
Copy link
Member Author

frapuks commented Aug 26, 2024

CURENTLY : We have 2 different attributes with the same name : 'created' :

  • a general attributes referenced in attribute-definition.ts (line 366)
  • a specific attribute referenced for example in case-incident.ts (line 39)
  • The only condition to filter results is based on the INTERNAL_ATTRIBUTES list, created with only the property name

TARGET : The fix should be able to separate these two attributes and only return the second.

PROPOSALS :

  • remove created.name from INTERNAL_ATTRIBUTES and filter manually the created (general) attribute ? => this PR
  • update INTERNAL_ATTRIBUTES to list all attribute properties (not only the name) ?
  • update the name of geneal attribute ?
  • update the name of specific attribute ?
  • keep INTERNAL_ATTRIBUTES and filter on the attribute.mandatoryType === 'external' ?

@nino-filigran
Copy link

@frapuks & @SouadHadjiat I'm not sure to understand this issue between create name internal and general. Could you elaborate?

  • I see that a date (incident date/RFI date...) is needed when creating manually a case. Does this "created" attribute correspond to this date field?
  • Can we simply ensure that we have this field displayed in the CSV mapper for these 3 entities? If any of the solutions you offered @frapuks are working then it's good for me.

@SouadHadjiat
Copy link
Member

created field is not internal, it's the "original creation date" of the entity and it's part of stix, we have another field createdAt that is the date the entity has been created in the platform (and this is internal). So my question is why created is considered internal? Why don't we display this field in the CSV representation for all entities? @nino-filigran @frapuks

image

image

@nino-filigran
Copy link

I think we can indeed add it in the CSV, but not as a mandatory field, especially useful if the entity has been created in the past before being imported in OpenCTI.

@frapuks
Copy link
Member Author

frapuks commented Sep 19, 2024

Decision with @SouadHadjiat and @nino-filigran :
Display the field created for all entities.

@frapuks frapuks merged commit 657781b into master Sep 19, 2024
6 checks passed
@frapuks frapuks deleted the issue/7226 branch September 19, 2024 07:34
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.

Created field not present but required for CSV Mapper
3 participants