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] Organization sharing behavior change for upsert and enrichment #6101

Merged
merged 4 commits into from
Feb 27, 2024

Conversation

richard-julien
Copy link
Member

Organization sharing behavior change for upsert and enrichment

Linked to PRs
OpenCTI-Platform/client-python#568
OpenCTI-Platform/connectors#1859

@richard-julien richard-julien added the filigran team use to identify PR from the Filigran team label Feb 23, 2024
@richard-julien richard-julien self-assigned this Feb 23, 2024
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

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

Project coverage is 66.98%. Comparing base (e278eec) to head (720cf31).
Report is 20 commits behind head on master.

Files Patch % Lines
...tform/opencti-graphql/src/graphql/sseMiddleware.js 0.00% 19 Missing ⚠️
...cti-platform/opencti-graphql/src/resolvers/stix.js 27.27% 8 Missing ⚠️
...tform/opencti-graphql/src/domain/stixCoreObject.js 25.00% 6 Missing ⚠️
...-platform/opencti-graphql/src/domain/enrichment.js 37.50% 5 Missing ⚠️
...pencti-platform/opencti-graphql/src/domain/stix.js 33.33% 2 Missing ⚠️
...raphql/src/modules/playbook/playbook-components.ts 71.42% 2 Missing ⚠️
...rm/opencti-graphql/src/manager/activityListener.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6101      +/-   ##
==========================================
+ Coverage   66.57%   66.98%   +0.40%     
==========================================
  Files         540      540              
  Lines       64270    64297      +27     
  Branches     5222     5776     +554     
==========================================
+ Hits        42788    43069     +281     
+ Misses      21482    21228     -254     

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

@Archidoit
Copy link
Member

Connecteurs testés :

  • Greynoise
  • Abuseipdb

@@ -190,10 +191,12 @@ export const askElementEnrichmentForConnector = async (context, user, enrichedId
const message = {
internal: {
work_id: work.id, // Related action for history
applicant_id: user.id, // User asking for the import
applicant_id: null, // No specific user asking for the import
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we set the applicant_id to the connector user id if we want the enrichment update to have the connector as the creator?

@JeremyCloarec
Copy link
Contributor

Tested OK when it comes to keeping the organization sharing during enrichment, and applying the organization sharing to objects created during enrichment.
I've encountered two problems during testing however:

  • First one is related to the "creator" of the enrichment: in the entity history and list of creators, it is the worker user that is used as a creator and not the connector user
  • When trying to export entities with the stix export connector, I either get an error during export (when trying to export an observable), or the granted_ref is not kept on export (I tried on a malware entity)

@Kedae Kedae linked an issue Feb 27, 2024 that may be closed by this pull request
@richard-julien richard-julien merged commit d35155b into master Feb 27, 2024
8 checks passed
@richard-julien richard-julien deleted the issue/6042 branch February 27, 2024 17:43
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.

[backend] Organization sharing behavior change for upsert and enrichment
3 participants