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] add askAnalysis mutation to request file or fields analysis (#6803) #7192

Merged
merged 5 commits into from
Jun 17, 2024

Conversation

JeremyCloarec
Copy link
Contributor

@JeremyCloarec JeremyCloarec commented May 30, 2024

Proposed changes

  • add askAnalysis mutation in stixCoreObjectEdit
  • add new INTERNAL_ANALYSIS connector type
  • askAnalysis request creates a work and sends a message to the first INTERNAL_ANALYSIS connector available
  • handle both file and fields analysis

see related client, connector and docker PR
OpenCTI-Platform/client-python#666
OpenCTI-Platform/connectors#2190
OpenCTI-Platform/docker#294

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

Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 24.81752% with 103 lines in your changes missing coverage. Please review.

Project coverage is 67.59%. Comparing base (7cfd0cf) to head (41f695a).
Report is 1 commits behind head on master.

Files Patch % Lines
...tform/opencti-graphql/src/domain/stixCoreObject.js 15.45% 93 Missing ⚠️
...rm/opencti-graphql/src/manager/activityListener.ts 0.00% 5 Missing ⚠️
...latform/opencti-graphql/src/database/repository.js 60.00% 2 Missing ⚠️
...i-platform/opencti-graphql/src/domain/connector.js 0.00% 1 Missing ⚠️
...orm/opencti-graphql/src/manager/activityManager.ts 0.00% 1 Missing ⚠️
...rm/opencti-graphql/src/resolvers/stixCoreObject.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7192      +/-   ##
==========================================
- Coverage   67.67%   67.59%   -0.09%     
==========================================
  Files         561      561              
  Lines       69059    69190     +131     
  Branches     5879     5880       +1     
==========================================
+ Hits        46735    46768      +33     
- Misses      22324    22422      +98     

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

@JeremyCloarec JeremyCloarec added filigran team use to identify PR from the Filigran team multi-repository For contribution that requires PR in several repository labels May 31, 2024
@JeremyCloarec JeremyCloarec marked this pull request as ready for review May 31, 2024 15:27
@SouadHadjiat SouadHadjiat self-requested a review May 31, 2024 15:34
Copy link
Member

@marieflorescontact marieflorescontact left a comment

Choose a reason for hiding this comment

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

locally tested ok 👌

user,
event_access: 'extended',
event_type: 'command',
event_scope: 'analyze',
Copy link
Member

Choose a reason for hiding this comment

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

new scope not handled in ActivityListener

const message = `asks for \`${entity_name}\` enrichment with connector \`${connector_name}\``;
await activityLogger(action, message);
}
if (action.event_scope === 'enrich') {
Copy link
Member

Choose a reason for hiding this comment

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

looks like there was an issue here, if (action.event_scope === 'enrich') { block is present 3 times, I guess we only need if (action.event_scope === 'analyze') { block

@JeremyCloarec JeremyCloarec merged commit 98165c6 into master Jun 17, 2024
4 checks passed
@JeremyCloarec JeremyCloarec deleted the issue/6803-chunk1 branch June 17, 2024 12:28
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 multi-repository For contribution that requires PR in several repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants