From c34a9fd15c5c44d6bfa66b061b60f0d368be89b3 Mon Sep 17 00:00:00 2001 From: Julien Richard Date: Sun, 5 Mar 2023 22:11:02 +0100 Subject: [PATCH] [back/front] Cumulate creator_id when upserting an entity (#2886) --- .../src/private/components/Dashboard.js | 4 +- .../src/private/components/SearchBulk.js | 16 +- .../private/components/analysis/Groupings.tsx | 2 +- .../src/private/components/analysis/Notes.js | 2 +- .../private/components/analysis/Opinions.js | 2 +- .../private/components/analysis/Reports.tsx | 2 +- .../ExternalReferenceCreation.tsx | 4 - .../ExternalReferenceDetails.tsx | 16 +- .../ExternalReferenceLine.tsx | 4 +- .../components/analysis/groupings/Grouping.js | 2 +- .../analysis/groupings/GroupingKnowledge.js | 4 - .../analysis/groupings/GroupingLine.js | 4 +- .../private/components/analysis/notes/Note.js | 2 +- .../components/analysis/notes/NoteLine.js | 4 +- .../components/analysis/opinions/Opinion.js | 2 +- .../analysis/opinions/OpinionLine.js | 4 +- .../components/analysis/reports/Report.js | 2 +- .../analysis/reports/ReportKnowledge.js | 4 - .../analysis/reports/ReportLine.tsx | 4 +- .../analysis/reports/ReportsLines.tsx | 4 - .../components/arsenal/Vulnerabilities.tsx | 2 +- .../components/arsenal/channels/Channel.js | 2 +- .../components/arsenal/malwares/Malware.js | 2 +- .../arsenal/malwares/MalwareDetails.js | 4 - .../private/components/arsenal/tools/Tool.js | 2 +- .../vulnerabilities/VulnerabilitiesLines.tsx | 4 - .../arsenal/vulnerabilities/Vulnerability.js | 2 +- .../vulnerabilities/VulnerabilityLine.tsx | 4 +- .../private/components/cases/Feedbacks.tsx | 2 +- .../private/components/cases/Incidents.tsx | 4 +- .../components/cases/feedbacks/Feedback.tsx | 2 +- .../cases/feedbacks/FeedbackDetails.tsx | 4 - .../feedbacks/FeedbackEditionOverview.tsx | 4 - .../cases/feedbacks/FeedbackLine.tsx | 4 +- .../components/cases/incidents/Incident.tsx | 4 - .../cases/incidents/IncidentDetails.tsx | 4 - .../incidents/IncidentEditionOverview.tsx | 2 +- .../cases/incidents/IncidentKnowledge.js | 4 - .../cases/incidents/IncidentLine.tsx | 4 +- ...ntainerStixObjectOrStixRelationshipLine.js | 8 +- ...ectOrStixCoreRelationshipContainerLine.tsx | 4 +- ...eObjectOrStixCoreRelationshipContainers.js | 2 +- .../components/common/files/FileLine.tsx | 3 - .../EntityStixCoreRelationshipLineAll.js | 16 +- .../EntityStixCoreRelationshipLineFrom.js | 6 +- .../EntityStixCoreRelationshipLineTo.js | 6 +- .../EntityStixCoreRelationships.js | 4 +- ...ntityStixCoreRelationshipsEntitiesLine.tsx | 4 +- .../StixCoreRelationshipOverview.js | 13 +- .../StixDomainObjectOverview.js | 17 +- .../src/private/components/data/Entities.js | 2 +- .../private/components/data/Relationships.js | 2 +- .../entities/EntitiesStixDomainObjectLine.js | 4 +- .../RelationshipsStixCoreRelationshipLine.js | 4 +- .../components/entities/events/Event.js | 2 +- .../entities/individuals/Individual.js | 2 +- .../entities/organizations/Organization.js | 2 +- .../organizations/OrganizationDetails.js | 4 - .../components/entities/sectors/Sector.js | 2 +- .../entities/sectors/SectorDetails.js | 4 - .../components/entities/systems/System.js | 2 +- .../private/components/events/Incidents.tsx | 195 ++++++----- .../components/events/ObservedDatas.tsx | 46 ++- .../events/StixSightingRelationships.tsx | 56 +-- .../components/events/incidents/Incident.tsx | 251 +++++++------- .../events/incidents/IncidentCard.tsx | 59 ++-- .../events/incidents/IncidentCreation.tsx | 226 ++++++------ .../events/incidents/IncidentDetails.tsx | 54 +-- .../events/incidents/IncidentEdition.tsx | 65 ++-- .../incidents/IncidentEditionContainer.tsx | 42 ++- .../incidents/IncidentEditionDetails.tsx | 242 +++++++------ .../incidents/IncidentEditionOverview.tsx | 175 ++++++---- .../events/incidents/IncidentKnowledge.tsx | 22 +- .../events/incidents/IncidentLine.tsx | 327 +++++++++-------- .../events/incidents/IncidentPopover.tsx | 134 ++++--- .../events/incidents/IncidentsCards.tsx | 123 +++---- .../events/incidents/IncidentsLines.tsx | 30 +- .../components/events/incidents/Root.tsx | 251 +++++++------- .../events/observed_data/ObservedData.js | 6 +- .../observed_data/ObservedDataCreation.js | 174 +++++----- .../observed_data/ObservedDataEdition.js | 5 +- .../ObservedDataEditionOverview.js | 304 ++++++++-------- .../observed_data/ObservedDatasLines.js | 4 +- .../EntityStixSightingRelationships.js | 6 +- ...xSightingRelationshipCreationFromEntity.js | 5 +- ...ightingRelationshipCreationFromRelation.js | 5 +- ...StixSightingRelationshipEditionOverview.js | 16 +- .../StixSightingRelationshipLine.js | 20 +- .../StixSightingRelationshipOverview.js | 18 +- .../StixSightingRelationshipPopover.js | 6 +- .../StixSightingRelationshipsLines.js | 10 +- .../AdministrativeArea.tsx | 2 +- .../components/locations/cities/City.tsx | 2 +- .../locations/countries/Country.tsx | 2 +- .../locations/positions/Position.tsx | 2 +- .../components/locations/regions/Region.tsx | 2 +- .../components/observations/Indicators.js | 2 +- .../observations/StixCyberObservables.tsx | 2 +- .../observations/indicators/Indicator.js | 2 +- .../indicators/IndicatorDetails.js | 4 - .../indicators/IndicatorEntities.js | 2 +- .../indicators/IndicatorEntityLine.js | 4 +- .../observations/indicators/IndicatorLine.js | 4 +- .../indicators/IndicatorsLines.js | 4 - .../infrastructures/Infrastructure.js | 2 +- .../infrastructures/InfrastructureDetails.js | 4 - .../StixCyberObservable.js | 2 +- .../StixCyberObservableCreation.js | 4 - .../StixCyberObservableEntitiesLines.js | 4 +- .../StixCyberObservableLine.js | 4 +- .../StixCyberObservableNestedEntitiesLines.js | 5 +- .../StixCyberObservableOverview.js | 11 +- .../StixCyberObservablesLines.js | 4 - .../search/SearchStixCoreObjectLine.js | 4 +- .../search/SearchStixCoreObjectsLines.js | 6 +- .../attack_patterns/AttackPattern.js | 2 +- .../attack_patterns/AttackPatternDetails.js | 4 - .../courses_of_action/CourseOfAction.js | 2 +- .../CourseOfActionDetails.js | 4 - .../data_components/DataComponent.tsx | 2 +- .../data_components/DataComponentDetails.tsx | 4 - .../techniques/data_sources/DataSource.tsx | 2 +- .../data_sources/DataSourceDetails.tsx | 4 - .../techniques/narratives/Narrative.js | 2 +- .../techniques/narratives/NarrativeDetails.js | 4 - .../private/components/threats/Campaigns.js | 2 + .../components/threats/IntrusionSets.js | 1 + .../components/threats/ThreatActors.js | 1 + .../components/threats/campaigns/Campaign.js | 2 +- .../threats/intrusion_sets/IntrusionSet.js | 2 +- .../threats/threat_actors/ThreatActor.js | 2 +- .../ThreatActorEditionOverview.js | 5 - .../src/schema/relay.schema.graphql | 166 ++++----- .../opencti-front/src/utils/Localization.js | 8 + .../src/utils/filters/filtersUtils.tsx | 1 + .../src/utils/filters/useSearchEntities.js | 18 + .../config/schema/opencti.graphql | 146 ++++---- .../src/database/middleware.js | 24 +- .../src/database/stix-converter.ts | 13 +- .../opencti-graphql/src/database/utils.js | 20 +- .../opencti-graphql/src/domain/user.js | 12 +- .../opencti-graphql/src/generated/graphql.ts | 328 +++++++++--------- .../src/manager/taskManager.js | 2 +- .../administrativeArea.graphql | 2 +- .../src/modules/case/case.graphql | 2 +- .../src/modules/channel/channel.graphql | 2 +- .../dataComponent/dataComponent.graphql | 2 +- .../src/modules/dataSource/dataSource.graphql | 2 +- .../src/modules/event/event.graphql | 2 +- .../src/modules/grouping/grouping.graphql | 2 +- .../src/modules/language/language.graphql | 2 +- .../src/modules/narrative/narrative.graphql | 2 +- .../src/modules/vocabulary/vocabulary.graphql | 2 +- .../opencti-graphql/src/resolvers/campaign.js | 1 + .../opencti-graphql/src/resolvers/file.js | 4 +- .../opencti-graphql/src/resolvers/incident.js | 1 + .../src/resolvers/intrusionSet.js | 1 + .../opencti-graphql/src/resolvers/log.js | 4 +- .../opencti-graphql/src/resolvers/stix.js | 2 +- .../src/resolvers/stixCoreRelationship.js | 2 +- .../stixCyberObservableRelationship.js | 2 +- .../src/resolvers/stixSightingRelationship.js | 2 +- .../src/resolvers/threatActor.js | 1 + .../src/resolvers/workspace.js | 4 +- .../src/schema/attribute-definition.ts | 17 + .../src/schema/schema-attributes.ts | 6 + .../src/schema/schema-relationsRef.ts | 9 +- .../src/schema/stixCoreRelationship.ts | 3 +- .../src/schema/stixCyberObservable.ts | 30 ++ .../schema/stixCyberObservableRelationship.ts | 2 + .../src/schema/stixDomainObject.ts | 24 ++ .../src/schema/stixMetaObject.ts | 5 + .../src/schema/stixMetaRelationship.ts | 2 + .../src/schema/stixSightingRelationship.ts | 5 +- .../src/types/stix-common.d.ts | 7 +- .../opencti-graphql/src/types/store.d.ts | 1 + .../opencti-graphql/src/utils/filtering.js | 27 +- .../tests/03-streams/00-Raw/raw-test.js | 2 +- .../opencti-graphql/tests/utils/testQuery.ts | 2 +- 179 files changed, 2274 insertions(+), 1917 deletions(-) diff --git a/opencti-platform/opencti-front/src/private/components/Dashboard.js b/opencti-platform/opencti-front/src/private/components/Dashboard.js index 719affe7d061..204e4558dbd2 100644 --- a/opencti-platform/opencti-front/src/private/components/Dashboard.js +++ b/opencti-platform/opencti-front/src/private/components/Dashboard.js @@ -524,7 +524,7 @@ const LastIngestedAnalysis = () => { name report_types } - creator { + creators { id name } @@ -606,7 +606,7 @@ const LastIngestedAnalysis = () => { {pathOr('', ['createdBy', 'name'], stixDomainObject)}
- {pathOr('', ['creator', 'name'], stixDomainObject)} + {(stixDomainObject.creators ?? []).map((c) => c?.name).join(', ')}
{fsd(stixDomainObject.created_at)} diff --git a/opencti-platform/opencti-front/src/private/components/SearchBulk.js b/opencti-platform/opencti-front/src/private/components/SearchBulk.js index f3f4763d6749..85c477b1ce39 100644 --- a/opencti-platform/opencti-front/src/private/components/SearchBulk.js +++ b/opencti-platform/opencti-front/src/private/components/SearchBulk.js @@ -296,16 +296,8 @@ const SearchBulk = () => { markings: resolvedStixCoreObject.objectMarking, reports: resolvedStixCoreObject.reports, updated_at: resolvedStixCoreObject.updated_at, - author: R.pathOr( - '', - ['createdBy', 'name'], - resolvedStixCoreObject, - ), - creator: R.pathOr( - '', - ['creator', 'name'], - resolvedStixCoreObject, - ), + author: R.pathOr('', ['createdBy', 'name'], resolvedStixCoreObject), + creators: (resolvedStixCoreObject.creators ?? []).map((c) => c?.name).join(', '), in_platform: true, }), ); @@ -462,7 +454,7 @@ const SearchBulk = () => { {SortHeader('type', 'Type', true)} {SortHeader('value', 'Value', true)} {SortHeader('author', 'Author', true)} - {SortHeader('creator', 'Creator', true)} + {SortHeader('creator', 'Creators', true)} {SortHeader('labels', 'Labels', true)} {SortHeader('created_at', 'Creation date', true)} {SortHeader('reports', 'Reports', true)} @@ -534,7 +526,7 @@ const SearchBulk = () => { className={classes.bodyItem} style={inlineStyles.creator} > - {entity.in_platform && entity.creator} + {entity.in_platform && entity.creators}
= ({ isSortable: isRuntimeSort ?? false, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort ?? false, }, diff --git a/opencti-platform/opencti-front/src/private/components/analysis/Notes.js b/opencti-platform/opencti-front/src/private/components/analysis/Notes.js index 81ef364a7db1..861b805cb37c 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/Notes.js +++ b/opencti-platform/opencti-front/src/private/components/analysis/Notes.js @@ -231,7 +231,7 @@ class Notes extends Component { isSortable: isRuntimeSort, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort, }, diff --git a/opencti-platform/opencti-front/src/private/components/analysis/Opinions.js b/opencti-platform/opencti-front/src/private/components/analysis/Opinions.js index eec1338ed8a6..f3cd64e75eb1 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/Opinions.js +++ b/opencti-platform/opencti-front/src/private/components/analysis/Opinions.js @@ -223,7 +223,7 @@ class Opinions extends Component { isSortable: isRuntimeSort, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort, }, diff --git a/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx b/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx index 0ec7095114cc..7cbd51bb710b 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/Reports.tsx @@ -117,7 +117,7 @@ const Reports: FunctionComponent = ({ isSortable: isRuntimeSort ?? false, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort ?? false, }, diff --git a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceCreation.tsx b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceCreation.tsx index f433e56b5a73..92fd80f42919 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceCreation.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceCreation.tsx @@ -93,10 +93,6 @@ export const externalReferenceCreationMutation = graphql` external_id created fileId - creator { - id - name - } } } `; diff --git a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceDetails.tsx b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceDetails.tsx index d67a6b37fded..625cdca79337 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceDetails.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceDetails.tsx @@ -76,11 +76,17 @@ ExternalReferenceDetailsComponentProps - {t('Creator')} + style={{ marginTop: 20 }}> + {t('Creators')} - +
+ {(externalReference.creators ?? []).map((c) => { + return
+ +
; + })} +
+
@@ -135,7 +141,7 @@ const ExternalReferenceDetails = createFragmentContainer( id external_id url - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceLine.tsx b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceLine.tsx index 01f4d017d074..579ada765e89 100644 --- a/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceLine.tsx +++ b/opencti-platform/opencti-front/src/private/components/analysis/external_references/ExternalReferenceLine.tsx @@ -170,7 +170,7 @@ ExternalReferenceLineComponentProps className={classes.bodyItem} style={{ width: dataColumns?.creator.width }} > - {node?.creator?.name} + {(node?.creators ?? []).map((c) => c?.name).join(', ')}
- {node.creator?.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {node.creator?.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {node.creator?.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
= ({ className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {node.creator?.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
{ isSortable: true, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/channels/Channel.js b/opencti-platform/opencti-front/src/private/components/arsenal/channels/Channel.js index dd7d780b2a46..aa711e72ae25 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/channels/Channel.js +++ b/opencti-platform/opencti-front/src/private/components/arsenal/channels/Channel.js @@ -118,7 +118,7 @@ const Channel = createFragmentContainer(ChannelComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/malwares/Malware.js b/opencti-platform/opencti-front/src/private/components/arsenal/malwares/Malware.js index dc6af43d4e8d..3cf07d00e713 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/malwares/Malware.js +++ b/opencti-platform/opencti-front/src/private/components/arsenal/malwares/Malware.js @@ -118,7 +118,7 @@ const Malware = createFragmentContainer(MalwareComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/malwares/MalwareDetails.js b/opencti-platform/opencti-front/src/private/components/arsenal/malwares/MalwareDetails.js index 05e91e46d0b4..ef0f7fda2f9d 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/malwares/MalwareDetails.js +++ b/opencti-platform/opencti-front/src/private/components/arsenal/malwares/MalwareDetails.js @@ -246,10 +246,6 @@ const MalwareDetails = createFragmentContainer(MalwareDetailsComponent, { architecture_execution_envs implementation_languages capabilities - creator { - id - name - } killChainPhases { edges { node { diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/tools/Tool.js b/opencti-platform/opencti-front/src/private/components/arsenal/tools/Tool.js index ed0b9853d09b..a361488ab57b 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/tools/Tool.js +++ b/opencti-platform/opencti-front/src/private/components/arsenal/tools/Tool.js @@ -118,7 +118,7 @@ const Tool = createFragmentContainer(ToolComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilitiesLines.tsx b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilitiesLines.tsx index 7e3fec52c016..15051bfbe802 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilitiesLines.tsx +++ b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilitiesLines.tsx @@ -71,10 +71,6 @@ const vulnerabilitiesLinesFragment = graphql` id name description - creator { - id - name - } ...VulnerabilityLine_node } } diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/Vulnerability.js b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/Vulnerability.js index b48e98d3ae0e..b0700010b46a 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/Vulnerability.js +++ b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/Vulnerability.js @@ -121,7 +121,7 @@ const Vulnerability = createFragmentContainer(VulnerabilityComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilityLine.tsx b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilityLine.tsx index 372641046fc1..f0fcaab69b9c 100644 --- a/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilityLine.tsx +++ b/opencti-platform/opencti-front/src/private/components/arsenal/vulnerabilities/VulnerabilityLine.tsx @@ -73,7 +73,7 @@ const vulnerabilityLineFragment = graphql` } } } - creator { + creators { id name } @@ -141,7 +141,7 @@ export const VulnerabilityLine: FunctionComponent = ({ className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {data.creator?.name} + {(data.creators ?? []).map((c) => c?.name).join(', ')}
} diff --git a/opencti-platform/opencti-front/src/private/components/cases/Feedbacks.tsx b/opencti-platform/opencti-front/src/private/components/cases/Feedbacks.tsx index 737efaf855aa..0194d3a30930 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/Feedbacks.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/Feedbacks.tsx @@ -88,7 +88,7 @@ const Feedbacks: FunctionComponent = () => { isSortable: isRuntimeSort ?? false, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort ?? false, }, diff --git a/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx b/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx index ffca2cf8adca..ae86f89e3b9e 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/Incidents.tsx @@ -96,7 +96,7 @@ const Incidents: FunctionComponent = () => { isSortable: isRuntimeSort ?? false, }, creator: { - label: 'Creator', + label: 'Creators', width: '11%', isSortable: isRuntimeSort ?? false, }, @@ -106,7 +106,7 @@ const Incidents: FunctionComponent = () => { isSortable: false, }, created: { - label: 'Date', + label: 'Creation date', width: '10%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/Feedback.tsx b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/Feedback.tsx index 199a3ded9e0b..2e342fccd32b 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/Feedback.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/Feedback.tsx @@ -43,7 +43,7 @@ const feedbackFragment = graphql` entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackDetails.tsx b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackDetails.tsx index 04be2f644b0c..77af9e8b1e85 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackDetails.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackDetails.tsx @@ -35,10 +35,6 @@ const FeedbackDetailsFragment = graphql` created modified created_at - creator { - id - name - } objectLabel { edges { node { diff --git a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackEditionOverview.tsx b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackEditionOverview.tsx index 4e29c45a92ad..526f02d02b46 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackEditionOverview.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackEditionOverview.tsx @@ -64,10 +64,6 @@ const feedbackEditionOverviewFragment = graphql` description rating confidence - creator { - id - name - } x_opencti_stix_ids createdBy { ... on Identity { diff --git a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackLine.tsx b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackLine.tsx index c1370ad992cf..ab691f30a8a1 100644 --- a/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackLine.tsx +++ b/opencti-platform/opencti-front/src/private/components/cases/feedbacks/FeedbackLine.tsx @@ -112,7 +112,7 @@ const caseFragment = graphql` } } } - creator { + creators { id name } @@ -202,7 +202,7 @@ export const FeedbackLine: FunctionComponent = ({ className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {data.creator?.name} + {(data.creators ?? []).map((c) => c?.name).join(', ')}
= ({ className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {data.creator?.name} + {(data.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {node.creator?.name ?? ''} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], stixCoreObject)} + {(stixCoreObject.creators ?? []).map((c) => c?.name).join(', ')}
- {t('Creator')} + {t('Creators')} - +
+ {(stixCoreRelationship.creators ?? []).map((c) => { + return
+ +
; + })} +
+
@@ -637,7 +644,7 @@ const StixCoreRelationshipOverview = createFragmentContainer( created_at updated_at is_inferred - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectOverview.js b/opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectOverview.js index 8b06a6d3acf6..9e43d70e2111 100644 --- a/opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectOverview.js +++ b/opencti-platform/opencti-front/src/private/components/common/stix_domain_objects/StixDomainObjectOverview.js @@ -242,14 +242,17 @@ class StixDomainObjectOverview extends Component { {t('Creation date (in this platform)')} {fldt(stixDomainObject.created_at)} - - {t('Creator')} + + {t('Creators')} - +
+ {(stixDomainObject.creators ?? []).map((c) => { + return
+ +
; + })} +
+
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
{ isSortable: true, }, }; - const { sortBy, orderAsc, @@ -62,7 +63,6 @@ const Incidents: FunctionComponent = () => { numberOfElements, view, } = viewStorage; - const { onToggleEntity, numberOfSelectedElements, @@ -71,36 +71,42 @@ const Incidents: FunctionComponent = () => { deSelectedElements, handleToggleSelectAll, selectAll, - } = useEntityToggle( - LOCAL_STORAGE_KEY, - ); - + } = useEntityToggle(LOCAL_STORAGE_KEY); const queryRef = useQueryLoading( incidentsCardsAndLinesPaginationQuery, paginationOptions, ); // eslint-disable-next-line class-methods-use-this const isRuntimeSort = helper?.isRuntimeFieldEnable(); - const buildColumns = { name: { label: 'Name', - width: '25%', + width: '23%', isSortable: true, }, incident_type: { label: 'Incident type', - width: '10%', + width: '8%', isSortable: true, }, severity: { label: 'Severity', - width: '10%', + width: '5%', isSortable: true, }, + createdBy: { + label: 'Author', + width: '11%', + isSortable: isRuntimeSort ?? false, + }, + creator: { + label: 'Creators', + width: '11%', + isSortable: isRuntimeSort ?? false, + }, objectLabel: { label: 'Labels', - width: '17%', + width: '15%', isSortable: false, }, created: { @@ -108,18 +114,14 @@ const Incidents: FunctionComponent = () => { width: '10%', isSortable: true, }, - modified: { - label: 'Modification date', - width: '10%', - isSortable: true, - }, x_opencti_workflow_id: { label: 'Status', - width: '10%', + width: '8%', isSortable: true, }, objectMarking: { label: 'Marking', + width: '8%', isSortable: isRuntimeSort ?? false, }, }; @@ -148,6 +150,7 @@ const Incidents: FunctionComponent = () => { 'created_start_date', 'created_end_date', 'createdBy', + 'creator', 'confidence', ]} > @@ -155,11 +158,11 @@ const Incidents: FunctionComponent = () => { - {Array(20) - .fill(0) - .map((idx) => ( + {Array(20) + .fill(0) + .map((idx) => ( - ))} + ))} } > @@ -171,85 +174,95 @@ const Incidents: FunctionComponent = () => { )} - ); }; - const renderLines = () => { let renderFilters = filters; - renderFilters = { ...renderFilters, entity_type: [{ id: 'Incident', value: 'Incident' }] }; + renderFilters = { + ...renderFilters, + entity_type: [{ id: 'Incident', value: 'Incident' }], + }; return (
- - {queryRef && ( - {Array(20).fill(0).map((idx) => ())} - }> - - - )} - - + + {queryRef && ( + + {Array(20) + .fill(0) + .map((idx) => ( + + ))} + + } + > + + + )} + +
); }; - if (view === 'cards') { return ( -
- {renderCards()} - - - -
+
+ {renderCards()} + + + +
); } return ( @@ -257,7 +270,7 @@ const Incidents: FunctionComponent = () => {
{renderLines()} - +
diff --git a/opencti-platform/opencti-front/src/private/components/events/ObservedDatas.tsx b/opencti-platform/opencti-front/src/private/components/events/ObservedDatas.tsx index a531738f697c..584cb7f4434f 100644 --- a/opencti-platform/opencti-front/src/private/components/events/ObservedDatas.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/ObservedDatas.tsx @@ -1,7 +1,9 @@ import React, { FunctionComponent } from 'react'; import { QueryRenderer } from '../../../relay/environment'; import ListLines from '../../../components/list_lines/ListLines'; -import ObservedDatasLines, { observedDatasLinesQuery } from './observed_data/ObservedDatasLines'; +import ObservedDatasLines, { + observedDatasLinesQuery, +} from './observed_data/ObservedDatasLines'; import ObservedDataCreation from './observed_data/ObservedDataCreation'; import Security from '../../../utils/Security'; import { KNOWLEDGE_KNUPDATE } from '../../../utils/hooks/useGranted'; @@ -20,12 +22,16 @@ import { ModuleHelper } from '../../../utils/platformModulesHelper'; const LOCAL_STORAGE_KEY = 'view-observed-data'; interface ObservedDatasProps { - objectId: string, - authorId: string, - onChangeOpenExports: () => void, + objectId: string; + authorId: string; + onChangeOpenExports: () => void; } -const ObservedDatas: FunctionComponent = ({ objectId, authorId, onChangeOpenExports }) => { +const ObservedDatas: FunctionComponent = ({ + objectId, + authorId, + onChangeOpenExports, +}) => { const additionnalFilters = []; if (authorId) { additionnalFilters.push({ @@ -43,7 +49,11 @@ const ObservedDatas: FunctionComponent = ({ objectId, author filterMode: 'or', }); } - const { viewStorage, helpers: storageHelpers, paginationOptions } = usePaginationLocalStorage < ObservedDatasLinesPaginationQuery$variables >( + const { + viewStorage, + helpers: storageHelpers, + paginationOptions, + } = usePaginationLocalStorage( LOCAL_STORAGE_KEY, { searchTerm: '', @@ -72,7 +82,7 @@ const ObservedDatas: FunctionComponent = ({ objectId, author deSelectedElements, handleToggleSelectAll, selectAll, - } = useEntityToggle < ObservedDataLine_node$data >(LOCAL_STORAGE_KEY); + } = useEntityToggle(LOCAL_STORAGE_KEY); const renderLines = (helper: ModuleHelper | undefined) => { let exportContext = null; @@ -159,7 +169,11 @@ const ObservedDatas: FunctionComponent = ({ objectId, author ( + render={({ + props, + }: { + props: ObservedDatasLinesPaginationQuery$data; + }) => ( = ({ objectId, author return ( {({ helper }) => ( - -
- {renderLines(helper)} - - - -
-
+ +
+ {renderLines(helper)} + + + +
+
)}
); diff --git a/opencti-platform/opencti-front/src/private/components/events/StixSightingRelationships.tsx b/opencti-platform/opencti-front/src/private/components/events/StixSightingRelationships.tsx index d302f420ba40..f28df91cea1a 100644 --- a/opencti-platform/opencti-front/src/private/components/events/StixSightingRelationships.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/StixSightingRelationships.tsx @@ -13,9 +13,7 @@ import { } from './stix_sighting_relationships/__generated__/StixSightingRelationshipsLinesPaginationQuery.graphql'; import { convertFilters } from '../../../utils/ListParameters'; import useEntityToggle from '../../../utils/hooks/useEntityToggle'; -import { - StixSightingRelationshipLine_node$data, -} from './stix_sighting_relationships/__generated__/StixSightingRelationshipLine_node.graphql'; +import { StixSightingRelationshipLine_node$data } from './stix_sighting_relationships/__generated__/StixSightingRelationshipLine_node.graphql'; import ToolBar from '../data/ToolBar'; import ExportContextProvider from '../../../utils/ExportContextProvider'; @@ -73,13 +71,16 @@ const StixSightingRelationships = () => { viewStorage, paginationOptions: rawPaginationOptions, helpers: storageHelpers, - } = usePaginationLocalStorage(LOCAL_STORAGE_KEY, { - filters: {} as Filters, - searchTerm: '', - sortBy: 'created', - orderAsc: false, - openExports: false, - }); + } = usePaginationLocalStorage( + LOCAL_STORAGE_KEY, + { + filters: {} as Filters, + searchTerm: '', + sortBy: 'created', + orderAsc: false, + openExports: false, + }, + ); const { numberOfElements, @@ -98,14 +99,23 @@ const StixSightingRelationships = () => { deSelectedElements, handleToggleSelectAll, selectAll, - } = useEntityToggle( - LOCAL_STORAGE_KEY, - ); + } = useEntityToggle(LOCAL_STORAGE_KEY); - const renderLines = (paginationOptions: StixSightingRelationshipsLinesPaginationQuery$variables) => { + const renderLines = ( + paginationOptions: StixSightingRelationshipsLinesPaginationQuery$variables, + ) => { let renderFilters = filters; - renderFilters = { ...renderFilters, entity_type: [{ id: 'Stix-Sighting-Relationship', value: 'Stix-Sighting-Relationship' }] }; - return (
+ renderFilters = { + ...renderFilters, + entity_type: [ + { + id: 'Stix-Sighting-Relationship', + value: 'Stix-Sighting-Relationship', + }, + ], + }; + return ( +
{ ( + render={({ + props, + }: { + props: StixSightingRelationshipsLinesPaginationQuery$data; + }) => ( { const enrichedPaginationOptions: StixSightingRelationshipsLinesPaginationQuery$variables = { ...rawPaginationOptions, toId: toSightingId, - filters: convertFilters(newFilters) as StixSightingRelationshipsFiltering[], + filters: convertFilters( + newFilters, + ) as StixSightingRelationshipsFiltering[], }; return ( -
- {renderLines(enrichedPaginationOptions)} -
+
{renderLines(enrichedPaginationOptions)}
); }; diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/Incident.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/Incident.tsx index 29ed46b0f270..afad75b3e42b 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/Incident.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/Incident.tsx @@ -26,141 +26,146 @@ const useStyles = makeStyles(() => ({ })); const incidentFragment = graphql` - fragment Incident_incident on Incident { + fragment Incident_incident on Incident { + id + standard_id + x_opencti_stix_ids + spec_version + revoked + confidence + created + modified + created_at + updated_at + createdBy { + ... on Identity { + id + name + entity_type + } + } + creators { + name + } + objectMarking { + edges { + node { + id + definition_type + definition + x_opencti_order + x_opencti_color + } + } + } + objectLabel { + edges { + node { + id + value + color + } + } + } + objectAssignee { + edges { + node { id - standard_id - x_opencti_stix_ids - spec_version - revoked - confidence - created - modified - created_at - updated_at - createdBy { - ... on Identity { - id - name - entity_type - } - } - creator { - name - } - objectMarking { - edges { - node { - id - definition_type - definition - x_opencti_order - x_opencti_color - } - } - } - objectLabel { - edges { - node { - id - value - color - } - } - } - objectAssignee { - edges { - node { - id - name - entity_type - } - } - } name - aliases - status { - id - order - template { - name - color - } - } - workflowEnabled - ...IncidentDetails_incident + entity_type + } + } + } + name + aliases + status { + id + order + template { + name + color } - `; + } + workflowEnabled + ...IncidentDetails_incident + } +`; -const Incident = ({ incidentData }: { incidentData: Incident_incident$key }) => { +const Incident = ({ + incidentData, +}: { + incidentData: Incident_incident$key; +}) => { const classes = useStyles(); - const incident = useFragment(incidentFragment, incidentData); + const incident = useFragment( + incidentFragment, + incidentData, + ); return ( -
- - - - - - - - +
+ + + + - - - - - - - + + - - - - - - - + + + + - edge.node, - )} - /> - - + - -
+
+ + + + + + + + + + edge.node, + )} + /> + + + +
); }; diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCard.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCard.tsx index da98867183b2..aa6ec7a56828 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCard.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCard.tsx @@ -18,7 +18,7 @@ import { Theme } from '../../../../components/Theme'; import { IncidentCard_node$key } from './__generated__/IncidentCard_node.graphql'; import { useFormatter } from '../../../../components/i18n'; -const useStyles = makeStyles < Theme >((theme) => ({ +const useStyles = makeStyles((theme) => ({ card: { width: '100%', height: 170, @@ -88,39 +88,42 @@ const useStyles = makeStyles < Theme >((theme) => ({ })); const IncidentCardFragment = graphql` - fragment IncidentCard_node on Incident { - id - name - description - created - modified - objectMarking { - edges { - node { - id - definition_type - definition - x_opencti_order - x_opencti_color - } - } + fragment IncidentCard_node on Incident { + id + name + description + created + modified + objectMarking { + edges { + node { + id + definition_type + definition + x_opencti_order + x_opencti_color } - objectLabel { - edges { - node { - id - value - color - } - } + } + } + objectLabel { + edges { + node { + id + value + color } + } } + } `; interface IncidentCardProps { - node: IncidentCard_node$key ; - onLabelClick: () => void + node: IncidentCard_node$key; + onLabelClick: () => void; } -export const IncidentCard: FunctionComponent = ({ node, onLabelClick }) => { +export const IncidentCard: FunctionComponent = ({ + node, + onLabelClick, +}) => { const classes = useStyles(); const { t, fsd } = useFormatter(); const data = useFragment(IncidentCardFragment, node); diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCreation.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCreation.tsx index cc77b93f6edb..322b6d0b5611 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCreation.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentCreation.tsx @@ -28,9 +28,7 @@ import { isEmptyField } from '../../../../utils/utils'; import ObjectAssigneeField from '../../common/form/ObjectAssigneeField'; import { Theme } from '../../../../components/Theme'; import { Option } from '../../common/form/ReferenceField'; -import { - IncidentsCardsAndLinesPaginationQuery$variables, -} from './__generated__/IncidentsCardsAndLinesPaginationQuery.graphql'; +import { IncidentsCardsAndLinesPaginationQuery$variables } from './__generated__/IncidentsCardsAndLinesPaginationQuery.graphql'; import { useSchemaCreationValidation } from '../../../../utils/hooks/useEntitySettings'; const useStyles = makeStyles((theme) => ({ @@ -89,30 +87,36 @@ const IncidentMutation = graphql` `; interface IncidentAddInput { - name: string - description: string - confidence: number - incident_type: string - severity: string - source: string - createdBy: Option | undefined - objectMarking: Option[] - objectLabel: Option[] - objectAssignee: Option[] - externalReferences: Option[] + name: string; + description: string; + confidence: number; + incident_type: string; + severity: string; + source: string; + createdBy: Option | undefined; + objectMarking: Option[]; + objectLabel: Option[]; + objectAssignee: Option[]; + externalReferences: Option[]; } interface IncidentCreationProps { - updater: (store: RecordSourceSelectorProxy, key: string) => void - onReset?: () => void - onCompleted?: () => void - defaultCreatedBy?: Option - defaultMarkingDefinitions?: Option[] - defaultConfidence?: number + updater: (store: RecordSourceSelectorProxy, key: string) => void; + onReset?: () => void; + onCompleted?: () => void; + defaultCreatedBy?: Option; + defaultMarkingDefinitions?: Option[]; + defaultConfidence?: number; } -export const IncidentCreationForm: FunctionComponent = ({ updater, onReset, onCompleted, - defaultConfidence, defaultCreatedBy, defaultMarkingDefinitions }) => { +export const IncidentCreationForm: FunctionComponent = ({ + updater, + onReset, + onCompleted, + defaultConfidence, + defaultCreatedBy, + defaultMarkingDefinitions, +}) => { const classes = useStyles(); const { t } = useFormatter(); @@ -128,8 +132,13 @@ export const IncidentCreationForm: FunctionComponent = ({ }; const incidentValidator = useSchemaCreationValidation('Incident', basicShape); - const onSubmit: FormikConfig['onSubmit'] = (values, { setSubmitting, setErrors, resetForm }) => { - const cleanedValues = isEmptyField(values.severity) ? R.dissoc('severity', values) : values; + const onSubmit: FormikConfig['onSubmit'] = ( + values, + { setSubmitting, setErrors, resetForm }, + ) => { + const cleanedValues = isEmptyField(values.severity) + ? R.dissoc('severity', values) + : values; const finalValues = { ...cleanedValues, confidence: parseInt(String(cleanedValues.confidence), 10), @@ -137,7 +146,9 @@ export const IncidentCreationForm: FunctionComponent = ({ objectMarking: cleanedValues.objectMarking.map((v) => v.value), objectAssignee: cleanedValues.objectAssignee.map(({ value }) => value), objectLabel: cleanedValues.objectLabel.map(({ value }) => value), - externalReferences: cleanedValues.externalReferences.map(({ value }) => value), + externalReferences: cleanedValues.externalReferences.map( + ({ value }) => value, + ), }; commit({ variables: { @@ -162,7 +173,8 @@ export const IncidentCreationForm: FunctionComponent = ({ }); }; - return + return ( + initialValues={{ name: '', confidence: defaultConfidence ?? 75, @@ -178,129 +190,126 @@ export const IncidentCreationForm: FunctionComponent = ({ }} validationSchema={incidentValidator} onSubmit={onSubmit} - onReset={onReset}> - {({ - submitForm, - handleReset, - isSubmitting, - setFieldValue, - values, - }) => ( + onReset={onReset} + > + {({ submitForm, handleReset, isSubmitting, setFieldValue, values }) => (
- )} - ; + )} + + ); }; -const IncidentCreation = ({ paginationOptions }: { paginationOptions: IncidentsCardsAndLinesPaginationQuery$variables }) => { +const IncidentCreation = ({ + paginationOptions, +}: { + paginationOptions: IncidentsCardsAndLinesPaginationQuery$variables; +}) => { const classes = useStyles(); const { t } = useFormatter(); const [open, setOpen] = useState(false); const onReset = () => setOpen(false); - const updater = (store: RecordSourceSelectorProxy) => insertNode( - store, - 'Pagination_incidents', - paginationOptions, - 'incidentAdd', - ); + const updater = (store: RecordSourceSelectorProxy) => insertNode(store, 'Pagination_incidents', paginationOptions, 'incidentAdd'); return (
- setOpen(true)} + setOpen(true)} color="secondary" aria-label="Add" - className={classes.createButton}> + className={classes.createButton} + > setOpen(false)}> + onClose={() => setOpen(false)} + >
diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentDetails.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentDetails.tsx index 7e507ad260bf..c359cb79769e 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentDetails.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentDetails.tsx @@ -42,36 +42,41 @@ const useStyles = makeStyles(() => ({ })); const incidentDetailsFragment = graphql` - fragment IncidentDetails_incident on Incident { + fragment IncidentDetails_incident on Incident { + id + first_seen + last_seen + objective + description + incident_type + severity + source + status { id - first_seen - last_seen - objective - description - incident_type - severity - source - status { - id - order - template { - name - color - } + order + template { + name + color } - workflowEnabled - is_inferred } - `; + workflowEnabled + is_inferred + } +`; interface IncidentDetailsProps { - incidentData: IncidentDetails_incident$key ; + incidentData: IncidentDetails_incident$key; } -const IncidentDetails: FunctionComponent = ({ incidentData }) => { +const IncidentDetails: FunctionComponent = ({ + incidentData, +}) => { const classes = useStyles(); const { t, fldt } = useFormatter(); - const incident: IncidentDetails_incident$data = useFragment(incidentDetailsFragment, incidentData); + const incident: IncidentDetails_incident$data = useFragment( + incidentDetailsFragment, + incidentData, + ); const entitiesDataSelection = [ { @@ -131,7 +136,12 @@ const IncidentDetails: FunctionComponent = ({ incidentData {t('Severity')} - + { setOpen(false); }; - const queryRef = useQueryLoading(IncidentEditionQuery, { id: incidentId }); + const queryRef = useQueryLoading( + IncidentEditionQuery, + { id: incidentId }, + ); return ( -
- - - - - {queryRef && ( - }> - - - )} - -
+
+ + + + + {queryRef && ( + } + > + + + )} + +
); }; diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionContainer.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionContainer.tsx index 9ccfb8e40370..8979af167ed8 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionContainer.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionContainer.tsx @@ -1,5 +1,10 @@ import React, { FunctionComponent, useState } from 'react'; -import { createFragmentContainer, graphql, PreloadedQuery, usePreloadedQuery } from 'react-relay'; +import { + createFragmentContainer, + graphql, + PreloadedQuery, + usePreloadedQuery, +} from 'react-relay'; import Box from '@mui/material/Box'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; @@ -41,25 +46,27 @@ const useStyles = makeStyles((theme) => ({ })); interface IncidentEditionContainerProps { - queryRef: PreloadedQuery - handleClose: () => void, + queryRef: PreloadedQuery; + handleClose: () => void; } export const IncidentEditionQuery = graphql` - query IncidentEditionContainerQuery($id: String!) { - incident(id: $id) { - ...IncidentEditionOverview_incident - ...IncidentEditionDetails_incident - ...IncidentDetails_incident - editContext { - name - focusOn - } - } + query IncidentEditionContainerQuery($id: String!) { + incident(id: $id) { + ...IncidentEditionOverview_incident + ...IncidentEditionDetails_incident + ...IncidentDetails_incident + editContext { + name + focusOn + } } + } `; -const IncidentEditionContainer : FunctionComponent = ({ queryRef, handleClose }) => { +const IncidentEditionContainer: FunctionComponent< +IncidentEditionContainerProps +> = ({ queryRef, handleClose }) => { const classes = useStyles(); const { t } = useFormatter(); @@ -68,7 +75,7 @@ const IncidentEditionContainer : FunctionComponent setCurrentTab(value); if (queryData.incident === null) { - return (); + return ; } return (
@@ -90,10 +97,7 @@ const IncidentEditionContainer : FunctionComponent
- + diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionDetails.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionDetails.tsx index 2d9ca2f25832..36ef34ea843d 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionDetails.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionDetails.tsx @@ -9,9 +9,7 @@ import { SubscriptionFocus } from '../../../../components/Subscription'; import { adaptFieldValue } from '../../../../utils/String'; import CommitMessage from '../../common/form/CommitMessage'; import DateTimePickerField from '../../../../components/DateTimePickerField'; -import { - IncidentEditionDetailsFieldPatchMutation, -} from './__generated__/IncidentEditionDetailsFieldPatchMutation.graphql'; +import { IncidentEditionDetailsFieldPatchMutation } from './__generated__/IncidentEditionDetailsFieldPatchMutation.graphql'; import { IncidentEditionDetailsFocusMutation } from './__generated__/IncidentEditionDetailsFocusMutation.graphql'; import { Option } from '../../common/form/ReferenceField'; import { IncidentEditionDetails_incident$key } from './__generated__/IncidentEditionDetails_incident.graphql'; @@ -48,49 +46,63 @@ const incidentEditionDetailsFocus = graphql` `; const incidentEditionDetailsFragment = graphql` - fragment IncidentEditionDetails_incident on Incident { - id - first_seen - last_seen - source - objective - is_inferred - } - `; + fragment IncidentEditionDetails_incident on Incident { + id + first_seen + last_seen + source + objective + is_inferred + } +`; const incidentEditionDetailsValidation = (t: (v: string) => string) => Yup.object().shape({ - first_seen: Yup.date().nullable().typeError(t('The value must be a datetime (yyyy-MM-dd hh:mm (a|p)m)')), - last_seen: Yup.date().nullable() - .min(Yup.ref('first_seen'), "The last seen date can't be before first seen date") + first_seen: Yup.date() + .nullable() + .typeError(t('The value must be a datetime (yyyy-MM-dd hh:mm (a|p)m)')), + last_seen: Yup.date() + .nullable() + .min( + Yup.ref('first_seen'), + "The last seen date can't be before first seen date", + ) .typeError(t('The value must be a datetime (yyyy-MM-dd hh:mm (a|p)m)')), objective: Yup.string().nullable(), source: Yup.string().nullable(), }); interface IncidentEditionDetailsProps { - incidentRef: IncidentEditionDetails_incident$key ; - context: readonly ({ + incidentRef: IncidentEditionDetails_incident$key; + context: + | readonly ({ readonly focusOn: string | null; readonly name: string; - } | null)[] | null - enableReferences?: boolean - handleClose: () => void + } | null)[] + | null; + enableReferences?: boolean; + handleClose: () => void; } interface IncidentEditionDetailsFormValues { - message?: string - references?: Option[] - first_seen?: Option - last_seen?: Option + message?: string; + references?: Option[]; + first_seen?: Option; + last_seen?: Option; } -const IncidentEditionDetails : FunctionComponent = ({ incidentRef, context, enableReferences = false, handleClose }) => { +const IncidentEditionDetails: FunctionComponent< +IncidentEditionDetailsProps +> = ({ incidentRef, context, enableReferences = false, handleClose }) => { const { t } = useFormatter(); const incident = useFragment(incidentEditionDetailsFragment, incidentRef); const isInferred = incident.is_inferred; - const [commitFieldPatch] = useMutation(incidentMutationFieldPatch); - const [commitEditionDetailsFocus] = useMutation(incidentEditionDetailsFocus); + const [commitFieldPatch] = useMutation( + incidentMutationFieldPatch, + ); + const [commitEditionDetailsFocus] = useMutation( + incidentEditionDetailsFocus, + ); const handleChangeFocus = (name: string) => { commitEditionDetailsFocus({ @@ -103,7 +115,10 @@ const IncidentEditionDetails : FunctionComponent = }); }; - const onSubmit : FormikConfig['onSubmit'] = (values, { setSubmitting }) => { + const onSubmit: FormikConfig['onSubmit'] = ( + values, + { setSubmitting }, + ) => { const { message, references, ...otherValues } = values; const commitMessage = message ?? ''; const commitReferences = (references ?? []).map(({ value }) => value); @@ -118,7 +133,8 @@ const IncidentEditionDetails : FunctionComponent = variables: { id: incident.id, input: inputValues, - commitMessage: commitMessage && commitMessage.length > 0 ? commitMessage : null, + commitMessage: + commitMessage && commitMessage.length > 0 ? commitMessage : null, references: commitReferences, }, onCompleted: () => { @@ -154,88 +170,94 @@ const IncidentEditionDetails : FunctionComponent = }; return ( - - {({ - submitForm, - isSubmitting, - setFieldValue, - values, - isValid, - dirty, - }) => ( -
- - ), - }} - /> - - ), - }} - /> - } - /> - } + + {({ + submitForm, + isSubmitting, + setFieldValue, + values, + isValid, + dirty, + }) => ( + + + ), + }} + /> + + ), + }} + /> + + } + /> + + } + /> + {enableReferences && ( + - {enableReferences && ( - - )} - - )} - + )} + + )} +
); }; diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionOverview.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionOverview.tsx index 84d2422db674..dbbb7cef8afc 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionOverview.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentEditionOverview.tsx @@ -13,7 +13,12 @@ import ConfidenceField from '../../common/form/ConfidenceField'; import CommitMessage from '../../common/form/CommitMessage'; import { adaptFieldValue } from '../../../../utils/String'; import StatusField from '../../common/form/StatusField'; -import { convertAssignees, convertCreatedBy, convertMarkings, convertStatus } from '../../../../utils/edition'; +import { + convertAssignees, + convertCreatedBy, + convertMarkings, + convertStatus, +} from '../../../../utils/edition'; import OpenVocabField from '../../common/form/OpenVocabField'; import { fieldSpacingContainerStyle } from '../../../../utils/field'; import ObjectAssigneeField from '../../common/form/ObjectAssigneeField'; @@ -85,77 +90,80 @@ const incidentMutationRelationDelete = graphql` `; const incidentEditionOverviewFragment = graphql` - fragment IncidentEditionOverview_incident on Incident { - id - name - confidence - description - source - incident_type - severity - createdBy { - ... on Identity { - id - name - entity_type - } - } - objectMarking { - edges { - node { - id - definition_type - definition - x_opencti_order - x_opencti_color - } - } + fragment IncidentEditionOverview_incident on Incident { + id + name + confidence + description + source + incident_type + severity + createdBy { + ... on Identity { + id + name + entity_type } - objectAssignee { - edges { - node { - id - name - entity_type - } - } + } + objectMarking { + edges { + node { + id + definition_type + definition + x_opencti_order + x_opencti_color + } } - status { + } + objectAssignee { + edges { + node { id - order - template { - name - color - } + name + entity_type + } + } + } + status { + id + order + template { + name + color } - workflowEnabled - is_inferred } - `; + workflowEnabled + is_inferred + } +`; interface IncidentEditionOverviewProps { - incidentRef: IncidentEditionOverview_incident$key, - context: readonly ({ + incidentRef: IncidentEditionOverview_incident$key; + context: + | readonly ({ readonly focusOn: string | null; readonly name: string; - } | null)[] | null - enableReferences?: boolean - handleClose: () => void + } | null)[] + | null; + enableReferences?: boolean; + handleClose: () => void; } interface IncidentEditionFormValues { - message?: string - references?: Option[] - createdBy: Option | undefined - x_opencti_workflow_id: Option - objectMarking?: Option[] - objectAssignee?: Option[] + message?: string; + references?: Option[]; + createdBy: Option | undefined; + x_opencti_workflow_id: Option; + objectMarking?: Option[]; + objectAssignee?: Option[]; } -const IncidentEditionOverviewComponent : FunctionComponent = ({ incidentRef, context, enableReferences = false, handleClose }) => { +const IncidentEditionOverviewComponent: FunctionComponent< +IncidentEditionOverviewProps +> = ({ incidentRef, context, enableReferences = false, handleClose }) => { const { t } = useFormatter(); const incident = useFragment(incidentEditionOverviewFragment, incidentRef); - const basicShape = { name: Yup.string().min(2).required(t('This field is required')), confidence: Yup.number().nullable(), @@ -164,20 +172,25 @@ const IncidentEditionOverviewComponent : FunctionComponent['onSubmit'] = (values, { setSubmitting }) => { + const editor = useFormEditor( + incident, + enableReferences, + queries, + incidentValidator, + ); + const onSubmit: FormikConfig['onSubmit'] = ( + values, + { setSubmitting }, + ) => { const { message, references, ...otherValues } = values; const commitMessage = message ?? ''; const commitReferences = (references ?? []).map(({ value }) => value); - const inputValues = Object.entries({ ...otherValues, createdBy: values.createdBy?.value, @@ -185,12 +198,12 @@ const IncidentEditionOverviewComponent : FunctionComponent value), objectAssignee: (values.objectAssignee ?? []).map(({ value }) => value), }).map(([key, value]) => ({ key, value: adaptFieldValue(value) })); - editor.fieldPatch({ variables: { id: incident.id, input: inputValues, - commitMessage: commitMessage && commitMessage.length > 0 ? commitMessage : null, + commitMessage: + commitMessage && commitMessage.length > 0 ? commitMessage : null, references: commitReferences, }, onCompleted: () => { @@ -199,7 +212,6 @@ const IncidentEditionOverviewComponent : FunctionComponent { if (!enableReferences) { let finalValue: string = value as string; @@ -219,7 +231,6 @@ const IncidentEditionOverviewComponent : FunctionComponent false); } }; - const isInferred = incident.is_inferred; const initialValues = { name: incident.name, @@ -234,12 +245,13 @@ const IncidentEditionOverviewComponent : FunctionComponent + onSubmit={onSubmit} + > {({ submitForm, isSubmitting, @@ -308,7 +320,9 @@ const IncidentEditionOverviewComponent : FunctionComponent} + helperText={ + + } /> } + helperText={ + + } /> } + helpertext={ + + } onChange={editor.changeAssignee} /> {incident?.workflowEnabled && ( @@ -335,21 +353,30 @@ const IncidentEditionOverviewComponent : FunctionComponent} + helpertext={ + + } /> )} } + helpertext={ + + } onChange={editor.changeCreated} /> } + helpertext={ + + } onChange={editor.changeMarking} /> {enableReferences && ( diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentKnowledge.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentKnowledge.tsx index 0702efd0c058..b0728c7eedfb 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentKnowledge.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentKnowledge.tsx @@ -24,16 +24,20 @@ const useStyles = makeStyles(() => ({ })); const IncidentKnowledgeFragment = graphql` - fragment IncidentKnowledge_incident on Incident { - id - name - aliases - first_seen - last_seen - } + fragment IncidentKnowledge_incident on Incident { + id + name + aliases + first_seen + last_seen + } `; -const IncidentKnowledge = ({ incidentData }: { incidentData: IncidentKnowledge_incident$key }) => { +const IncidentKnowledge = ({ + incidentData, +}: { + incidentData: IncidentKnowledge_incident$key; +}) => { const classes = useStyles(); const incident = useFragment( @@ -47,7 +51,7 @@ const IncidentKnowledge = ({ incidentData }: { incidentData: IncidentKnowledge_i ((theme) => ({ item: { @@ -69,47 +72,58 @@ interface IncidentLineComponentProps { } const IncidentLineFragment = graphql` - fragment IncidentLine_node on Incident { + fragment IncidentLine_node on Incident { + id + name + incident_type + severity + created + modified + confidence + createdBy { + ... on Identity { id name - incident_type - severity - created - modified - confidence - objectMarking { - edges { - node { - id - definition_type - definition - x_opencti_order - x_opencti_color - } - } - } - objectLabel { - edges { - node { - id - value - color - } - } + entity_type + } + } + objectMarking { + edges { + node { + id + definition_type + definition + x_opencti_order + x_opencti_color } - status { - id - order - template { - name - color - } + } + } + objectLabel { + edges { + node { + id + value + color } - workflowEnabled + } + } + creators { + id + name + } + status { + id + order + template { + name + color + } } + workflowEnabled + } `; -export const IncidentLine : FunctionComponent = ({ +export const IncidentLine: FunctionComponent = ({ dataColumns, node, onLabelClick, @@ -177,6 +191,18 @@ export const IncidentLine : FunctionComponent = ({ variant="inList" />
+
+ {data.createdBy?.name} +
+
+ {(data.creators ?? []).map((c) => c?.name).join(', ')} +
= ({ > {fd(data.created)}
-
- {fd(data.modified)} -
= ({ ); }; -export const IncidentLineDummy = ({ dataColumns }: { dataColumns: DataColumns }) => { +export const IncidentLineDummy = ({ + dataColumns, +}: { + dataColumns: DataColumns; +}) => { const classes = useStyles(); return ( - - - - - - - - -
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
+ + + + + + + + +
+
- } - /> - - - -
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ } + /> + + + + ); }; diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentPopover.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentPopover.tsx index 19d92d31ea4d..a81313e2ea81 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentPopover.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentPopover.tsx @@ -14,7 +14,9 @@ import { useNavigate } from 'react-router-dom-v5-compat'; import { PopoverProps } from '@mui/material/Popover'; import DialogContentText from '@mui/material/DialogContentText'; import { useFormatter } from '../../../../components/i18n'; -import IncidentEditionContainer, { IncidentEditionQuery } from './IncidentEditionContainer'; +import IncidentEditionContainer, { + IncidentEditionQuery, +} from './IncidentEditionContainer'; import Loader, { LoaderVariant } from '../../../../components/Loader'; import Security from '../../../../utils/Security'; import Transition from '../../../../components/Transition'; @@ -59,7 +61,10 @@ const IncidentPopover = ({ id }: { id: string }) => { const [displayEdit, setDisplayEdit] = useState(false); const [commit] = useMutation(IncidentPopoverDeletionMutation); - const queryRef = useQueryLoading(IncidentEditionQuery, { id }); + const queryRef = useQueryLoading( + IncidentEditionQuery, + { id }, + ); const handleOpen = (event: React.SyntheticEvent) => { setAnchorEl(event.currentTarget); }; @@ -100,75 +105,62 @@ const IncidentPopover = ({ id }: { id: string }) => { }; return ( -
- - - - - - {t('Update')} - - - - {t('Delete')} - - - - - - - {t('Do you want to delete this incident?')} - - - - - - - - - {queryRef && ( - }> - - - )} - -
+
+ + + + + {t('Update')} + + {t('Delete')} + + + + + + {t('Do you want to delete this incident?')} + + + + + + + + + {queryRef && ( + } + > + + + )} + +
); }; // diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsCards.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsCards.tsx index 53b3c431112e..b65e921e7ee9 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsCards.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsCards.tsx @@ -2,7 +2,10 @@ import React, { FunctionComponent } from 'react'; import { graphql, PreloadedQuery } from 'react-relay'; import ListCardsContent from '../../../../components/list_cards/ListCardsContent'; import { IncidentCard, IncidentCardDummy } from './IncidentCard'; -import { HandleAddFilter, UseLocalStorageHelpers } from '../../../../utils/hooks/useLocalStorage'; +import { + HandleAddFilter, + UseLocalStorageHelpers, +} from '../../../../utils/hooks/useLocalStorage'; import usePreloadedPaginationFragment from '../../../../utils/hooks/usePreloadedPaginationFragment'; import { IncidentsCardsAndLines_data$key } from './__generated__/IncidentsCardsAndLines_data.graphql'; import { IncidentsCardsAndLinesPaginationQuery } from './__generated__/IncidentsCardsAndLinesPaginationQuery.graphql'; @@ -10,75 +13,75 @@ import { IncidentsCardsAndLinesPaginationQuery } from './__generated__/Incidents const nbOfCardsToLoad = 50; export const incidentsCardsAndLinesPaginationQuery = graphql` - query IncidentsCardsAndLinesPaginationQuery( - $search: String - $count: Int! - $cursor: ID - $orderBy: IncidentsOrdering - $orderMode: OrderingMode - $filters: [IncidentsFiltering] - ) { - ...IncidentsCardsAndLines_data - @arguments( - search: $search - count: $count - cursor: $cursor - orderBy: $orderBy - orderMode: $orderMode - filters: $filters - ) - } + query IncidentsCardsAndLinesPaginationQuery( + $search: String + $count: Int! + $cursor: ID + $orderBy: IncidentsOrdering + $orderMode: OrderingMode + $filters: [IncidentsFiltering] + ) { + ...IncidentsCardsAndLines_data + @arguments( + search: $search + count: $count + cursor: $cursor + orderBy: $orderBy + orderMode: $orderMode + filters: $filters + ) + } `; export const IncidentsCardsAndLinesFragment = graphql` - fragment IncidentsCardsAndLines_data on Query - @argumentDefinitions( - search: { type: "String" } - count: { type: "Int", defaultValue: 25 } - cursor: { type: "ID" } - orderBy: { type: "IncidentsOrdering", defaultValue: name } - orderMode: { type: "OrderingMode", defaultValue: asc } - filters: { type: "[IncidentsFiltering]" } - ) @refetchable(queryName: "IncidentsCardsRefetchQuery") { - incidents( - search: $search - first: $count - after: $cursor - orderBy: $orderBy - orderMode: $orderMode - filters: $filters - ) @connection(key: "Pagination_incidents") { - edges { - node { - id - name - description - ...IncidentCard_node - ...IncidentLine_node - } - } - pageInfo { - endCursor - hasNextPage - globalCount - } + fragment IncidentsCardsAndLines_data on Query + @argumentDefinitions( + search: { type: "String" } + count: { type: "Int", defaultValue: 25 } + cursor: { type: "ID" } + orderBy: { type: "IncidentsOrdering", defaultValue: name } + orderMode: { type: "OrderingMode", defaultValue: asc } + filters: { type: "[IncidentsFiltering]" } + ) + @refetchable(queryName: "IncidentsCardsRefetchQuery") { + incidents( + search: $search + first: $count + after: $cursor + orderBy: $orderBy + orderMode: $orderMode + filters: $filters + ) @connection(key: "Pagination_incidents") { + edges { + node { + id + name + description + ...IncidentCard_node + ...IncidentLine_node } + } + pageInfo { + endCursor + hasNextPage + globalCount + } } + } `; interface IncidentsCardsProps { - queryRef: PreloadedQuery, - setNumberOfElements: UseLocalStorageHelpers['handleSetNumberOfElements'], - onLabelClick: HandleAddFilter + queryRef: PreloadedQuery; + setNumberOfElements: UseLocalStorageHelpers['handleSetNumberOfElements']; + onLabelClick: HandleAddFilter; } -const IncidentsCards: FunctionComponent = ({ setNumberOfElements, queryRef, onLabelClick }) => { - const { - data, - hasMore, - loadMore, - isLoadingMore, - } = usePreloadedPaginationFragment< +const IncidentsCards: FunctionComponent = ({ + setNumberOfElements, + queryRef, + onLabelClick, +}) => { + const { data, hasMore, loadMore, isLoadingMore } = usePreloadedPaginationFragment< IncidentsCardsAndLinesPaginationQuery, IncidentsCardsAndLines_data$key >({ diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsLines.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsLines.tsx index b59462488fe0..4e08d6b9f024 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsLines.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/IncidentsLines.tsx @@ -3,9 +3,15 @@ import { PreloadedQuery } from 'react-relay'; import ListLinesContent from '../../../../components/list_lines/ListLinesContent'; import { IncidentLine, IncidentLineDummy } from './IncidentLine'; import { DataColumns } from '../../../../components/list_lines'; -import { HandleAddFilter, UseLocalStorageHelpers } from '../../../../utils/hooks/useLocalStorage'; +import { + HandleAddFilter, + UseLocalStorageHelpers, +} from '../../../../utils/hooks/useLocalStorage'; import usePreloadedPaginationFragment from '../../../../utils/hooks/usePreloadedPaginationFragment'; -import { IncidentsCardsAndLinesFragment, incidentsCardsAndLinesPaginationQuery } from './IncidentsCards'; +import { + IncidentsCardsAndLinesFragment, + incidentsCardsAndLinesPaginationQuery, +} from './IncidentsCards'; import { IncidentsCardsAndLinesPaginationQuery, IncidentsCardsAndLinesPaginationQuery$variables, @@ -16,11 +22,11 @@ import { IncidentLine_node$data } from './__generated__/IncidentLine_node.graphq const nbOfRowsToLoad = 50; interface IncidentsLinesProps { - paginationOptions?: IncidentsCardsAndLinesPaginationQuery$variables, - dataColumns: DataColumns, - queryRef: PreloadedQuery, - setNumberOfElements: UseLocalStorageHelpers['handleSetNumberOfElements'], - onLabelClick: HandleAddFilter, + paginationOptions?: IncidentsCardsAndLinesPaginationQuery$variables; + dataColumns: DataColumns; + queryRef: PreloadedQuery; + setNumberOfElements: UseLocalStorageHelpers['handleSetNumberOfElements']; + onLabelClick: HandleAddFilter; selectedElements: Record; deSelectedElements: Record; onToggleEntity: ( @@ -40,12 +46,10 @@ const IncidentsLines: FunctionComponent = ({ deSelectedElements, selectAll, }) => { - const { - data, - hasMore, - loadMore, - isLoadingMore, - } = usePreloadedPaginationFragment({ + const { data, hasMore, loadMore, isLoadingMore } = usePreloadedPaginationFragment< + IncidentsCardsAndLinesPaginationQuery, + IncidentsCardsAndLines_data$key + >({ linesQuery: incidentsCardsAndLinesPaginationQuery, linesFragment: IncidentsCardsAndLinesFragment, queryRef, diff --git a/opencti-platform/opencti-front/src/private/components/events/incidents/Root.tsx b/opencti-platform/opencti-front/src/private/components/events/incidents/Root.tsx index eda24d271c10..5ac5347fcce7 100644 --- a/opencti-platform/opencti-front/src/private/components/events/incidents/Root.tsx +++ b/opencti-platform/opencti-front/src/private/components/events/incidents/Root.tsx @@ -13,8 +13,7 @@ import FileManager from '../../common/files/FileManager'; import IncidentPopover from './IncidentPopover'; import Loader, { LoaderVariant } from '../../../../components/Loader'; import StixCoreObjectHistory from '../../common/stix_core_objects/StixCoreObjectHistory'; -import StixCoreObjectOrStixCoreRelationshipContainers - from '../../common/containers/StixCoreObjectOrStixCoreRelationshipContainers'; +import StixCoreObjectOrStixCoreRelationshipContainers from '../../common/containers/StixCoreObjectOrStixCoreRelationshipContainers'; import ErrorNotFound from '../../../../components/ErrorNotFound'; import StixCoreObjectKnowledgeBar from '../../common/stix_core_objects/StixCoreObjectKnowledgeBar'; import StixDomainObjectContent from '../../common/stix_domain_objects/StixDomainObjectContent'; @@ -65,7 +64,9 @@ const incidentQuery = graphql` const RootIncidentComponent = ({ queryRef }) => { const { incidentId } = useParams() as { incidentId: string }; - const subConfig = useMemo>( + const subConfig = useMemo< + GraphQLSubscriptionConfig + >( () => ({ subscription, variables: { id: incidentId }, @@ -76,138 +77,134 @@ const RootIncidentComponent = ({ queryRef }) => { const data = usePreloadedQuery(incidentQuery, queryRef); const { incident, connectorsForImport, connectorsForExport } = data; return ( -
- <> - {incident ? ( - - } - /> - ( - - )} - /> - ( - - )} - /> - ( - - - - - )} - /> - ( - - - - - )} - /> - ( - - - - - )} - /> - ( - - - - - )} - /> - - ) : ( - - )} - -
+
+ <> + {incident ? ( + + } + /> + ( + + )} + /> + } + /> + ( + + + + + )} + /> + ( + + + + + )} + /> + ( + + + + + )} + /> + ( + + + + + )} + /> + + ) : ( + + )} + +
); }; const RootIncident = () => { const { incidentId } = useParams() as { incidentId: string }; - const queryRef = useQueryLoading < RootIncidentQuery >(incidentQuery, { id: incidentId }); + const queryRef = useQueryLoading(incidentQuery, { + id: incidentId, + }); const link = `/dashboard/events/incidents/${incidentId}/knowledge`; return (
- - - - + + + + {queryRef ? ( }> diff --git a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedData.js b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedData.js index c453748ce5cc..a4ae9bb48694 100644 --- a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedData.js +++ b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedData.js @@ -83,7 +83,9 @@ class ObservedDataComponent extends Component { edge.node)} + defaultMarking={(observedData.objectMarking?.edges ?? []).map( + (edge) => edge.node, + )} /> @@ -119,7 +121,7 @@ const ObservedData = createFragmentContainer(ObservedDataComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataCreation.js b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataCreation.js index acacaaebafbc..46d8de3144b4 100644 --- a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataCreation.js +++ b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataCreation.js @@ -10,7 +10,10 @@ import IconButton from '@mui/material/IconButton'; import Fab from '@mui/material/Fab'; import { Add, Close } from '@mui/icons-material'; import makeStyles from '@mui/styles/makeStyles'; -import { commitMutation, handleErrorInForm } from '../../../../relay/environment'; +import { + commitMutation, + handleErrorInForm, +} from '../../../../relay/environment'; import { useFormatter } from '../../../../components/i18n'; import TextField from '../../../../components/TextField'; import ObjectMarkingField from '../../common/form/ObjectMarkingField'; @@ -71,16 +74,22 @@ const useStyles = makeStyles((theme) => ({ const observedDataCreationMutation = graphql` mutation ObservedDataCreationMutation($input: ObservedDataAddInput!) { observedDataAdd(input: $input) { - id - name - entity_type - ...ObservedDataLine_node + id + name + entity_type + ...ObservedDataLine_node } } `; -export const ObservedDataCreationForm = ({ updater, onReset, onCompleted, - defaultConfidence, defaultCreatedBy, defaultMarkingDefinitions }) => { +export const ObservedDataCreationForm = ({ + updater, + onReset, + onCompleted, + defaultConfidence, + defaultCreatedBy, + defaultMarkingDefinitions, +}) => { const classes = useStyles(); const { t } = useFormatter(); const basicShape = { @@ -94,7 +103,10 @@ export const ObservedDataCreationForm = ({ updater, onReset, onCompleted, number_observed: Yup.number().required(t('This field is required')), confidence: Yup.number().nullable(), }; - const observedDataValidator = useSchemaCreationValidation('Observed-Data', basicShape); + const observedDataValidator = useSchemaCreationValidation( + 'Observed-Data', + basicShape, + ); const onSubmit = (values, { setSubmitting, setErrors, resetForm }) => { const adaptedValues = evolve( { @@ -135,7 +147,8 @@ export const ObservedDataCreationForm = ({ updater, onReset, onCompleted, }); }; - return - {({ - submitForm, - handleReset, - isSubmitting, - setFieldValue, - values, - }) => ( + onReset={onReset} + > + {({ submitForm, handleReset, isSubmitting, setFieldValue, values }) => (
- )} -
; + )} + + ); }; const ObservedDataCreation = ({ paginationOptions }) => { @@ -262,34 +271,39 @@ const ObservedDataCreation = ({ paginationOptions }) => { return (
- + className={classes.createButton} + > - + onClose={handleClose} + >
+ color="primary" + > {t('Create an observed data')}
handleClose()} - onReset={onReset} + updater={updater} + onCompleted={() => handleClose()} + onReset={onReset} />
diff --git a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEdition.js b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEdition.js index adb5a470584d..189ee2f772bc 100644 --- a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEdition.js +++ b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEdition.js @@ -86,7 +86,10 @@ class ObservedDataEdition extends Component { render={({ props }) => { if (props) { return ( - + ); } return ; diff --git a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEditionOverview.js b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEditionOverview.js index 17220f7b9e1a..40568cdf2064 100644 --- a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEditionOverview.js +++ b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDataEditionOverview.js @@ -13,7 +13,11 @@ import { adaptFieldValue } from '../../../../utils/String'; import CommitMessage from '../../common/form/CommitMessage'; import StatusField from '../../common/form/StatusField'; import { buildDate, parse } from '../../../../utils/Time'; -import { convertCreatedBy, convertMarkings, convertStatus } from '../../../../utils/edition'; +import { + convertCreatedBy, + convertMarkings, + convertStatus, +} from '../../../../utils/edition'; import DateTimePickerField from '../../../../components/DateTimePickerField'; import { fieldSpacingContainerStyle } from '../../../../utils/field'; import { useSchemaEditionValidation } from '../../../../utils/hooks/useEntitySettings'; @@ -96,7 +100,11 @@ const ObservedDataEditionOverviewComponent = (props) => { references: Yup.array(), x_opencti_workflow_id: Yup.object(), }; - const observedDataValidator = useSchemaEditionValidation('Observed-Data', basicShape, ['objects']); + const observedDataValidator = useSchemaEditionValidation( + 'Observed-Data', + basicShape, + ['objects'], + ); const queries = { fieldPatch: observedDataMutationFieldPatch, @@ -104,7 +112,12 @@ const ObservedDataEditionOverviewComponent = (props) => { relationDelete: observedDataMutationRelationDelete, editionFocus: observedDataEditionOverviewFocus, }; - const editor = useFormEditor(observedData, enableReferences, queries, observedDataValidator); + const editor = useFormEditor( + observedData, + enableReferences, + queries, + observedDataValidator, + ); const onSubmit = (values, { setSubmitting }) => { const commitMessage = values.message; @@ -178,155 +191,172 @@ const ObservedDataEditionOverviewComponent = (props) => { )(observedData); return ( - - {({ - submitForm, - isSubmitting, - setFieldValue, - values, - isValid, - dirty, - }) => ( -
-
- - ), - }} - /> - - ), - }} - /> - - } - /> - + {({ + submitForm, + isSubmitting, + setFieldValue, + values, + isValid, + dirty, + }) => ( +
+ + + ), + }} + /> + + ), + }} + /> + + } + /> + + {observedData.workflowEnabled && ( + - {observedData.workflowEnabled && ( - - } - /> - )} - - } - onChange={editor.changeCreated} - /> - + } - onChange={editor.changeMarking} /> - {enableReferences && ( - + } + onChange={editor.changeCreated} + /> + - )} - -
- )} - + } + onChange={editor.changeMarking} + /> + {enableReferences && ( + + )} + +
+ )} +
); }; export default createFragmentContainer(ObservedDataEditionOverviewComponent, { observedData: graphql` - fragment ObservedDataEditionOverview_observedData on ObservedData { - id - confidence - first_observed - last_observed - number_observed - createdBy { - ... on Identity { - id - name - entity_type - } + fragment ObservedDataEditionOverview_observedData on ObservedData { + id + confidence + first_observed + last_observed + number_observed + createdBy { + ... on Identity { + id + name + entity_type } - objectMarking { - edges { - node { - id - definition_type - definition - x_opencti_order - x_opencti_color - } + } + objectMarking { + edges { + node { + id + definition_type + definition + x_opencti_order + x_opencti_color } } - is_inferred - status { - id - order - template { - name - color - } + } + is_inferred + status { + id + order + template { + name + color } - workflowEnabled } - `, + workflowEnabled + } + `, }); diff --git a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDatasLines.js b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDatasLines.js index 3b2cc7e37fc2..6b9ced379f6d 100644 --- a/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDatasLines.js +++ b/opencti-platform/opencti-front/src/private/components/events/observed_data/ObservedDatasLines.js @@ -36,7 +36,9 @@ class ObservedDatasLines extends Component { hasMore={relay.hasMore.bind(this)} isLoading={relay.isLoading.bind(this)} dataList={data?.observedDatas?.edges ?? []} - globalCount={data?.observedDatas?.pageInfo?.globalCount ?? nbOfRowsToLoad} + globalCount={ + data?.observedDatas?.pageInfo?.globalCount ?? nbOfRowsToLoad + } LineComponent={} DummyLineComponent={} dataColumns={dataColumns} diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/EntityStixSightingRelationships.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/EntityStixSightingRelationships.js index 4ad38c678027..fe5a8df57a3d 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/EntityStixSightingRelationships.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/EntityStixSightingRelationships.js @@ -46,9 +46,9 @@ class EntityStixSightingRelationships extends Component { params = buildViewParamsFromUrlAndStorage( props.history, props.location, - `view-sightings-${ - props.entityId - }-${props.stixCoreObjectTypes?.join('-')}`, + `view-sightings-${props.entityId}-${props.stixCoreObjectTypes?.join( + '-', + )}`, ); } this.state = { diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromEntity.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromEntity.js index dc07752f941a..edbf5375ef92 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromEntity.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromEntity.js @@ -405,10 +405,7 @@ class StixSightingRelationshipCreationFromEntity extends Component { renderDomainObjectSearchResults() { const { stixCoreObjectTypes } = this.props; - if ( - !stixCoreObjectTypes - || stixCoreObjectTypes.length === 0 - ) { + if (!stixCoreObjectTypes || stixCoreObjectTypes.length === 0) { return null; } diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromRelation.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromRelation.js index c001be04c110..ed4fb2361acf 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromRelation.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipCreationFromRelation.js @@ -493,10 +493,7 @@ class StixSightingRelationshipCreationFromRelation extends Component { const stixDomainObjectsPaginationOptions = { search: this.state.search, types: stixCoreObjectTypes - ? filter( - (n) => n !== 'Stix-Cyber-Observable', - stixCoreObjectTypes, - ) + ? filter((n) => n !== 'Stix-Cyber-Observable', stixCoreObjectTypes) : null, orderBy: 'created_at', orderMode: 'desc', diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipEditionOverview.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipEditionOverview.js index 750c6bf55e44..26f275fb8fb8 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipEditionOverview.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipEditionOverview.js @@ -12,16 +12,26 @@ import makeStyles from '@mui/styles/makeStyles'; import { buildDate } from '../../../../utils/Time'; import { resolveLink } from '../../../../utils/Entity'; import { useFormatter } from '../../../../components/i18n'; -import { commitMutation, requestSubscription } from '../../../../relay/environment'; +import { + commitMutation, + requestSubscription, +} from '../../../../relay/environment'; import TextField from '../../../../components/TextField'; -import { SubscriptionAvatars, SubscriptionFocus } from '../../../../components/Subscription'; +import { + SubscriptionAvatars, + SubscriptionFocus, +} from '../../../../components/Subscription'; import ObjectMarkingField from '../../common/form/ObjectMarkingField'; import CreatedByField from '../../common/form/CreatedByField'; import ConfidenceField from '../../common/form/ConfidenceField'; import SwitchField from '../../../../components/SwitchField'; import MarkDownField from '../../../../components/MarkDownField'; import StatusField from '../../common/form/StatusField'; -import { convertCreatedBy, convertMarkings, convertStatus } from '../../../../utils/edition'; +import { + convertCreatedBy, + convertMarkings, + convertStatus, +} from '../../../../utils/edition'; import DateTimePickerField from '../../../../components/DateTimePickerField'; import { fieldSpacingContainerStyle } from '../../../../utils/field'; import { useIsEnforceReference } from '../../../../utils/hooks/useEntitySettings'; diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipLine.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipLine.js index 7b25b7951232..b3149fe6bf7b 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipLine.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipLine.js @@ -69,7 +69,21 @@ const styles = (theme) => ({ class StixSightingRelationshipLineComponent extends Component { render() { - const { nsdt, t, fd, classes, dataColumns, node, paginationOptions, selectedElements, deSelectedElements, selectAll, onToggleEntity, onToggleShiftEntity, index } = this.props; + const { + nsdt, + t, + fd, + classes, + dataColumns, + node, + paginationOptions, + selectedElements, + deSelectedElements, + selectAll, + onToggleEntity, + onToggleShiftEntity, + index, + } = this.props; const entityFrom = node.from; const entityTo = node.to; const restrictedFrom = entityFrom === null; @@ -101,7 +115,9 @@ class StixSightingRelationshipLineComponent extends Component { /> - + - {t('Creator')} + {t('Creators')} - +
+ {(stixSightingRelationship.creators ?? []).map((c) => { + return ( +
+ +
+ ); + })} +
+
@@ -589,7 +601,7 @@ const StixSightingRelationshipOverview = createFragmentContainer( created_at updated_at is_inferred - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipPopover.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipPopover.js index 7c779530e81d..09a310ed623e 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipPopover.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipPopover.js @@ -94,7 +94,8 @@ class StixSightingRelationshipPopover extends Component { id: this.props.stixSightingRelationshipId, }, updater: (store) => { - const isUndefinedCallback = this.props.onDelete === undefined || typeof this.props.onDelete !== 'function'; + const isUndefinedCallback = this.props.onDelete === undefined + || typeof this.props.onDelete !== 'function'; if (isUndefinedCallback) { deleteNode( store, @@ -151,7 +152,8 @@ class StixSightingRelationshipPopover extends Component { PaperProps={{ elevation: 1 }} keepMounted={true} TransitionComponent={Transition} - onClose={this.handleCloseDelete.bind(this)}> + onClose={this.handleCloseDelete.bind(this)} + > {t('Do you want to delete this sighting?')} diff --git a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipsLines.js b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipsLines.js index 889493195ae1..f682631cdc9e 100644 --- a/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipsLines.js +++ b/opencti-platform/opencti-front/src/private/components/events/stix_sighting_relationships/StixSightingRelationshipsLines.js @@ -2,7 +2,10 @@ import React, { Component } from 'react'; import * as PropTypes from 'prop-types'; import { createPaginationContainer, graphql } from 'react-relay'; import ListLinesContent from '../../../../components/list_lines/ListLinesContent'; -import { StixSightingRelationshipLine, StixSightingRelationshipLineDummy } from './StixSightingRelationshipLine'; +import { + StixSightingRelationshipLine, + StixSightingRelationshipLineDummy, +} from './StixSightingRelationshipLine'; import { setNumberOfElements } from '../../../../utils/Number'; const nbOfRowsToLoad = 50; @@ -37,7 +40,10 @@ class StixSightingRelationshipsLines extends Component { hasMore={relay.hasMore.bind(this)} isLoading={relay.isLoading.bind(this)} dataList={data?.stixSightingRelationships?.edges ?? []} - globalCount={data?.stixSightingRelationships?.pageInfo?.globalCount ?? nbOfRowsToLoad} + globalCount={ + data?.stixSightingRelationships?.pageInfo?.globalCount + ?? nbOfRowsToLoad + } LineComponent={} DummyLineComponent={} dataColumns={dataColumns} diff --git a/opencti-platform/opencti-front/src/private/components/locations/administrative_areas/AdministrativeArea.tsx b/opencti-platform/opencti-front/src/private/components/locations/administrative_areas/AdministrativeArea.tsx index 21e49a449084..2a8132046c9e 100644 --- a/opencti-platform/opencti-front/src/private/components/locations/administrative_areas/AdministrativeArea.tsx +++ b/opencti-platform/opencti-front/src/private/components/locations/administrative_areas/AdministrativeArea.tsx @@ -44,7 +44,7 @@ const administrativeAreaFragment = graphql` entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/locations/cities/City.tsx b/opencti-platform/opencti-front/src/private/components/locations/cities/City.tsx index 979a6c9eb946..3dafbed4cb16 100644 --- a/opencti-platform/opencti-front/src/private/components/locations/cities/City.tsx +++ b/opencti-platform/opencti-front/src/private/components/locations/cities/City.tsx @@ -44,7 +44,7 @@ const cityFragment = graphql` entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/locations/countries/Country.tsx b/opencti-platform/opencti-front/src/private/components/locations/countries/Country.tsx index 9cc861ed513a..7e397580cc0a 100644 --- a/opencti-platform/opencti-front/src/private/components/locations/countries/Country.tsx +++ b/opencti-platform/opencti-front/src/private/components/locations/countries/Country.tsx @@ -44,7 +44,7 @@ export const countryFragment = graphql` entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/locations/positions/Position.tsx b/opencti-platform/opencti-front/src/private/components/locations/positions/Position.tsx index c0667b2f554e..27ae20c2d735 100644 --- a/opencti-platform/opencti-front/src/private/components/locations/positions/Position.tsx +++ b/opencti-platform/opencti-front/src/private/components/locations/positions/Position.tsx @@ -144,7 +144,7 @@ const Position = createFragmentContainer(PositionComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/locations/regions/Region.tsx b/opencti-platform/opencti-front/src/private/components/locations/regions/Region.tsx index e0daa997f7b9..5952f787841b 100644 --- a/opencti-platform/opencti-front/src/private/components/locations/regions/Region.tsx +++ b/opencti-platform/opencti-front/src/private/components/locations/regions/Region.tsx @@ -44,7 +44,7 @@ const regionFragment = graphql` entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/observations/Indicators.js b/opencti-platform/opencti-front/src/private/components/observations/Indicators.js index 91cb2841fb3b..b7ba292695fe 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/Indicators.js +++ b/opencti-platform/opencti-front/src/private/components/observations/Indicators.js @@ -259,7 +259,7 @@ class Indicators extends Component { isSortable: true, }, creator: { - label: 'Creator', + label: 'Creators', width: '10%', isSortable: true, }, diff --git a/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx b/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx index 9c1935557520..04bef18e2ecd 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx +++ b/opencti-platform/opencti-front/src/private/components/observations/StixCyberObservables.tsx @@ -128,7 +128,7 @@ const StixCyberObservables: FunctionComponent = () => { isSortable: isRuntimeSort, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: isRuntimeSort, }, diff --git a/opencti-platform/opencti-front/src/private/components/observations/indicators/Indicator.js b/opencti-platform/opencti-front/src/private/components/observations/indicators/Indicator.js index 9f7831a5bfeb..72469ff0023d 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/indicators/Indicator.js +++ b/opencti-platform/opencti-front/src/private/components/observations/indicators/Indicator.js @@ -121,7 +121,7 @@ const Indicator = createFragmentContainer(IndicatorComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorDetails.js b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorDetails.js index ef58e689a34a..bac80ea226a7 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorDetails.js +++ b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorDetails.js @@ -188,10 +188,6 @@ const IndicatorDetails = createFragmentContainer(IndicatorDetailsComponent, { x_opencti_detection x_mitre_platforms indicator_types - creator { - id - name - } objectLabel { edges { node { diff --git a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntities.js b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntities.js index 45c836e6f5e7..05cee9a2b3a5 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntities.js +++ b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntities.js @@ -64,7 +64,7 @@ class IndicatorEntities extends Component { isSortable: false, }, creator: { - label: 'Creator', + label: 'Creators', width: '12%', isSortable: false, }, diff --git a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntityLine.js b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntityLine.js index 62e0cd47092d..7d446e6538e7 100644 --- a/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntityLine.js +++ b/opencti-platform/opencti-front/src/private/components/observations/indicators/IndicatorEntityLine.js @@ -188,7 +188,7 @@ class IndicatorEntityLineComponent extends Component { className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
{ className={classes.bodyItem} style={{ width: dataColumns.creator.width }} > - {node.creator.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {node.creator?.name} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
- {R.pathOr('', ['creator', 'name'], stixCoreObject)} + {(stixCoreObject.creators ?? []).map((c) => c?.name).join(', ')}
- {t('Creator')} + {t('Creators')} - +
+ {(stixCyberObservable.creators ?? []).map((c) => { + return
+ +
; + })} +
+
- {R.pathOr('', ['creator', 'name'], node)} + {(node.creators ?? []).map((c) => c?.name).join(', ')}
diff --git a/opencti-platform/opencti-front/src/private/components/threats/IntrusionSets.js b/opencti-platform/opencti-front/src/private/components/threats/IntrusionSets.js index cf765536574b..ab5addcdf389 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/IntrusionSets.js +++ b/opencti-platform/opencti-front/src/private/components/threats/IntrusionSets.js @@ -148,6 +148,7 @@ class IntrusionSets extends Component { 'created_start_date', 'created_end_date', 'createdBy', + 'creator', 'revoked', 'confidence', ]} diff --git a/opencti-platform/opencti-front/src/private/components/threats/ThreatActors.js b/opencti-platform/opencti-front/src/private/components/threats/ThreatActors.js index ad9b1c3d607d..7385955b7f37 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/ThreatActors.js +++ b/opencti-platform/opencti-front/src/private/components/threats/ThreatActors.js @@ -148,6 +148,7 @@ class ThreatActors extends Component { 'created_start_date', 'created_end_date', 'createdBy', + 'creator', 'revoked', 'confidence', ]} diff --git a/opencti-platform/opencti-front/src/private/components/threats/campaigns/Campaign.js b/opencti-platform/opencti-front/src/private/components/threats/campaigns/Campaign.js index 742509dbf1b2..c2a240ed6e51 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/campaigns/Campaign.js +++ b/opencti-platform/opencti-front/src/private/components/threats/campaigns/Campaign.js @@ -121,7 +121,7 @@ const Campaign = createFragmentContainer(CampaignComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/threats/intrusion_sets/IntrusionSet.js b/opencti-platform/opencti-front/src/private/components/threats/intrusion_sets/IntrusionSet.js index fee1d6ee8d96..e925411779f2 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/intrusion_sets/IntrusionSet.js +++ b/opencti-platform/opencti-front/src/private/components/threats/intrusion_sets/IntrusionSet.js @@ -122,7 +122,7 @@ const IntrusionSet = createFragmentContainer(IntrusionSetComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActor.js b/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActor.js index a813164c4aa8..bf8b1bdec710 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActor.js +++ b/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActor.js @@ -122,7 +122,7 @@ const ThreatActor = createFragmentContainer(ThreatActorComponent, { entity_type } } - creator { + creators { id name } diff --git a/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActorEditionOverview.js b/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActorEditionOverview.js index d9d4750b8727..3ec6ae047a70 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActorEditionOverview.js +++ b/opencti-platform/opencti-front/src/private/components/threats/threat_actors/ThreatActorEditionOverview.js @@ -88,7 +88,6 @@ const threatActorMutationRelationDelete = graphql` const ThreatActorEditionOverviewComponent = (props) => { const { threatActor, enableReferences, context, handleClose } = props; const { t } = useFormatter(); - const basicShape = { name: Yup.string().min(2).required(t('This field is required')), threat_actor_types: Yup.array().nullable(), @@ -101,7 +100,6 @@ const ThreatActorEditionOverviewComponent = (props) => { 'Threat-Actor', basicShape, ); - const queries = { fieldPatch: threatActorMutationFieldPatch, relationAdd: threatActorMutationRelationAdd, @@ -114,7 +112,6 @@ const ThreatActorEditionOverviewComponent = (props) => { queries, threatActorValidator, ); - const onSubmit = (values, { setSubmitting }) => { const commitMessage = values.message; const references = R.pluck('value', values.references || []); @@ -142,7 +139,6 @@ const ThreatActorEditionOverviewComponent = (props) => { }, }); }; - const handleSubmitField = (name, value) => { if (!enableReferences) { let finalValue = value; @@ -162,7 +158,6 @@ const ThreatActorEditionOverviewComponent = (props) => { .catch(() => false); } }; - const initialValues = R.pipe( R.assoc('createdBy', convertCreatedBy(threatActor)), R.assoc('killChainPhases', convertKillChainPhases(threatActor)), diff --git a/opencti-platform/opencti-front/src/schema/relay.schema.graphql b/opencti-platform/opencti-front/src/schema/relay.schema.graphql index c48fa7c3b935..47dbcf76edd8 100644 --- a/opencti-platform/opencti-front/src/schema/relay.schema.graphql +++ b/opencti-platform/opencti-front/src/schema/relay.schema.graphql @@ -1480,7 +1480,7 @@ interface StixObject { spec_version: String! created_at: DateTime! updated_at: DateTime! - creator: Creator + creators: [Creator!] x_opencti_inferences: [Inference] } @@ -1549,7 +1549,7 @@ type MarkingDefinition implements BasicObject & StixObject & StixMetaObject { definition: String x_opencti_order: Int! x_opencti_color: String - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] } @@ -1613,7 +1613,7 @@ type Label implements BasicObject & StixObject & StixMetaObject { modified: DateTime value: String color: String - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] } @@ -1687,7 +1687,7 @@ type ExternalReference implements BasicObject & StixObject & StixMetaObject { external_id: String references(types: [String]): StixObjectOrStixRelationshipConnection fileId: String - creator: Creator + creators: [Creator!] importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection exportFiles(first: Int): FileConnection @@ -1761,7 +1761,7 @@ type KillChainPhase implements BasicObject & StixObject & StixMetaObject { kill_chain_name: String! phase_name: String! x_opencti_order: Int - creator: Creator + creators: [Creator!] editContext: [EditUserContext!] } @@ -1882,7 +1882,7 @@ interface StixCoreObject { stixCoreRelationships(first: Int, after: ID, orderBy: StixCoreRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCoreRelationshipsFiltering], filterMode: FilterMode): StixCoreRelationshipConnection stixCoreObjectsDistribution(relationship_type: [String], toTypes: [String], field: String!, startDate: DateTime, endDate: DateTime, dateAttribute: String, operation: StatsOperation!, limit: Int, order: String, types: [String], filters: [StixCoreObjectsFiltering], filterMode: FilterMode, search: String): [Distribution] stixCoreRelationshipsDistribution(field: String!, operation: StatsOperation!, startDate: DateTime, endDate: DateTime, dateAttribute: String, isTo: Boolean, limit: Int, order: String, elementWithTargetTypes: [String], fromId: [String], fromRole: String, fromTypes: [String], toId: [String], toRole: String, toTypes: [String], relationship_type: [String], confidences: [Int], search: String, filters: [StixCoreRelationshipsFiltering], filterMode: FilterMode): [Distribution] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2016,7 +2016,7 @@ interface StixDomainObject { modified: DateTime x_opencti_graph_data: String objectAssignee: AssigneeConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2141,7 +2141,7 @@ type AttackPattern implements BasicObject & StixObject & StixCoreObject & StixDo subAttackPatterns: AttackPatternConnection isSubAttackPattern: Boolean dataComponents: DataComponentConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2205,6 +2205,7 @@ enum CampaignsFilter { x_opencti_workflow_id revoked confidence + creator } input CampaignsFiltering { @@ -2262,7 +2263,7 @@ type Campaign implements BasicObject & StixObject & StixCoreObject & StixDomainO first_seen: DateTime last_seen: DateTime objective: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2381,7 +2382,7 @@ interface Container { objectAssignee: AssigneeConnection objects(first: Int, after: ID, orderBy: StixObjectOrStixRelationshipsOrdering, orderMode: OrderingMode, filters: [StixObjectOrStixRelationshipsFiltering], filterMode: FilterMode, search: String, types: [String], all: Boolean): StixObjectOrStixRelationshipRefConnection relatedContainers(first: Int, after: ID, orderBy: ContainersOrdering, orderMode: OrderingMode, filters: [ContainersFiltering], filterMode: FilterMode, search: String, types: [String], viaTypes: [String]): ContainerConnection - creator: Creator + creators: [Creator!] workflowEnabled: Boolean status: Status } @@ -2475,7 +2476,7 @@ type Note implements BasicObject & StixObject & StixCoreObject & StixDomainObjec authors: [String] note_types: [String] likelihood: Int - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2620,7 +2621,7 @@ type ObservedData implements BasicObject & StixObject & StixCoreObject & StixDom last_observed: DateTime! number_observed: Int! name: String! - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2737,7 +2738,7 @@ type Opinion implements BasicObject & StixObject & StixCoreObject & StixDomainOb explanation: String authors: [String] opinion: String! - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2858,7 +2859,7 @@ type Report implements BasicObject & StixObject & StixCoreObject & StixDomainObj description: String report_types: [String] published: DateTime - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2976,7 +2977,7 @@ type CourseOfAction implements BasicObject & StixObject & StixCoreObject & StixD x_opencti_threat_hunting: String x_opencti_log_sources: [String] attackPatterns: AttackPatternConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3098,7 +3099,7 @@ interface Identity { roles: [String] contact_information: String x_opencti_aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3219,7 +3220,7 @@ type Individual implements BasicObject & StixObject & StixCoreObject & StixDomai x_opencti_firstname: String x_opencti_lastname: String organizations: OrganizationConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3365,7 +3366,7 @@ type Organization implements BasicObject & StixObject & StixCoreObject & StixDom x_opencti_organization_type: String x_opencti_reliability: OrganizationReliability sectors: SectorConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3488,7 +3489,7 @@ type Sector implements BasicObject & StixObject & StixCoreObject & StixDomainObj subSectors: SectorConnection isSubSector: Boolean targetedOrganizations: StixCoreRelationshipConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3604,7 +3605,7 @@ type System implements BasicObject & StixObject & StixCoreObject & StixDomainObj x_opencti_firstname: String x_opencti_lastname: String organizations: OrganizationConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3750,7 +3751,7 @@ type Indicator implements BasicObject & StixObject & StixCoreObject & StixDomain x_mitre_platforms: [String!] killChainPhases: KillChainPhaseConnection observables(first: Int): StixCyberObservableConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3881,7 +3882,7 @@ type Infrastructure implements BasicObject & StixObject & StixCoreObject & StixD first_seen: DateTime last_seen: DateTime killChainPhases: KillChainPhaseConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3941,6 +3942,7 @@ enum IntrusionSetsFilter { x_opencti_workflow_id revoked confidence + creator } input IntrusionSetsFiltering { @@ -4002,7 +4004,7 @@ type IntrusionSet implements BasicObject & StixObject & StixCoreObject & StixDom primary_motivation: String secondary_motivations: [String] locations: LocationConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4124,7 +4126,7 @@ interface Location { longitude: Float precision: Float x_opencti_aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4243,7 +4245,7 @@ type Position implements BasicObject & StixObject & StixCoreObject & StixDomainO street_address: String postal_code: String city: City - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4364,7 +4366,7 @@ type City implements BasicObject & StixObject & StixCoreObject & StixDomainObjec x_opencti_aliases: [String] country: Country administrativeArea: AdministrativeArea - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4479,7 +4481,7 @@ type Country implements BasicObject & StixObject & StixCoreObject & StixDomainOb precision: Float x_opencti_aliases: [String] region: Region - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4595,7 +4597,7 @@ type Region implements BasicObject & StixObject & StixCoreObject & StixDomainObj subRegions: RegionConnection isSubRegion: Boolean countries: CountryConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4723,7 +4725,7 @@ type Malware implements BasicObject & StixObject & StixCoreObject & StixDomainOb implementation_languages: [String] capabilities: [String] killChainPhases: KillChainPhaseConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4788,6 +4790,7 @@ enum ThreatActorsFilter { x_opencti_workflow_id revoked confidence + creator } input ThreatActorsFiltering { @@ -4854,7 +4857,7 @@ type ThreatActor implements BasicObject & StixObject & StixCoreObject & StixDoma personal_motivations: [String] locations: LocationConnection countries: CountryConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4976,7 +4979,7 @@ type Tool implements BasicObject & StixObject & StixCoreObject & StixDomainObjec tool_types: [String] tool_version: String killChainPhases: KillChainPhaseConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5101,7 +5104,7 @@ type Vulnerability implements BasicObject & StixObject & StixCoreObject & StixDo x_opencti_availability_impact: String x_opencti_confidentiality_impact: String softwares: StixCyberObservableConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5169,6 +5172,7 @@ enum IncidentsFilter { labelledBy x_opencti_workflow_id confidence + creator } input IncidentsFiltering { @@ -5229,7 +5233,7 @@ type Incident implements BasicObject & StixObject & StixCoreObject & StixDomainO incident_type: String severity: String source: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5350,7 +5354,7 @@ interface StixCyberObservable { observable_value: String! indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5393,7 +5397,7 @@ type AutonomousSystem implements BasicObject & StixObject & StixCoreObject & Sti number: Int name: String rir: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5444,7 +5448,7 @@ type Directory implements BasicObject & StixObject & StixCoreObject & StixCyberO ctime: DateTime mtime: DateTime atime: DateTime - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5493,7 +5497,7 @@ type DomainName implements BasicObject & StixObject & StixCoreObject & StixCyber indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5539,7 +5543,7 @@ type EmailAddr implements BasicObject & StixObject & StixCoreObject & StixCyberO stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String display_name: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5591,7 +5595,7 @@ type EmailMessage implements BasicObject & StixObject & StixCoreObject & StixCyb subject: String received_lines: [String] body: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5644,7 +5648,7 @@ type EmailMimePartType implements BasicObject & StixObject & StixCoreObject & St body: String content_type: String content_disposition: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5714,7 +5718,7 @@ interface HashedObservable { indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection hashes: [Hash] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5761,7 +5765,7 @@ type Artifact implements BasicObject & StixObject & StixCoreObject & StixCyberOb encryption_algorithm: String decryption_key: String x_opencti_additional_names: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5823,7 +5827,7 @@ type StixFile implements BasicObject & StixObject & StixCoreObject & StixCyberOb atime: DateTime x_opencti_additional_names: [String] obsContent: Artifact - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5905,7 +5909,7 @@ type X509Certificate implements BasicObject & StixObject & StixCoreObject & Stix private_key_usage_period_not_after: DateTime certificate_policies: String policy_mappings: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5978,7 +5982,7 @@ type IPv4Addr implements BasicObject & StixObject & StixCoreObject & StixCyberOb stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String countries: CountryConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6026,7 +6030,7 @@ type IPv6Addr implements BasicObject & StixObject & StixCoreObject & StixCyberOb stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String countries: CountryConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6071,7 +6075,7 @@ type MacAddr implements BasicObject & StixObject & StixCoreObject & StixCyberObs indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6116,7 +6120,7 @@ type Mutex implements BasicObject & StixObject & StixCoreObject & StixCyberObser indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection name: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6171,7 +6175,7 @@ type NetworkTraffic implements BasicObject & StixObject & StixCoreObject & StixC dst_byte_count: Int src_packets: Int dst_packets: Int - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6246,7 +6250,7 @@ type Process implements BasicObject & StixObject & StixCoreObject & StixCyberObs serviceDlls: StixFileConnection service_type: String service_status: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6318,7 +6322,7 @@ type Software implements BasicObject & StixObject & StixCoreObject & StixCyberOb vendor: String version: String vulnerabilities: VulnerabilityConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6368,7 +6372,7 @@ type Url implements BasicObject & StixObject & StixCoreObject & StixCyberObserva indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6427,7 +6431,7 @@ type UserAccount implements BasicObject & StixObject & StixCoreObject & StixCybe credential_last_changed: DateTime account_first_login: DateTime account_last_login: DateTime - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6487,7 +6491,7 @@ type WindowsRegistryKey implements BasicObject & StixObject & StixCoreObject & S attribute_key: String modified_time: DateTime number_of_subkeys: Int - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6536,7 +6540,7 @@ type WindowsRegistryValueType implements BasicObject & StixObject & StixCoreObje name: String data: String data_type: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6583,7 +6587,7 @@ type CryptographicKey implements BasicObject & StixObject & StixCoreObject & Sti indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6628,7 +6632,7 @@ type CryptocurrencyWallet implements BasicObject & StixObject & StixCoreObject & indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6673,7 +6677,7 @@ type Hostname implements BasicObject & StixObject & StixCoreObject & StixCyberOb indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6718,7 +6722,7 @@ type Text implements BasicObject & StixObject & StixCoreObject & StixCyberObserv indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6763,7 +6767,7 @@ type UserAgent implements BasicObject & StixObject & StixCoreObject & StixCyberO indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6810,7 +6814,7 @@ type BankAccount implements BasicObject & StixObject & StixCoreObject & StixCybe iban: String bic: String account_number: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6857,7 +6861,7 @@ type PhoneNumber implements BasicObject & StixObject & StixCoreObject & StixCybe indicators(first: Int): IndicatorConnection stixCyberObservableRelationships(first: Int, after: ID, orderBy: StixCyberObservableRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCyberObservableRelationshipsFiltering], filterMode: FilterMode): StixCyberObservableRelationshipConnection value: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6905,7 +6909,7 @@ type PaymentCard implements BasicObject & StixObject & StixCoreObject & StixCybe expiration_date: DateTime cvv: Int holder_name: String - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6958,7 +6962,7 @@ type MediaContent implements BasicObject & StixObject & StixCoreObject & StixCyb media_category: String url: String publication_date: DateTime - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6985,7 +6989,7 @@ interface BasicRelationship { toRole: String created_at: DateTime! updated_at: DateTime! - creator: Creator + creators: [Creator!] } type InternalRelationship implements BasicRelationship { @@ -6999,7 +7003,7 @@ type InternalRelationship implements BasicRelationship { updated_at: DateTime! from: InternalObject to: InternalObject - creator: Creator + creators: [Creator!] } input InternalRelationshipAddInput { @@ -7143,7 +7147,7 @@ interface StixRelationship { from: StixObjectOrStixRelationship! to: StixObjectOrStixRelationship! x_opencti_inferences: [Inference] - creator: Creator + creators: [Creator!] } enum StixCoreRelationshipsOrdering { @@ -7249,7 +7253,7 @@ type StixCoreRelationship implements BasicRelationship & StixRelationship { cases(first: Int): CaseConnection stixCoreRelationships(first: Int, after: ID, orderBy: StixCoreRelationshipsOrdering, orderMode: OrderingMode, fromId: StixRef, toId: StixRef, fromTypes: [String], toTypes: [String], relationship_type: String, startTimeStart: DateTime, startTimeStop: DateTime, stopTimeStart: DateTime, stopTimeStop: DateTime, firstSeenStart: DateTime, firstSeenStop: DateTime, lastSeenStart: DateTime, lastSeenStop: DateTime, confidences: [Int], search: String, filters: [StixCoreRelationshipsFiltering], filterMode: FilterMode): StixCoreRelationshipConnection killChainPhases: KillChainPhaseConnection - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] status: Status @@ -7368,7 +7372,7 @@ type StixSightingRelationship implements BasicRelationship & StixRelationship { opinions(first: Int): OpinionConnection groupings(first: Int): GroupingConnection cases(first: Int): CaseConnection - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] status: Status @@ -7460,7 +7464,7 @@ type StixCyberObservableRelationship implements BasicRelationship & StixRelation stop_time: DateTime confidence: Int objectMarking: MarkingDefinitionConnection - creator: Creator + creators: [Creator!] editContext: [EditUserContext!] } @@ -7523,7 +7527,7 @@ type StixMetaRelationship implements BasicRelationship & StixRelationship { from: StixObjectOrStixRelationship! to: StixObjectOrStixRelationship! x_opencti_inferences: [Inference] - creator: Creator + creators: [Creator!] } input StixMetaRelationshipAddInput { @@ -8475,7 +8479,7 @@ type Channel implements BasicObject & StixObject & StixCoreObject & StixDomainOb description: String channel_types: [String] aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8588,7 +8592,7 @@ type Language implements BasicObject & StixCoreObject & StixDomainObject & StixO objectAssignee: AssigneeConnection name: String! aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8699,7 +8703,7 @@ type Event implements BasicObject & StixCoreObject & StixDomainObject & StixObje start_time: DateTime stop_time: DateTime aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8817,7 +8821,7 @@ type Grouping implements BasicObject & StixObject & StixCoreObject & StixDomainO description: String context: String! x_opencti_aliases: [String] - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8938,7 +8942,7 @@ type Narrative implements BasicObject & StixCoreObject & StixDomainObject & Stix parentNarratives: NarrativeConnection subNarratives: NarrativeConnection isSubNarrative: Boolean - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9192,7 +9196,7 @@ type DataComponent implements BasicObject & StixObject & StixCoreObject & StixDo modified: DateTime x_opencti_graph_data: String objectAssignee: AssigneeConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9304,7 +9308,7 @@ type DataSource implements BasicObject & StixObject & StixCoreObject & StixDomai modified: DateTime x_opencti_graph_data: String objectAssignee: AssigneeConnection - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9440,7 +9444,7 @@ type Vocabulary implements BasicObject & StixObject & StixMetaObject { standard_id: String! entity_type: String! parent_types: [String]! - creator: Creator + creators: [Creator!] x_opencti_stix_ids: [StixId] is_inferred: Boolean! spec_version: String! @@ -9539,7 +9543,7 @@ type AdministrativeArea implements BasicObject & StixCoreObject & StixDomainObje x_opencti_aliases: [String] cases(first: Int): CaseConnection country: Country - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9654,7 +9658,7 @@ type Case implements BasicObject & StixObject & StixCoreObject & StixDomainObjec priority: String description: String rating: Int - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-front/src/utils/Localization.js b/opencti-platform/opencti-front/src/utils/Localization.js index 402e6dd314dc..6fc398af83ab 100644 --- a/opencti-platform/opencti-front/src/utils/Localization.js +++ b/opencti-platform/opencti-front/src/utils/Localization.js @@ -1011,6 +1011,7 @@ const i18n = { 'Updated the': 'Actualizado el', 'Update entities': 'Actualizar entidades', Creator: 'Creador', + Creators: 'Creadors', Validate: 'Validar', Marking: 'Clasificación', Markings: 'Marcas', @@ -1694,6 +1695,7 @@ const i18n = { filter_start_time_start_date: 'Fecha de inicio después', filter_stop_time_end_date: 'Fecha de finalización antes', filter_stop_time_start_date: 'Fecha de finalización después de', + filter_source: 'Fuente', EXTERNAL_IMPORT: 'Importación de datos', INTERNAL_IMPORT_FILE: 'Importación de ficheros', INTERNAL_EXPORT_FILE: 'Exportación de ficheros', @@ -2772,6 +2774,7 @@ const i18n = { 'Updated the': 'Mis à jour le', 'Update entities': 'Modifier des entités', Creator: 'Créateur', + Creators: 'Créateurs', Validate: 'Valider', Marking: 'Marquage', Markings: 'Marquages', @@ -3453,6 +3456,7 @@ const i18n = { filter_start_time_start_date: 'Date de début après', filter_stop_time_end_date: 'Date de fin avant', filter_stop_time_start_date: 'Date de fin après', + filter_source: 'Source', EXTERNAL_IMPORT: 'Import de données', INTERNAL_IMPORT_FILE: 'Import de fichiers', INTERNAL_EXPORT_FILE: 'Export de fichiers', @@ -4489,6 +4493,7 @@ const i18n = { 'Updated the': '更新日: ', 'Update entities': 'エンティティの更新', Creator: '作成者', + Creators: 'クリエーター', Validate: '有効期限', Marking: 'マーキング', Markings: 'マーキング', @@ -5164,6 +5169,7 @@ const i18n = { filter_start_time_start_date: '開始日以降', filter_stop_time_end_date: '終了日より前', filter_stop_time_start_date: '終了日以降', + filter_source: 'ソース', EXTERNAL_IMPORT: 'データインポート', INTERNAL_IMPORT_FILE: 'ファイルインポート', INTERNAL_EXPORT_FILE: 'ファイルエクスポート', @@ -6122,6 +6128,7 @@ const i18n = { 'Updated the': '已更新', 'Update entities': '更新实体', Creator: '创建者', + Creators: '創作者', Validate: '验证', Marking: '标记', Markings: '标记', @@ -6771,6 +6778,7 @@ const i18n = { filter_start_time_start_date: '之後的開始日期', filter_stop_time_end_date: '之前的結束日期', filter_stop_time_start_date: '之後的結束日期', + filter_source: '来源', EXTERNAL_IMPORT: '外部导入', INTERNAL_IMPORT_FILE: '导入文件', INTERNAL_EXPORT_FILE: '导出文件', diff --git a/opencti-platform/opencti-front/src/utils/filters/filtersUtils.tsx b/opencti-platform/opencti-front/src/utils/filters/filtersUtils.tsx index c05c5c8ff6b2..724213f207ee 100644 --- a/opencti-platform/opencti-front/src/utils/filters/filtersUtils.tsx +++ b/opencti-platform/opencti-front/src/utils/filters/filtersUtils.tsx @@ -45,6 +45,7 @@ export const EqFilters = [ 'relationship_type', 'creator', 'x_opencti_negative', + 'source', ]; const uniqFilters = [ 'revoked', diff --git a/opencti-platform/opencti-front/src/utils/filters/useSearchEntities.js b/opencti-platform/opencti-front/src/utils/filters/useSearchEntities.js index 40f5dda68964..05d194d16091 100644 --- a/opencti-platform/opencti-front/src/utils/filters/useSearchEntities.js +++ b/opencti-platform/opencti-front/src/utils/filters/useSearchEntities.js @@ -809,6 +809,24 @@ const useSearchEntities = ({ ); }); break; + case 'source': + fetchQuery(attributesSearchQuery, { + attributeName: 'source', + search: event.target.value !== 0 ? event.target.value : '', + first: 10, + }) + .toPromise() + .then((data) => { + const sourceEntities = (data?.runtimeAttributes?.edges ?? []).map( + (n) => ({ + label: n.node.value, + value: n.node.value, + type: 'Vocabulary', + }), + ); + unionSetEntities('source', sourceEntities); + }); + break; case 'indicator_types': fetchQuery(vocabularySearchQuery, { category: 'indicator_type_ov', diff --git a/opencti-platform/opencti-graphql/config/schema/opencti.graphql b/opencti-platform/opencti-graphql/config/schema/opencti.graphql index d460c457323b..78d62eb4e7ad 100644 --- a/opencti-platform/opencti-graphql/config/schema/opencti.graphql +++ b/opencti-platform/opencti-graphql/config/schema/opencti.graphql @@ -1410,7 +1410,7 @@ interface StixObject { created_at: DateTime! updated_at: DateTime! # Technical - creator: Creator + creators: [Creator!] # inferences x_opencti_inferences: [Inference] } @@ -1485,7 +1485,7 @@ type MarkingDefinition implements BasicObject & StixObject & StixMetaObject { x_opencti_order: Int! x_opencti_color: String # Technical - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] } @@ -1549,7 +1549,7 @@ type Label implements BasicObject & StixObject & StixMetaObject { value: String color: String # Technical - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] } @@ -1623,7 +1623,7 @@ type ExternalReference implements BasicObject & StixObject & StixMetaObject { references(types: [String]): StixObjectOrStixRelationshipConnection fileId: String # Technical - creator: Creator + creators: [Creator!] importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection exportFiles(first: Int): FileConnection @@ -1695,7 +1695,7 @@ type KillChainPhase implements BasicObject & StixObject & StixMetaObject { phase_name: String! x_opencti_order: Int # Technical - creator: Creator + creators: [Creator!] editContext: [EditUserContext!] } input KillChainPhaseAddInput { @@ -1871,7 +1871,7 @@ interface StixCoreObject { filterMode: FilterMode ): [Distribution] @auth(for: [KNOWLEDGE, EXPLORE]) # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2063,7 +2063,7 @@ interface StixDomainObject { x_opencti_graph_data: String objectAssignee: AssigneeConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2246,7 +2246,7 @@ type AttackPattern implements BasicObject & StixObject & StixCoreObject & StixDo isSubAttackPattern: Boolean dataComponents: DataComponentConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2309,6 +2309,7 @@ enum CampaignsFilter { x_opencti_workflow_id revoked confidence + creator } input CampaignsFiltering { key: [CampaignsFilter!]! @@ -2425,7 +2426,7 @@ type Campaign implements BasicObject & StixObject & StixCoreObject & StixDomainO last_seen: DateTime objective: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -2621,7 +2622,7 @@ interface Container { viaTypes: [String] ): ContainerConnection # Technical - creator: Creator + creators: [Creator!] workflowEnabled: Boolean status: Status } @@ -2795,7 +2796,7 @@ type Note implements BasicObject & StixObject & StixCoreObject & StixDomainObjec note_types: [String] likelihood: Int # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3016,7 +3017,7 @@ type ObservedData implements BasicObject & StixObject & StixCoreObject & StixDom number_observed: Int! name: String! # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3212,7 +3213,7 @@ type Opinion implements BasicObject & StixObject & StixCoreObject & StixDomainOb authors: [String] opinion: String! # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3412,7 +3413,7 @@ type Report implements BasicObject & StixObject & StixCoreObject & StixDomainObj report_types: [String] published: DateTime # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3588,7 +3589,7 @@ type CourseOfAction implements BasicObject & StixObject & StixCoreObject & StixD x_opencti_log_sources: [String] attackPatterns: AttackPatternConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3766,7 +3767,7 @@ interface Identity { contact_information: String x_opencti_aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -3946,7 +3947,7 @@ type Individual implements BasicObject & StixObject & StixCoreObject & StixDomai x_opencti_lastname: String organizations: OrganizationConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4151,7 +4152,7 @@ type Organization implements BasicObject & StixObject & StixCoreObject & StixDom x_opencti_reliability: OrganizationReliability sectors: SectorConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4333,7 +4334,7 @@ type Sector implements BasicObject & StixObject & StixCoreObject & StixDomainObj isSubSector: Boolean targetedOrganizations: StixCoreRelationshipConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4508,7 +4509,7 @@ type System implements BasicObject & StixObject & StixCoreObject & StixDomainObj x_opencti_lastname: String organizations: OrganizationConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4712,7 +4713,7 @@ type Indicator implements BasicObject & StixObject & StixCoreObject & StixDomain killChainPhases: KillChainPhaseConnection observables(first: Int): StixCyberObservableConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4901,7 +4902,7 @@ type Infrastructure implements BasicObject & StixObject & StixCoreObject & StixD last_seen: DateTime killChainPhases: KillChainPhaseConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -4960,6 +4961,7 @@ enum IntrusionSetsFilter { x_opencti_workflow_id revoked confidence + creator } input IntrusionSetsFiltering { key: [IntrusionSetsFilter!]! @@ -5080,7 +5082,7 @@ type IntrusionSet implements BasicObject & StixObject & StixCoreObject & StixDom secondary_motivations: [String] locations: LocationConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5259,7 +5261,7 @@ interface Location { precision: Float x_opencti_aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5437,7 +5439,7 @@ type Position implements BasicObject & StixObject & StixCoreObject & StixDomainO postal_code: String city: City # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5617,7 +5619,7 @@ type City implements BasicObject & StixObject & StixCoreObject & StixDomainObjec country: Country administrativeArea: AdministrativeArea # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5791,7 +5793,7 @@ type Country implements BasicObject & StixObject & StixCoreObject & StixDomainOb # Country region: Region # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -5966,7 +5968,7 @@ type Region implements BasicObject & StixObject & StixCoreObject & StixDomainObj isSubRegion: Boolean countries: CountryConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6152,7 +6154,7 @@ type Malware implements BasicObject & StixObject & StixCoreObject & StixDomainOb capabilities: [String] killChainPhases: KillChainPhaseConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6216,6 +6218,7 @@ enum ThreatActorsFilter { x_opencti_workflow_id revoked confidence + creator } input ThreatActorsFiltering { key: [ThreatActorsFilter!]! @@ -6341,7 +6344,7 @@ type ThreatActor implements BasicObject & StixObject & StixCoreObject & StixDoma locations: LocationConnection countries: CountryConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6521,7 +6524,7 @@ type Tool implements BasicObject & StixObject & StixCoreObject & StixDomainObjec tool_version: String killChainPhases: KillChainPhaseConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6704,7 +6707,7 @@ type Vulnerability implements BasicObject & StixObject & StixCoreObject & StixDo x_opencti_confidentiality_impact: String softwares: StixCyberObservableConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -6771,6 +6774,7 @@ enum IncidentsFilter { labelledBy x_opencti_workflow_id confidence + creator } input IncidentsFiltering { key: [IncidentsFilter!]! @@ -6890,7 +6894,7 @@ type Incident implements BasicObject & StixObject & StixCoreObject & StixDomainO severity: String source: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7090,7 +7094,7 @@ interface StixCyberObservable { filterMode: FilterMode ): StixCyberObservableRelationshipConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7217,7 +7221,7 @@ type AutonomousSystem implements BasicObject & StixObject & StixCoreObject & Sti name: String rir: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7351,7 +7355,7 @@ type Directory implements BasicObject & StixObject & StixCoreObject & StixCyberO mtime: DateTime atime: DateTime # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7483,7 +7487,7 @@ type DomainName implements BasicObject & StixObject & StixCoreObject & StixCyber # DomainName value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7612,7 +7616,7 @@ type EmailAddr implements BasicObject & StixObject & StixCoreObject & StixCyberO value: String display_name: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7747,7 +7751,7 @@ type EmailMessage implements BasicObject & StixObject & StixCoreObject & StixCyb received_lines: [String] body: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -7883,7 +7887,7 @@ type EmailMimePartType implements BasicObject & StixObject & StixCoreObject & St content_type: String content_disposition: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8029,7 +8033,7 @@ interface HashedObservable { # HashedObservable hashes: [Hash] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8161,7 +8165,7 @@ type Artifact implements BasicObject & StixObject & StixCoreObject & StixCyberOb decryption_key: String x_opencti_additional_names: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8307,7 +8311,7 @@ type StixFile implements BasicObject & StixObject & StixCoreObject & StixCyberOb x_opencti_additional_names: [String] obsContent: Artifact # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8474,7 +8478,7 @@ type X509Certificate implements BasicObject & StixObject & StixCoreObject & Stix certificate_policies: String policy_mappings: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8631,7 +8635,7 @@ type IPv4Addr implements BasicObject & StixObject & StixCoreObject & StixCyberOb value: String countries: CountryConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8762,7 +8766,7 @@ type IPv6Addr implements BasicObject & StixObject & StixCoreObject & StixCyberOb value: String countries: CountryConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -8890,7 +8894,7 @@ type MacAddr implements BasicObject & StixObject & StixCoreObject & StixCyberObs # MacAddr value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9018,7 +9022,7 @@ type Mutex implements BasicObject & StixObject & StixCoreObject & StixCyberObser # Mutex name: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9156,7 +9160,7 @@ type NetworkTraffic implements BasicObject & StixObject & StixCoreObject & StixC src_packets: Int dst_packets: Int # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9316,7 +9320,7 @@ type Process implements BasicObject & StixObject & StixCoreObject & StixCyberObs service_type: String service_status: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9473,7 +9477,7 @@ type Software implements BasicObject & StixObject & StixCoreObject & StixCyberOb version: String vulnerabilities: VulnerabilityConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9606,7 +9610,7 @@ type Url implements BasicObject & StixObject & StixCoreObject & StixCyberObserva # Url value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9748,7 +9752,7 @@ type UserAccount implements BasicObject & StixObject & StixCoreObject & StixCybe account_first_login: DateTime account_last_login: DateTime # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -9891,7 +9895,7 @@ type WindowsRegistryKey implements BasicObject & StixObject & StixCoreObject & S modified_time: DateTime number_of_subkeys: Int # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10023,7 +10027,7 @@ type WindowsRegistryValueType implements BasicObject & StixObject & StixCoreObje data: String data_type: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10153,7 +10157,7 @@ type CryptographicKey implements BasicObject & StixObject & StixCoreObject & Sti # CryptographicKey value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10281,7 +10285,7 @@ type CryptocurrencyWallet implements BasicObject & StixObject & StixCoreObject & # CryptocurrencyWallet value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10409,7 +10413,7 @@ type Hostname implements BasicObject & StixObject & StixCoreObject & StixCyberOb # Hostname value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10537,7 +10541,7 @@ type Text implements BasicObject & StixObject & StixCoreObject & StixCyberObserv # Text value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10665,7 +10669,7 @@ type UserAgent implements BasicObject & StixObject & StixCoreObject & StixCyberO # UserAgent value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10796,7 +10800,7 @@ type BankAccount implements BasicObject & StixObject & StixCoreObject & StixCybe bic: String account_number: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -10926,7 +10930,7 @@ type PhoneNumber implements BasicObject & StixObject & StixCoreObject & StixCybe # PhoneNumber value: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -11057,7 +11061,7 @@ type PaymentCard implements BasicObject & StixObject & StixCoreObject & StixCybe cvv: Int holder_name: String # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -11193,7 +11197,7 @@ type MediaContent implements BasicObject & StixObject & StixCoreObject & StixCyb url: String publication_date: DateTime # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection @@ -11221,7 +11225,7 @@ interface BasicRelationship { created_at: DateTime! updated_at: DateTime! # Technical - creator: Creator + creators: [Creator!] } ######## INTERNAL RELATIONSHIPS @@ -11240,7 +11244,7 @@ type InternalRelationship implements BasicRelationship { from: InternalObject to: InternalObject # Technical - creator: Creator + creators: [Creator!] } input InternalRelationshipAddInput { relationship_type: String! # Will be check by code @@ -11508,7 +11512,7 @@ interface StixRelationship { to: StixObjectOrStixRelationship! x_opencti_inferences: [Inference] # Technical - creator: Creator + creators: [Creator!] } ############## StixCoreRelationships @@ -11636,7 +11640,7 @@ type StixCoreRelationship implements BasicRelationship & StixRelationship { ): StixCoreRelationshipConnection killChainPhases: KillChainPhaseConnection # Technical - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] status: Status @@ -11754,7 +11758,7 @@ type StixSightingRelationship implements BasicRelationship & StixRelationship { groupings(first: Int): GroupingConnection cases(first: Int): CaseConnection # Technical - creator: Creator + creators: [Creator!] toStix: String editContext: [EditUserContext!] status: Status @@ -11845,7 +11849,7 @@ type StixCyberObservableRelationship implements BasicRelationship & StixRelation confidence: Int objectMarking: MarkingDefinitionConnection # Technical - creator: Creator + creators: [Creator!] editContext: [EditUserContext!] } input StixCyberObservableRelationshipAddInput { @@ -11906,7 +11910,7 @@ type StixMetaRelationship implements BasicRelationship & StixRelationship { to: StixObjectOrStixRelationship! x_opencti_inferences: [Inference] # Technical - creator: Creator + creators: [Creator!] } input StixMetaRelationshipAddInput { relationship_type: String! diff --git a/opencti-platform/opencti-graphql/src/database/middleware.js b/opencti-platform/opencti-graphql/src/database/middleware.js index 5b3d8be49479..799eed7ef910 100644 --- a/opencti-platform/opencti-graphql/src/database/middleware.js +++ b/opencti-platform/opencti-graphql/src/database/middleware.js @@ -843,7 +843,7 @@ const rebuildAndMergeInputFromExistingData = (rawInput, instance) => { finalVal = [R.assoc(targetKey, valueToTake, currentJson)]; } } else if (isMultiple) { - const currentValues = instance[key] || []; + const currentValues = (Array.isArray(instance[key]) ? instance[key] : [instance[key]]) ?? []; if (operation === UPDATE_OPERATION_ADD) { finalVal = R.pipe(R.append(value), R.flatten, R.uniq)(currentValues); } else if (operation === UPDATE_OPERATION_REMOVE) { @@ -1317,6 +1317,11 @@ const checkAttributeConsistency = (entityType, key) => { if (key.startsWith(RULE_PREFIX)) { return; } + // Always ok for creator_id, need a stronger schena definition + // Waiting for merge of https://github.com/OpenCTI-Platform/opencti/issues/1850 + if (key === 'creator_id') { + return; + } let masterKey = key; if (key.includes('.')) { const [firstPart] = key.split('.'); @@ -2313,6 +2318,19 @@ const upsertElementRaw = async (context, user, element, type, updatePatch) => { patchInputs.push(...patched.updatedInputs); } } + const creatorIds = []; + // Add support for existing creator_id that can be a simple string except of an array + if (isNotEmptyField(element.creator_id)) { + const idCreators = Array.isArray(element.creator_id) ? element.creator_id : [element.creator_id]; + creatorIds.push(...idCreators); + } + if (!creatorIds.includes(user.id)) { + const patch = { creator_id: [...creatorIds, user.id] }; + const operations = { creator_id: UPDATE_OPERATION_ADD }; + const patched = await patchAttributeRaw(context, user, element, patch, { operations, upsert: true }); + impactedInputs.push(...patched.impactedInputs); + patchInputs.push(...patched.updatedInputs); + } // Upsert observed data if (type === ENTITY_TYPE_CONTAINER_OBSERVED_DATA) { const timePatch = handleRelationTimeUpdate(updatePatch, element, 'first_observed', 'last_observed'); @@ -2513,7 +2531,7 @@ const buildRelationData = async (context, user, input, opts = {}) => { data.standard_id = standardId; data.entity_type = relationshipType; data.relationship_type = relationshipType; - data.creator_id = user.internal_id; + data.creator_id = [user.internal_id]; data.created_at = today; data.updated_at = today; // stix-relationship @@ -2849,7 +2867,7 @@ const buildEntityData = async (context, user, input, type, opts = {}) => { R.assoc(ID_INTERNAL, internalId), R.assoc(ID_STANDARD, standardId), R.assoc('entity_type', type), - R.assoc('creator_id', user.internal_id), + R.assoc('creator_id', [user.internal_id]), R.dissoc('update'), R.dissoc('file'), R.omit(schemaRelationsRefDefinition.getInputNames()), diff --git a/opencti-platform/opencti-graphql/src/database/stix-converter.ts b/opencti-platform/opencti-graphql/src/database/stix-converter.ts index 26d4dc0efe0b..96360d99f926 100644 --- a/opencti-platform/opencti-graphql/src/database/stix-converter.ts +++ b/opencti-platform/opencti-graphql/src/database/stix-converter.ts @@ -204,8 +204,14 @@ export const convertObjectReferences = (instance: StoreEntity, isInferred = fals // Extensions export const buildOCTIExtensions = (instance: StoreObject): S.StixOpenctiExtension => { + const builtCreatorIds: string[] = []; + if (instance.creator_id) { + const arrayCreators = Array.isArray(instance.creator_id) ? instance.creator_id : [instance.creator_id]; + builtCreatorIds.push(...arrayCreators); + } const octiExtensions: S.StixOpenctiExtension = { extension_type: 'property-extension', + // Attributes id: instance.internal_id, type: instance.entity_type, created_at: instance.created_at, @@ -219,10 +225,13 @@ export const buildOCTIExtensions = (instance: StoreObject): S.StixOpenctiExtensi })), stix_ids: (instance.x_opencti_stix_ids ?? []).filter((stixId: string) => isTrustedStixId(stixId)), is_inferred: instance._index ? isInferredIndex(instance._index) : undefined, // TODO Use case for empty _index? - workflow_id: instance.x_opencti_workflow_id, + // Refs granted_refs: (instance[INPUT_GRANTED_REFS] ?? []).map((m) => m.standard_id), - object_assignee_refs: (instance[INPUT_ASSIGNEE] ?? []).map((m) => m.internal_id), linked_to_refs: (instance[INPUT_LINKED] ?? []).map((m) => m.standard_id), + // Internals + creator_ids: builtCreatorIds, + assignee_ids: (instance[INPUT_ASSIGNEE] ?? []).map((m) => m.internal_id), + workflow_id: instance.x_opencti_workflow_id, }; return cleanObject(octiExtensions); }; diff --git a/opencti-platform/opencti-graphql/src/database/utils.js b/opencti-platform/opencti-graphql/src/database/utils.js index e2d7661aa3ff..163b8fcfec78 100644 --- a/opencti-platform/opencti-graphql/src/database/utils.js +++ b/opencti-platform/opencti-graphql/src/database/utils.js @@ -17,8 +17,14 @@ import conf from '../config/conf'; import { FROM_START_STR, now, observableValue, UNTIL_END_STR } from '../utils/format'; import { isStixRelationship } from '../schema/stixRelationship'; import { truncate } from '../utils/mailData'; -import { isDateAttribute, isDictionaryAttribute, isJsonAttribute } from '../schema/schema-attributes'; +import { + isDateAttribute, + isDictionaryAttribute, + isJsonAttribute, + schemaAttributesDefinition +} from '../schema/schema-attributes'; import { schemaRelationsRefDefinition } from '../schema/schema-relationsRef'; +import { creators } from '../schema/attribute-definition'; export const ES_INDEX_PREFIX = conf.get('elasticsearch:index_prefix') || 'opencti'; const rabbitmqPrefix = conf.get('rabbitmq:queue_prefix'); @@ -326,9 +332,13 @@ export const generateUpdateMessage = (inputs) => { const generatedMessage = patchElements.slice(0, 3).map(([type, operations]) => { return `${type}s ${operations.slice(0, 3).map(({ key, value }) => { let message = 'nothing'; - let convertedKey = key; - if (schemaRelationsRefDefinition.convertInputNameToStixName(key)) { - convertedKey = schemaRelationsRefDefinition.convertInputNameToStixName(key); + let convertedKey; + const relationsRefDefinition = schemaRelationsRefDefinition.getRelationsRefByInputName(key); + if (relationsRefDefinition) { + convertedKey = relationsRefDefinition.label ?? relationsRefDefinition.stixName; + } else { + const attributeDefinition = schemaAttributesDefinition.getAttribute(key); + convertedKey = attributeDefinition.label ?? attributeDefinition.name; } const fromArray = Array.isArray(value) ? value : [value]; const values = fromArray.slice(0, 3).filter((v) => isNotEmptyField(v)); @@ -336,6 +346,8 @@ export const generateUpdateMessage = (inputs) => { // If update is based on internal ref, we need to extract the value if (schemaRelationsRefDefinition.convertInputNameToStixName(key)) { message = values.map((val) => truncate(extractEntityRepresentative(val))).join(', '); + } else if (key === creators.name) { + message = 'itself'; // Creator special case } else if (isDictionaryAttribute(key)) { message = Object.entries(R.head(values)).map(([k, v]) => truncate(`${k}:${v}`)).join(', '); } else if (isJsonAttribute(key)) { diff --git a/opencti-platform/opencti-graphql/src/domain/user.js b/opencti-platform/opencti-graphql/src/domain/user.js index ebbae1732042..82c48d3e4997 100644 --- a/opencti-platform/opencti-graphql/src/domain/user.js +++ b/opencti-platform/opencti-graphql/src/domain/user.js @@ -138,13 +138,21 @@ export const batchGroups = async (context, user, userId, opts = {}) => { return batchListThroughGetTo(context, user, userId, RELATION_MEMBER_OF, ENTITY_TYPE_GROUP, opts); }; -export const batchCreators = async (context, user, userIds) => { - const internalUserIds = Object.keys(INTERNAL_USERS); +const internalUserIds = Object.keys(INTERNAL_USERS); +export const batchCreator = async (context, user, userIds) => { const userToFinds = R.uniq(userIds.filter((u) => isNotEmptyField(u)).filter((u) => !internalUserIds.includes(u))); const users = await elFindByIds(context, user, userToFinds, { toMap: true }); return userIds.map((id) => INTERNAL_USERS[id] || users[id] || SYSTEM_USER); }; +export const batchCreators = async (context, user, userListIds) => { + const userIds = userListIds.map((u) => (Array.isArray(u) ? u : [u])); + const allUserIds = userIds.flat(); + const userToFinds = R.uniq(allUserIds.filter((u) => isNotEmptyField(u)).filter((u) => !internalUserIds.includes(u))); + const users = await elFindByIds(context, user, userToFinds, { toMap: true }); + return userIds.map((ids) => ids.map((id) => INTERNAL_USERS[id] || users[id] || SYSTEM_USER)); +}; + export const batchOrganizations = async (context, user, userId, opts = {}) => { return batchListThroughGetTo(context, user, userId, RELATION_PARTICIPATE_TO, ENTITY_TYPE_IDENTITY_ORGANIZATION, opts); }; diff --git a/opencti-platform/opencti-graphql/src/generated/graphql.ts b/opencti-platform/opencti-graphql/src/generated/graphql.ts index 74008a13dab5..83bebf636d08 100644 --- a/opencti-platform/opencti-graphql/src/generated/graphql.ts +++ b/opencti-platform/opencti-graphql/src/generated/graphql.ts @@ -47,7 +47,7 @@ export type AdministrativeArea = BasicObject & Location & StixCoreObject & StixD created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -335,7 +335,7 @@ export type Artifact = BasicObject & HashedObservable & StixCoreObject & StixCyb connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; decryption_key?: Maybe; editContext?: Maybe>; encryption_algorithm?: Maybe; @@ -573,7 +573,7 @@ export type AttackPattern = BasicObject & StixCoreObject & StixDomainObject & St created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; dataComponents?: Maybe; description?: Maybe; editContext?: Maybe>; @@ -891,7 +891,7 @@ export type AutonomousSystem = BasicObject & StixCoreObject & StixCyberObservabl connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -1099,7 +1099,7 @@ export type BankAccount = BasicObject & StixCoreObject & StixCyberObservable & S connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -1307,7 +1307,7 @@ export type BasicObject = { export type BasicRelationship = { created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; fromRole?: Maybe; id: Scalars['ID']; @@ -1326,7 +1326,7 @@ export type Campaign = BasicObject & StixCoreObject & StixDomainObject & StixObj created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -1570,6 +1570,7 @@ export enum CampaignsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', Modified = 'modified', @@ -1658,7 +1659,7 @@ export type Case = BasicObject & Container & StixCoreObject & StixDomainObject & created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -1947,7 +1948,7 @@ export type Channel = BasicObject & StixCoreObject & StixDomainObject & StixObje created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -2226,7 +2227,7 @@ export type City = BasicObject & Location & StixCoreObject & StixDomainObject & created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -2518,7 +2519,7 @@ export type Container = { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; externalReferences?: Maybe; groupings?: Maybe; @@ -2813,7 +2814,7 @@ export type Country = BasicObject & Location & StixCoreObject & StixDomainObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -3059,7 +3060,7 @@ export type CourseOfAction = BasicObject & StixCoreObject & StixDomainObject & S created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -3352,7 +3353,7 @@ export type CryptocurrencyWallet = BasicObject & StixCoreObject & StixCyberObser connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -3554,7 +3555,7 @@ export type CryptographicKey = BasicObject & StixCoreObject & StixCyberObservabl connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -3760,7 +3761,7 @@ export type DataComponent = BasicObject & StixCoreObject & StixDomainObject & St created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; dataSource?: Maybe; description?: Maybe; editContext?: Maybe>; @@ -4001,7 +4002,7 @@ export type DataSource = BasicObject & StixCoreObject & StixDomainObject & StixO created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; dataComponents?: Maybe; description?: Maybe; editContext?: Maybe>; @@ -4267,7 +4268,7 @@ export type Directory = BasicObject & StixCoreObject & StixCyberObservable & Sti connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; ctime?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -4506,7 +4507,7 @@ export type DomainName = BasicObject & StixCoreObject & StixCyberObservable & St connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -4738,7 +4739,7 @@ export type EmailAddr = BasicObject & StixCoreObject & StixCyberObservable & Sti connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; display_name?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -4945,7 +4946,7 @@ export type EmailMessage = BasicObject & StixCoreObject & StixCyberObservable & content_type?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -5159,7 +5160,7 @@ export type EmailMimePartType = BasicObject & StixCoreObject & StixCyberObservab content_type?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -5410,7 +5411,7 @@ export type Event = BasicObject & StixCoreObject & StixDomainObject & StixObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -5653,7 +5654,7 @@ export type ExternalReference = BasicObject & StixMetaObject & StixObject & { connectors?: Maybe>>; created?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -5997,7 +5998,7 @@ export type Grouping = BasicObject & Container & StixCoreObject & StixDomainObje created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -6285,7 +6286,7 @@ export type HashedObservable = { connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -6482,7 +6483,7 @@ export type Hostname = BasicObject & StixCoreObject & StixCyberObservable & Stix connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -6685,7 +6686,7 @@ export type IPv4Addr = BasicObject & StixCoreObject & StixCyberObservable & Stix countries?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -6890,7 +6891,7 @@ export type IPv6Addr = BasicObject & StixCoreObject & StixCyberObservable & Stix countries?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -7129,7 +7130,7 @@ export type Identity = { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -7379,7 +7380,7 @@ export type Incident = BasicObject & StixCoreObject & StixDomainObject & StixObj created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -7629,6 +7630,7 @@ export enum IncidentsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', IncidentType = 'incident_type', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', @@ -7676,7 +7678,7 @@ export type Indicator = BasicObject & StixCoreObject & StixDomainObject & StixOb created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -7998,7 +8000,7 @@ export type Individual = BasicObject & Identity & StixCoreObject & StixDomainObj created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -8296,7 +8298,7 @@ export type Infrastructure = BasicObject & StixCoreObject & StixDomainObject & S created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -8581,7 +8583,7 @@ export type InternalObject = { export type InternalRelationship = BasicRelationship & { __typename?: 'InternalRelationship'; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; from?: Maybe; fromRole?: Maybe; @@ -8608,7 +8610,7 @@ export type IntrusionSet = BasicObject & StixCoreObject & StixDomainObject & Sti created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -8859,6 +8861,7 @@ export enum IntrusionSetsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', Modified = 'modified', @@ -8889,7 +8892,7 @@ export type KillChainPhase = BasicObject & StixMetaObject & StixObject & { __typename?: 'KillChainPhase'; created?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; id: Scalars['ID']; @@ -8988,7 +8991,7 @@ export type Label = BasicObject & StixMetaObject & StixObject & { color?: Maybe; created?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; id: Scalars['ID']; @@ -9075,7 +9078,7 @@ export type Language = BasicObject & StixCoreObject & StixDomainObject & StixObj created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -9329,7 +9332,7 @@ export type Location = { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -9660,7 +9663,7 @@ export type MacAddr = BasicObject & StixCoreObject & StixCyberObservable & StixO connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -9867,7 +9870,7 @@ export type Malware = BasicObject & StixCoreObject & StixDomainObject & StixObje created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -10157,7 +10160,7 @@ export type MarkingDefinition = BasicObject & StixMetaObject & StixObject & { __typename?: 'MarkingDefinition'; created?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; definition?: Maybe; definition_type?: Maybe; editContext?: Maybe>; @@ -10292,7 +10295,7 @@ export type MediaContent = BasicObject & StixCoreObject & StixCyberObservable & content?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -12015,7 +12018,7 @@ export type Mutex = BasicObject & StixCoreObject & StixCyberObservable & StixObj connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -12220,7 +12223,7 @@ export type Narrative = BasicObject & StixCoreObject & StixDomainObject & StixOb created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -12461,7 +12464,7 @@ export type NetworkTraffic = BasicObject & StixCoreObject & StixCyberObservable connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; dst_byte_count?: Maybe; dst_packets?: Maybe; dst_port?: Maybe; @@ -12687,7 +12690,7 @@ export type Note = BasicObject & Container & StixCoreObject & StixDomainObject & created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -13094,7 +13097,7 @@ export type ObservedData = BasicObject & Container & StixCoreObject & StixDomain created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -13403,7 +13406,7 @@ export type Opinion = BasicObject & Container & StixCoreObject & StixDomainObjec created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; explanation?: Maybe; @@ -13713,7 +13716,7 @@ export type Organization = BasicObject & Identity & StixCoreObject & StixDomainO created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -14028,7 +14031,7 @@ export type PaymentCard = BasicObject & StixCoreObject & StixCyberObservable & S connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; cvv?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -14235,7 +14238,7 @@ export type PhoneNumber = BasicObject & StixCoreObject & StixCyberObservable & S connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -14440,7 +14443,7 @@ export type Position = BasicObject & Location & StixCoreObject & StixDomainObjec created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -14722,7 +14725,7 @@ export type Process = BasicObject & StixCoreObject & StixCyberObservable & StixO createdBy?: Maybe; created_at: Scalars['DateTime']; created_time?: Maybe; - creator?: Maybe; + creators?: Maybe>; cwd?: Maybe; dep_enabled?: Maybe; descriptions?: Maybe>>; @@ -17171,7 +17174,7 @@ export type Region = BasicObject & Location & StixCoreObject & StixDomainObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -17465,7 +17468,7 @@ export type Report = BasicObject & Container & StixCoreObject & StixDomainObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; deleteWithElementsCount?: Maybe; description?: Maybe; editContext?: Maybe>; @@ -17942,7 +17945,7 @@ export type Sector = BasicObject & Identity & StixCoreObject & StixDomainObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -18293,7 +18296,7 @@ export type Software = BasicObject & StixCoreObject & StixCyberObservable & Stix cpe?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -18589,7 +18592,7 @@ export type StixCoreObject = { connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -18922,7 +18925,7 @@ export type StixCoreRelationship = BasicRelationship & StixRelationship & { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -19191,7 +19194,7 @@ export type StixCyberObservable = { connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -19459,7 +19462,7 @@ export type StixCyberObservableRelationship = BasicRelationship & StixRelationsh cases?: Maybe; confidence?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; from: StixObjectOrStixRelationship; @@ -19635,7 +19638,7 @@ export type StixDomainObject = { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -20000,7 +20003,7 @@ export type StixFile = BasicObject & HashedObservable & StixCoreObject & StixCyb connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; ctime?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -20245,7 +20248,7 @@ export type StixMetaObject = { export type StixMetaRelationship = BasicRelationship & StixRelationship & { __typename?: 'StixMetaRelationship'; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; from: StixObjectOrStixRelationship; fromRole?: Maybe; @@ -20303,7 +20306,7 @@ export enum StixMetaRelationshipsOrdering { export type StixObject = { created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; id: Scalars['ID']; is_inferred: Scalars['Boolean']; @@ -20391,7 +20394,7 @@ export enum StixObjectOrStixRelationshipsOrdering { } export type StixRelationship = { - creator?: Maybe; + creators?: Maybe>; entity_type: Scalars['String']; from: StixObjectOrStixRelationship; fromRole?: Maybe; @@ -20470,7 +20473,7 @@ export type StixSightingRelationship = BasicRelationship & StixRelationship & { created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -20956,7 +20959,7 @@ export type System = BasicObject & Identity & StixCoreObject & StixDomainObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -21377,7 +21380,7 @@ export type Text = BasicObject & StixCoreObject & StixCyberObservable & StixObje connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -21583,7 +21586,7 @@ export type ThreatActor = BasicObject & StixCoreObject & StixDomainObject & Stix created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -21842,6 +21845,7 @@ export enum ThreatActorsFilter { Created = 'created', CreatedBy = 'createdBy', CreatedAt = 'created_at', + Creator = 'creator', LabelledBy = 'labelledBy', MarkedBy = 'markedBy', Modified = 'modified', @@ -21883,7 +21887,7 @@ export type Tool = BasicObject & StixCoreObject & StixDomainObject & StixObject created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -22245,7 +22249,7 @@ export type Url = BasicObject & StixCoreObject & StixCyberObservable & StixObjec connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -22485,7 +22489,7 @@ export type UserAccount = BasicObject & StixCoreObject & StixCyberObservable & S connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; credential?: Maybe; credential_last_changed?: Maybe; display_name?: Maybe; @@ -22720,7 +22724,7 @@ export type UserAgent = BasicObject & StixCoreObject & StixCyberObservable & Sti connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -23023,7 +23027,7 @@ export type Vocabulary = BasicObject & StixMetaObject & StixObject & { category: VocabularyDefinition; created?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; entity_type: Scalars['String']; id: Scalars['ID']; @@ -23181,7 +23185,7 @@ export type Vulnerability = BasicObject & StixCoreObject & StixDomainObject & St created?: Maybe; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; description?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -23431,7 +23435,7 @@ export type WindowsRegistryKey = BasicObject & StixCoreObject & StixCyberObserva connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; editContext?: Maybe>; entity_type: Scalars['String']; exportFiles?: Maybe; @@ -23636,7 +23640,7 @@ export type WindowsRegistryValueType = BasicObject & StixCoreObject & StixCyberO connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; data?: Maybe; data_type?: Maybe; editContext?: Maybe>; @@ -24060,7 +24064,7 @@ export type X509Certificate = BasicObject & HashedObservable & StixCoreObject & connectors?: Maybe>>; createdBy?: Maybe; created_at: Scalars['DateTime']; - creator?: Maybe; + creators?: Maybe>; crl_distribution_points?: Maybe; editContext?: Maybe>; entity_type: Scalars['String']; @@ -25680,7 +25684,7 @@ export type AdministrativeAreaResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -25779,7 +25783,7 @@ export type ArtifactResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; decryption_key?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; encryption_algorithm?: Resolver, ParentType, ContextType>; @@ -25851,7 +25855,7 @@ export type AttackPatternResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; dataComponents?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -25952,7 +25956,7 @@ export type AutonomousSystemResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -25998,7 +26002,7 @@ export type BankAccountResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -26046,7 +26050,7 @@ export type BasicObjectResolvers = ResolversObject<{ __resolveType: TypeResolveFn<'InternalRelationship' | 'StixCoreRelationship' | 'StixCyberObservableRelationship' | 'StixMetaRelationship' | 'StixSightingRelationship', ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; fromRole?: Resolver, ParentType, ContextType>; id?: Resolver; @@ -26064,7 +26068,7 @@ export type CampaignResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26163,7 +26167,7 @@ export type CaseResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26229,7 +26233,7 @@ export type ChannelResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26290,7 +26294,7 @@ export type CityResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26408,7 +26412,7 @@ export type ContainerResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; externalReferences?: Resolver, ParentType, ContextType, Partial>; groupings?: Resolver, ParentType, ContextType, Partial>; @@ -26480,7 +26484,7 @@ export type CountryResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26555,7 +26559,7 @@ export type CourseOfActionResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26645,7 +26649,7 @@ export type CryptocurrencyWalletResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -26687,7 +26691,7 @@ export type CryptographicKeyResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -26733,7 +26737,7 @@ export type DataComponentResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; dataSource?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -26795,7 +26799,7 @@ export type DataSourceResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; dataComponents?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -26871,7 +26875,7 @@ export type DirectoryResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; ctime?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -26946,7 +26950,7 @@ export type DomainNameResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27002,7 +27006,7 @@ export type EmailAddrResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; display_name?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27048,7 +27052,7 @@ export type EmailMessageResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27096,7 +27100,7 @@ export type EmailMimePartTypeResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27170,7 +27174,7 @@ export type EventResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27229,7 +27233,7 @@ export type ExternalReferenceResolvers>>, ParentType, ContextType, Partial>; created?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27409,7 +27413,7 @@ export type GroupingResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27476,7 +27480,7 @@ export type HashedObservableResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27516,7 +27520,7 @@ export type HostnameResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27559,7 +27563,7 @@ export type IPv4AddrResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27602,7 +27606,7 @@ export type IPv6AddrResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -27648,7 +27652,7 @@ export type IdentityResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27719,7 +27723,7 @@ export type IncidentResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27800,7 +27804,7 @@ export type IndicatorResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27882,7 +27886,7 @@ export type IndividualResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -27972,7 +27976,7 @@ export type InfrastructureResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -28046,7 +28050,7 @@ export type InternalObjectResolvers = ResolversObject<{ created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; from?: Resolver, ParentType, ContextType>; fromRole?: Resolver, ParentType, ContextType>; @@ -28067,7 +28071,7 @@ export type IntrusionSetResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -28139,7 +28143,7 @@ export type IntrusionSetEditMutationsResolvers = ResolversObject<{ created?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; id?: Resolver; @@ -28183,7 +28187,7 @@ export type LabelResolvers, ParentType, ContextType>; created?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; id?: Resolver; @@ -28228,7 +28232,7 @@ export type LanguageResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -28302,7 +28306,7 @@ export type LocationResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -28404,7 +28408,7 @@ export type MacAddrResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -28451,7 +28455,7 @@ export type MalwareResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -28522,7 +28526,7 @@ export type MalwareEditMutationsResolvers = ResolversObject<{ created?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; definition?: Resolver, ParentType, ContextType>; definition_type?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -28610,7 +28614,7 @@ export type MediaContentResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -28901,7 +28905,7 @@ export type MutexResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -28946,7 +28950,7 @@ export type NarrativeResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -29007,7 +29011,7 @@ export type NetworkTrafficResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; dst_byte_count?: Resolver, ParentType, ContextType>; dst_packets?: Resolver, ParentType, ContextType>; dst_port?: Resolver, ParentType, ContextType>; @@ -29064,7 +29068,7 @@ export type NoteResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -29195,7 +29199,7 @@ export type ObservedDataResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -29269,7 +29273,7 @@ export type OpinionResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; explanation?: Resolver, ParentType, ContextType>; @@ -29341,7 +29345,7 @@ export type OrganizationResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -29442,7 +29446,7 @@ export type PaymentCardResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; cvv?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -29486,7 +29490,7 @@ export type PhoneNumberResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -29531,7 +29535,7 @@ export type PositionResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -29607,7 +29611,7 @@ export type ProcessResolvers, ParentType, ContextType>; created_at?: Resolver; created_time?: Resolver, ParentType, ContextType>; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; cwd?: Resolver, ParentType, ContextType>; dep_enabled?: Resolver, ParentType, ContextType>; descriptions?: Resolver>>, ParentType, ContextType>; @@ -29963,7 +29967,7 @@ export type RegionResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -30047,7 +30051,7 @@ export type ReportResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; deleteWithElementsCount?: Resolver, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -30236,7 +30240,7 @@ export type SectorResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -30371,7 +30375,7 @@ export type SoftwareResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -30462,7 +30466,7 @@ export type StixCoreObjectResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -30527,7 +30531,7 @@ export type StixCoreRelationshipResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -30595,7 +30599,7 @@ export type StixCyberObservableResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -30660,7 +30664,7 @@ export type StixCyberObservableRelationshipResolvers, ParentType, ContextType, Partial>; confidence?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; from?: Resolver; @@ -30714,7 +30718,7 @@ export type StixDomainObjectResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -30789,7 +30793,7 @@ export type StixFileResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; ctime?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -30869,7 +30873,7 @@ export type StixMetaObjectResolvers = ResolversObject<{ created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; from?: Resolver; fromRole?: Resolver, ParentType, ContextType>; @@ -30901,7 +30905,7 @@ export type StixMetaRelationshipEdgeResolvers = ResolversObject<{ __resolveType: TypeResolveFn<'AdministrativeArea' | 'Artifact' | 'AttackPattern' | 'AutonomousSystem' | 'BankAccount' | 'Campaign' | 'Case' | 'Channel' | 'City' | 'Country' | 'CourseOfAction' | 'CryptocurrencyWallet' | 'CryptographicKey' | 'DataComponent' | 'DataSource' | 'Directory' | 'DomainName' | 'EmailAddr' | 'EmailMessage' | 'EmailMimePartType' | 'Event' | 'ExternalReference' | 'Grouping' | 'Hostname' | 'IPv4Addr' | 'IPv6Addr' | 'Incident' | 'Indicator' | 'Individual' | 'Infrastructure' | 'IntrusionSet' | 'KillChainPhase' | 'Label' | 'Language' | 'MacAddr' | 'Malware' | 'MarkingDefinition' | 'MediaContent' | 'Mutex' | 'Narrative' | 'NetworkTraffic' | 'Note' | 'ObservedData' | 'Opinion' | 'Organization' | 'PaymentCard' | 'PhoneNumber' | 'Position' | 'Process' | 'Region' | 'Report' | 'Sector' | 'Software' | 'StixFile' | 'System' | 'Text' | 'ThreatActor' | 'Tool' | 'Url' | 'UserAccount' | 'UserAgent' | 'Vocabulary' | 'Vulnerability' | 'WindowsRegistryKey' | 'WindowsRegistryValueType' | 'X509Certificate', ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; id?: Resolver; is_inferred?: Resolver; @@ -30948,7 +30952,7 @@ export interface StixRefScalarConfig extends GraphQLScalarTypeConfig = ResolversObject<{ __resolveType: TypeResolveFn<'StixCoreRelationship' | 'StixCyberObservableRelationship' | 'StixMetaRelationship' | 'StixSightingRelationship', ParentType, ContextType>; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; from?: Resolver; fromRole?: Resolver, ParentType, ContextType>; @@ -30986,7 +30990,7 @@ export type StixSightingRelationshipResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -31166,7 +31170,7 @@ export type SystemResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -31311,7 +31315,7 @@ export type TextResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -31357,7 +31361,7 @@ export type ThreatActorResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -31444,7 +31448,7 @@ export type ToolResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -31559,7 +31563,7 @@ export type UrlResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -31639,7 +31643,7 @@ export type UserAccountResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; credential?: Resolver, ParentType, ContextType>; credential_last_changed?: Resolver, ParentType, ContextType>; display_name?: Resolver, ParentType, ContextType>; @@ -31688,7 +31692,7 @@ export type UserAgentResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -31762,7 +31766,7 @@ export type VocabularyResolvers; created?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; entity_type?: Resolver; id?: Resolver; @@ -31813,7 +31817,7 @@ export type VulnerabilityResolvers, ParentType, ContextType>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; description?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; @@ -31889,7 +31893,7 @@ export type WindowsRegistryKeyResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; exportFiles?: Resolver, ParentType, ContextType, Partial>; @@ -31932,7 +31936,7 @@ export type WindowsRegistryValueTypeResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; data?: Resolver, ParentType, ContextType>; data_type?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; @@ -32074,7 +32078,7 @@ export type X509CertificateResolvers>>, ParentType, ContextType, Partial>; createdBy?: Resolver, ParentType, ContextType>; created_at?: Resolver; - creator?: Resolver, ParentType, ContextType>; + creators?: Resolver>, ParentType, ContextType>; crl_distribution_points?: Resolver, ParentType, ContextType>; editContext?: Resolver>, ParentType, ContextType>; entity_type?: Resolver; diff --git a/opencti-platform/opencti-graphql/src/manager/taskManager.js b/opencti-platform/opencti-graphql/src/manager/taskManager.js index 214ccd5ffc40..d25d288438c7 100644 --- a/opencti-platform/opencti-graphql/src/manager/taskManager.js +++ b/opencti-platform/opencti-graphql/src/manager/taskManager.js @@ -247,7 +247,7 @@ const executeReplace = async (context, user, actionContext, element) => { script: { source: 'ctx._source["creator_id"] = params.creator_id;', lang: 'painless', - params: { creator_id: historicCreator } + params: { creator_id: [historicCreator] } }, }); } diff --git a/opencti-platform/opencti-graphql/src/modules/administrativeArea/administrativeArea.graphql b/opencti-platform/opencti-graphql/src/modules/administrativeArea/administrativeArea.graphql index 04fd4165216f..32ec35aa9e2e 100644 --- a/opencti-platform/opencti-graphql/src/modules/administrativeArea/administrativeArea.graphql +++ b/opencti-platform/opencti-graphql/src/modules/administrativeArea/administrativeArea.graphql @@ -101,7 +101,7 @@ type AdministrativeArea implements BasicObject & StixCoreObject & StixDomainObje # AdministrativeArea country: Country # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/case/case.graphql b/opencti-platform/opencti-graphql/src/modules/case/case.graphql index 851f0e83cf9d..5a568a3e5596 100644 --- a/opencti-platform/opencti-graphql/src/modules/case/case.graphql +++ b/opencti-platform/opencti-graphql/src/modules/case/case.graphql @@ -122,7 +122,7 @@ type Case implements BasicObject & StixObject & StixCoreObject & StixDomainObjec description: String rating: Int # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/channel/channel.graphql b/opencti-platform/opencti-graphql/src/modules/channel/channel.graphql index ed623e433459..67e2e8e69471 100644 --- a/opencti-platform/opencti-graphql/src/modules/channel/channel.graphql +++ b/opencti-platform/opencti-graphql/src/modules/channel/channel.graphql @@ -97,7 +97,7 @@ type Channel implements BasicObject & StixObject & StixCoreObject & StixDomainOb channel_types: [String] aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent.graphql b/opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent.graphql index 3ac54867f36e..c1f03eecffb1 100644 --- a/opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent.graphql +++ b/opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent.graphql @@ -97,7 +97,7 @@ type DataComponent implements BasicObject & StixObject & StixCoreObject & StixDo objectAssignee: AssigneeConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/dataSource/dataSource.graphql b/opencti-platform/opencti-graphql/src/modules/dataSource/dataSource.graphql index f94cf9d26f55..96f26cd2f543 100644 --- a/opencti-platform/opencti-graphql/src/modules/dataSource/dataSource.graphql +++ b/opencti-platform/opencti-graphql/src/modules/dataSource/dataSource.graphql @@ -97,7 +97,7 @@ type DataSource implements BasicObject & StixObject & StixCoreObject & StixDomai objectAssignee: AssigneeConnection # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/event/event.graphql b/opencti-platform/opencti-graphql/src/modules/event/event.graphql index a8caa7080b5f..bee0d998e835 100644 --- a/opencti-platform/opencti-graphql/src/modules/event/event.graphql +++ b/opencti-platform/opencti-graphql/src/modules/event/event.graphql @@ -99,7 +99,7 @@ type Event implements BasicObject & StixCoreObject & StixDomainObject & StixObje stop_time: DateTime aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/grouping/grouping.graphql b/opencti-platform/opencti-graphql/src/modules/grouping/grouping.graphql index c6681179dc12..f21fc9614e38 100644 --- a/opencti-platform/opencti-graphql/src/modules/grouping/grouping.graphql +++ b/opencti-platform/opencti-graphql/src/modules/grouping/grouping.graphql @@ -120,7 +120,7 @@ type Grouping implements BasicObject & StixObject & StixCoreObject & StixDomainO context: String! x_opencti_aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/language/language.graphql b/opencti-platform/opencti-graphql/src/modules/language/language.graphql index f95e4801cda6..f1a44d81b0d0 100644 --- a/opencti-platform/opencti-graphql/src/modules/language/language.graphql +++ b/opencti-platform/opencti-graphql/src/modules/language/language.graphql @@ -95,7 +95,7 @@ type Language implements BasicObject & StixCoreObject & StixDomainObject & StixO name: String! aliases: [String] # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/narrative/narrative.graphql b/opencti-platform/opencti-graphql/src/modules/narrative/narrative.graphql index 55742832c702..64625bc7fc5b 100644 --- a/opencti-platform/opencti-graphql/src/modules/narrative/narrative.graphql +++ b/opencti-platform/opencti-graphql/src/modules/narrative/narrative.graphql @@ -100,7 +100,7 @@ type Narrative implements BasicObject & StixCoreObject & StixDomainObject & Stix subNarratives: NarrativeConnection isSubNarrative: Boolean # Technical - creator: Creator + creators: [Creator!] toStix: String importFiles(first: Int): FileConnection pendingFiles(first: Int): FileConnection diff --git a/opencti-platform/opencti-graphql/src/modules/vocabulary/vocabulary.graphql b/opencti-platform/opencti-graphql/src/modules/vocabulary/vocabulary.graphql index 76100c16b838..7fffc4dd837a 100644 --- a/opencti-platform/opencti-graphql/src/modules/vocabulary/vocabulary.graphql +++ b/opencti-platform/opencti-graphql/src/modules/vocabulary/vocabulary.graphql @@ -52,7 +52,7 @@ type Vocabulary implements BasicObject & StixObject & StixMetaObject { entity_type: String! parent_types: [String]! # StixObject - creator: Creator + creators: [Creator!] x_opencti_stix_ids: [StixId] is_inferred: Boolean! spec_version: String! diff --git a/opencti-platform/opencti-graphql/src/resolvers/campaign.js b/opencti-platform/opencti-graphql/src/resolvers/campaign.js index 9e00d6cabeff..96a3ab164138 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/campaign.js +++ b/opencti-platform/opencti-graphql/src/resolvers/campaign.js @@ -31,6 +31,7 @@ const campaignResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), assigneeTo: buildRefRelationKey(RELATION_OBJECT_ASSIGNEE), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { campaignEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/file.js b/opencti-platform/opencti-graphql/src/resolvers/file.js index 5a52e4976578..c0c416e49445 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/file.js +++ b/opencti-platform/opencti-graphql/src/resolvers/file.js @@ -3,10 +3,10 @@ import { askJobImport, uploadImport, uploadPending } from '../domain/file'; import { worksForSource } from '../domain/work'; import { stixCoreObjectImportDelete } from '../domain/stixCoreObject'; import { batchLoader } from '../database/middleware'; -import { batchCreators } from '../domain/user'; +import { batchCreator } from '../domain/user'; import { batchStixDomainObjects } from '../domain/stixDomainObject'; -const creatorLoader = batchLoader(batchCreators); +const creatorLoader = batchLoader(batchCreator); const domainLoader = batchLoader(batchStixDomainObjects); const fileResolvers = { diff --git a/opencti-platform/opencti-graphql/src/resolvers/incident.js b/opencti-platform/opencti-graphql/src/resolvers/incident.js index d6eaf3033364..ecb29d4403a6 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/incident.js +++ b/opencti-platform/opencti-graphql/src/resolvers/incident.js @@ -31,6 +31,7 @@ const incidentResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), assigneeTo: buildRefRelationKey(RELATION_OBJECT_ASSIGNEE), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { incidentEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/intrusionSet.js b/opencti-platform/opencti-graphql/src/resolvers/intrusionSet.js index 6d27bfc9f720..682fe7f01780 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/intrusionSet.js +++ b/opencti-platform/opencti-graphql/src/resolvers/intrusionSet.js @@ -31,6 +31,7 @@ const intrusionSetResolvers = { markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), assigneeTo: buildRefRelationKey(RELATION_OBJECT_ASSIGNEE), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { intrusionSetEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/log.js b/opencti-platform/opencti-graphql/src/resolvers/log.js index 5707545e898b..f8a2e528b3ba 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/log.js +++ b/opencti-platform/opencti-graphql/src/resolvers/log.js @@ -1,10 +1,10 @@ import { findAll, logsTimeSeries, logsWorkerConfig } from '../domain/log'; -import { batchCreators } from '../domain/user'; +import { batchCreator } from '../domain/user'; import { storeLoadById } from '../database/middleware-loader'; import { ENTITY_TYPE_EXTERNAL_REFERENCE } from '../schema/stixMetaObject'; import { batchLoader } from '../database/middleware'; -const creatorLoader = batchLoader(batchCreators); +const creatorLoader = batchLoader(batchCreator); const logResolvers = { Query: { diff --git a/opencti-platform/opencti-graphql/src/resolvers/stix.js b/opencti-platform/opencti-graphql/src/resolvers/stix.js index 338f3924f4f5..f0b41b102c30 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/stix.js +++ b/opencti-platform/opencti-graphql/src/resolvers/stix.js @@ -25,7 +25,7 @@ const stixResolvers = { /* istanbul ignore next */ return 'Unknown'; }, - creator: (stix, _, context) => creatorsLoader.load(stix.creator_id, context, context.user), + creators: (stix, _, context) => creatorsLoader.load(stix.creator_id, context, context.user), } }; diff --git a/opencti-platform/opencti-graphql/src/resolvers/stixCoreRelationship.js b/opencti-platform/opencti-graphql/src/resolvers/stixCoreRelationship.js index 6025f0f9f12e..39a91b4059c6 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/stixCoreRelationship.js +++ b/opencti-platform/opencti-graphql/src/resolvers/stixCoreRelationship.js @@ -68,7 +68,7 @@ const stixCoreRelationshipResolvers = { from: (rel, _, context) => loadByIdLoader.load(rel.fromId, context, context.user), to: (rel, _, context) => loadByIdLoader.load(rel.toId, context, context.user), toStix: (rel, _, context) => stixLoadByIdStringify(context, context.user, rel.id), - creator: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), + creators: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), createdBy: (rel, _, context) => createdByLoader.load(rel.id, context, context.user), objectMarking: (rel, _, context) => markingDefinitionsLoader.load(rel.id, context, context.user), objectLabel: (rel, _, context) => labelsLoader.load(rel.id, context, context.user), diff --git a/opencti-platform/opencti-graphql/src/resolvers/stixCyberObservableRelationship.js b/opencti-platform/opencti-graphql/src/resolvers/stixCyberObservableRelationship.js index 70cdddb6290c..179826a5c1eb 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/stixCyberObservableRelationship.js +++ b/opencti-platform/opencti-graphql/src/resolvers/stixCyberObservableRelationship.js @@ -36,7 +36,7 @@ const stixCyberObservableRelationshipResolvers = { reports: (rel, _, context) => reportsLoader.load(rel.id, context, context.user), notes: (rel, _, context) => notesLoader.load(rel.id, context, context.user), opinions: (rel, _, context) => opinionsLoader.load(rel.id, context, context.user), - creator: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), + creators: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), editContext: (rel) => fetchEditContext(rel.id), }, Mutation: { diff --git a/opencti-platform/opencti-graphql/src/resolvers/stixSightingRelationship.js b/opencti-platform/opencti-graphql/src/resolvers/stixSightingRelationship.js index 3e006a240e9e..72791be1c88d 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/stixSightingRelationship.js +++ b/opencti-platform/opencti-graphql/src/resolvers/stixSightingRelationship.js @@ -65,7 +65,7 @@ const stixSightingRelationshipResolvers = { from: (rel, _, context) => loadByIdLoader.load(rel.fromId, context, context.user), to: (rel, _, context) => loadByIdLoader.load(rel.toId, context, context.user), toStix: (rel, _, context) => stixLoadByIdStringify(context, context.user, rel.id), - creator: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), + creators: (rel, _, context) => creatorsLoader.load(rel.creator_id, context, context.user), createdBy: (rel, _, context) => createdByLoader.load(rel.id, context, context.user), objectMarking: (rel, _, context) => markingDefinitionsLoader.load(rel.id, context, context.user), objectOrganization: (rel, _, context) => batchOrganizationsLoader.load(rel.id, context, context.user), diff --git a/opencti-platform/opencti-graphql/src/resolvers/threatActor.js b/opencti-platform/opencti-graphql/src/resolvers/threatActor.js index 549473e64167..658cf469f9c4 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/threatActor.js +++ b/opencti-platform/opencti-graphql/src/resolvers/threatActor.js @@ -33,6 +33,7 @@ const threatActorResolvers = { assigneeTo: buildRefRelationKey(RELATION_OBJECT_ASSIGNEE), markedBy: buildRefRelationKey(RELATION_OBJECT_MARKING), labelledBy: buildRefRelationKey(RELATION_OBJECT_LABEL), + creator: 'creator_id', }, Mutation: { threatActorEdit: (_, { id }, context) => ({ diff --git a/opencti-platform/opencti-graphql/src/resolvers/workspace.js b/opencti-platform/opencti-graphql/src/resolvers/workspace.js index d504b4a89da0..d038cae187a5 100644 --- a/opencti-platform/opencti-graphql/src/resolvers/workspace.js +++ b/opencti-platform/opencti-graphql/src/resolvers/workspace.js @@ -13,14 +13,14 @@ import { workspaceDeleteRelation, workspaceDeleteRelations, } from '../domain/workspace'; -import { batchCreators } from '../domain/user'; +import { batchCreator } from '../domain/user'; import { fetchEditContext, pubSubAsyncIterator } from '../database/redis'; import { BUS_TOPICS } from '../config/conf'; import { ENTITY_TYPE_WORKSPACE } from '../schema/internalObject'; import withCancel from '../graphql/subscriptionWrapper'; import { batchLoader } from '../database/middleware'; -const creatorLoader = batchLoader(batchCreators); +const creatorLoader = batchLoader(batchCreator); const workspaceResolvers = { Query: { diff --git a/opencti-platform/opencti-graphql/src/schema/attribute-definition.ts b/opencti-platform/opencti-graphql/src/schema/attribute-definition.ts index e0451fe4b777..f220799baf28 100644 --- a/opencti-platform/opencti-graphql/src/schema/attribute-definition.ts +++ b/opencti-platform/opencti-graphql/src/schema/attribute-definition.ts @@ -22,8 +22,18 @@ export const internalId: AttributeDefinition = { upsert: false }; +export const creators: AttributeDefinition = { + name: 'creator_id', + label: 'Creators', + type: 'runtime', + mandatoryType: 'no', + multiple: true, + upsert: false +}; + export const standardId: AttributeDefinition = { name: 'standard_id', + label: 'Id', type: 'string', mandatoryType: 'internal', multiple: false, @@ -32,6 +42,7 @@ export const standardId: AttributeDefinition = { export const iAliasedIds: AttributeDefinition = { name: 'i_aliases_ids', + label: 'Internal aliases', type: 'string', mandatoryType: 'no', multiple: true, @@ -50,6 +61,7 @@ export const entityType: AttributeDefinition = { export const entityLocationType: AttributeDefinition = { name: 'x_opencti_location_type', + label: 'Location type', type: 'string', mandatoryType: 'internal', multiple: false, @@ -70,6 +82,7 @@ export const relationshipType: AttributeDefinition = { export const xOpenctiStixIds: AttributeDefinition = { name: 'x_opencti_stix_ids', + label: 'Stix ids', type: 'string', mandatoryType: 'no', multiple: true, @@ -80,6 +93,7 @@ export const xOpenctiStixIds: AttributeDefinition = { export const xOpenctiAliases: AttributeDefinition = { name: 'x_opencti_aliases', + label: 'Aliases', type: 'string', mandatoryType: 'no', multiple: true, @@ -88,6 +102,7 @@ export const xOpenctiAliases: AttributeDefinition = { export const aliases: AttributeDefinition = { name: 'aliases', + label: 'Aliases', type: 'string', mandatoryType: 'no', multiple: true, @@ -121,6 +136,7 @@ export const modified: AttributeDefinition = { export const createdAt: AttributeDefinition = { name: 'created_at', + label: 'Created at', type: 'date', mandatoryType: 'internal', multiple: false, @@ -128,6 +144,7 @@ export const createdAt: AttributeDefinition = { }; export const updatedAt: AttributeDefinition = { name: 'updated_at', + label: 'Updated at', type: 'date', mandatoryType: 'internal', multiple: false, diff --git a/opencti-platform/opencti-graphql/src/schema/schema-attributes.ts b/opencti-platform/opencti-graphql/src/schema/schema-attributes.ts index 6cc96ad9a75a..7353e2983578 100644 --- a/opencti-platform/opencti-graphql/src/schema/schema-attributes.ts +++ b/opencti-platform/opencti-graphql/src/schema/schema-attributes.ts @@ -16,6 +16,7 @@ export const depsKeysRegister = { export const schemaAttributesDefinition = { types: {} as Record>, attributes: {} as Record, + attributes_by_name: {} as Record, attributes_by_types: { string: new Map(), date: new Map(), @@ -60,6 +61,7 @@ export const schemaAttributesDefinition = { attribute, }); } + this.attributes_by_name[attribute.name] = attribute; // Generate map by types this.attributes_by_types[attribute.type].set(attribute.name); // Generate map by multiple @@ -79,6 +81,10 @@ export const schemaAttributesDefinition = { this.attributes[entityType] = attributes; }, + getAttribute(name: string): AttributeDefinition | null { + return this.attributes_by_name[name]; + }, + getAttributes(entityType: string): AttributeDefinition[] { return ((this.attributes)[entityType] ?? []); }, diff --git a/opencti-platform/opencti-graphql/src/schema/schema-relationsRef.ts b/opencti-platform/opencti-graphql/src/schema/schema-relationsRef.ts index 2c4fdcc20d34..45f14ea38460 100644 --- a/opencti-platform/opencti-graphql/src/schema/schema-relationsRef.ts +++ b/opencti-platform/opencti-graphql/src/schema/schema-relationsRef.ts @@ -4,6 +4,7 @@ import { getParentTypes } from './schemaUtils'; export const schemaRelationsRefDefinition = { relationsRef: {} as Record, + relationsRef_by_input: {} as Record, inputNames: [] as string[], databaseNames: [] as string[], @@ -33,21 +34,23 @@ export const schemaRelationsRefDefinition = { if (relationRefDefinition.checker) { this.registerChecker(relationRefDefinition.databaseName, relationRefDefinition.checker); } - if (relationRefDefinition.multiple) { this.databaseNameMultiple.set(relationRefDefinition.databaseName); this.inputNameMultiple.set(relationRefDefinition.inputName); } - this.databaseNameToInputName[relationRefDefinition.databaseName] = relationRefDefinition.inputName; this.inputNameToDatabaseName[relationRefDefinition.inputName] = relationRefDefinition.databaseName; - this.stixNameToInputName[relationRefDefinition.stixName] = relationRefDefinition.inputName; this.inputNameToStixName[relationRefDefinition.inputName] = relationRefDefinition.stixName; + this.relationsRef_by_input[relationRefDefinition.inputName] = relationRefDefinition; } }); }, + getRelationsRefByInputName(inputName: string): RelationRefDefinition { + return this.relationsRef_by_input[inputName]; + }, + getRelationsRef(entityType: string): RelationRefDefinition[] { if (this.relationsRefWithParentsCache.has(entityType)) { return this.relationsRefWithParentsCache.get(entityType) ?? []; diff --git a/opencti-platform/opencti-graphql/src/schema/stixCoreRelationship.ts b/opencti-platform/opencti-graphql/src/schema/stixCoreRelationship.ts index eb1ed77ca4fb..eb09984cddeb 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixCoreRelationship.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixCoreRelationship.ts @@ -8,7 +8,7 @@ import { import { AttributeDefinition, confidence, created, - createdAt, + createdAt, creators, entityType, IcreatedAtDay, IcreatedAtMonth, @@ -140,6 +140,7 @@ export const stixCoreRelationshipsAttributes: Array = [ updatedAt, xOpenctiStixIds, specVersion, + creators, revoked, confidence, lang, diff --git a/opencti-platform/opencti-graphql/src/schema/stixCyberObservable.ts b/opencti-platform/opencti-graphql/src/schema/stixCyberObservable.ts index 6ec576eb4ce4..49af47462783 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixCyberObservable.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixCyberObservable.ts @@ -16,6 +16,7 @@ import { STIX_SIGHTING_RELATIONSHIP } from './stixSightingRelationship'; import { AttributeDefinition, createdAt, + creators, entityType, internalId, specVersion, @@ -124,6 +125,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -141,6 +143,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -160,6 +163,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -175,6 +179,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -191,6 +196,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -212,6 +218,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -229,6 +236,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -250,6 +258,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -276,6 +285,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -318,6 +328,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -333,6 +344,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -348,6 +360,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -363,6 +376,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -378,6 +392,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -403,6 +418,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -441,6 +457,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -461,6 +478,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -476,6 +494,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -505,6 +524,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -522,6 +542,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -539,6 +560,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -554,6 +576,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -569,6 +592,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -584,6 +608,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -599,6 +624,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -614,6 +640,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -631,6 +658,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -646,6 +674,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -664,6 +693,7 @@ const stixCyberObservablesAttributes: { [k: string]: Array entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, diff --git a/opencti-platform/opencti-graphql/src/schema/stixCyberObservableRelationship.ts b/opencti-platform/opencti-graphql/src/schema/stixCyberObservableRelationship.ts index b6dd71f936cf..4112f7106def 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixCyberObservableRelationship.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixCyberObservableRelationship.ts @@ -4,6 +4,7 @@ import { confidence, created, createdAt, + creators, entityType, internalId, lang, @@ -332,6 +333,7 @@ const stixCyberObservableRelationshipsAttributes: AttributeDefinition[] = [ entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, diff --git a/opencti-platform/opencti-graphql/src/schema/stixDomainObject.ts b/opencti-platform/opencti-graphql/src/schema/stixDomainObject.ts index 500ce708dfd3..5a24979f6e53 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixDomainObject.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixDomainObject.ts @@ -16,6 +16,7 @@ import { confidence, created, createdAt, + creators, entityLocationType, entityType, iAliasedIds, @@ -191,6 +192,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -218,6 +220,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -250,6 +253,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -275,6 +279,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -297,6 +302,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -319,6 +325,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -346,6 +353,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -372,6 +380,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -400,6 +409,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -428,6 +438,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -454,6 +465,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -480,6 +492,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -517,6 +530,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -549,6 +563,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -584,6 +599,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -611,6 +627,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -638,6 +655,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -665,6 +683,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -694,6 +713,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -730,6 +750,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -769,6 +790,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -794,6 +816,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, @@ -824,6 +847,7 @@ const stixDomainObjectsAttributes: { [k: string]: Array } = xOpenctiStixIds, entityType, specVersion, + creators, createdAt, updatedAt, IcreatedAtDay, diff --git a/opencti-platform/opencti-graphql/src/schema/stixMetaObject.ts b/opencti-platform/opencti-graphql/src/schema/stixMetaObject.ts index 7429aacc721c..61108caae364 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixMetaObject.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixMetaObject.ts @@ -4,6 +4,7 @@ import { AttributeDefinition, created, createdAt, + creators, entityType, internalId, modified, specVersion, @@ -32,6 +33,7 @@ const stixMetaObjectsAttributes: { [k: string]: Array } = { entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -50,6 +52,7 @@ const stixMetaObjectsAttributes: { [k: string]: Array } = { entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -66,6 +69,7 @@ const stixMetaObjectsAttributes: { [k: string]: Array } = { entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, @@ -85,6 +89,7 @@ const stixMetaObjectsAttributes: { [k: string]: Array } = { entityType, xOpenctiStixIds, specVersion, + creators, createdAt, updatedAt, { name: 'i_created_at_day', type: 'date', mandatoryType: 'no', multiple: false, upsert: false }, diff --git a/opencti-platform/opencti-graphql/src/schema/stixMetaRelationship.ts b/opencti-platform/opencti-graphql/src/schema/stixMetaRelationship.ts index bc75b1969eac..098f5a80c0e5 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixMetaRelationship.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixMetaRelationship.ts @@ -14,6 +14,7 @@ import { confidence, created, createdAt, + creators, entityType, internalId, lang, @@ -173,6 +174,7 @@ const stixMetaRelationshipsAttributes: AttributeDefinition[] = [ { name: 'i_created_at_year', type: 'string', mandatoryType: 'no', multiple: false, upsert: false }, xOpenctiStixIds, specVersion, + creators, revoked, confidence, lang, diff --git a/opencti-platform/opencti-graphql/src/schema/stixSightingRelationship.ts b/opencti-platform/opencti-graphql/src/schema/stixSightingRelationship.ts index 355fbbb2318d..03cecfe32269 100644 --- a/opencti-platform/opencti-graphql/src/schema/stixSightingRelationship.ts +++ b/opencti-platform/opencti-graphql/src/schema/stixSightingRelationship.ts @@ -1,8 +1,10 @@ import * as R from 'ramda'; import { AttributeDefinition, - confidence, created, + confidence, + created, createdAt, + creators, entityType, IcreatedAtDay, IcreatedAtMonth, @@ -28,6 +30,7 @@ export const stixSightingRelationshipsAttributes: { [k: string]: Array; aliases: Array; granted_refs: Array; - object_assignee_refs: Array; linked_to_refs: Array; stix_ids: Array; type: string; @@ -45,16 +44,14 @@ interface StixOpenctiExtension { updated_at: Date; is_inferred: boolean; workflow_id: string | undefined; + assignee_ids: string[]; + creator_ids: string[]; } interface StixOpenctiExtensionSDO extends StixOpenctiExtension { extension_type : 'new-sdo'; } -interface StixOpenctiExtensionProperty extends StixOpenctiExtension { - extension_type : 'property-extension'; -} - interface StixObject { id: StixId; type: string; diff --git a/opencti-platform/opencti-graphql/src/types/store.d.ts b/opencti-platform/opencti-graphql/src/types/store.d.ts index 53d51315ba45..1f9aaa6b3096 100644 --- a/opencti-platform/opencti-graphql/src/types/store.d.ts +++ b/opencti-platform/opencti-graphql/src/types/store.d.ts @@ -84,6 +84,7 @@ interface BasicStoreBase extends BasicStoreIdentifier { x_opencti_aliases?: Array; x_opencti_stix_ids?: Array; x_opencti_workflow_id?: string; + creator_id?: string | string[]; } interface StoreMarkingDefinition extends BasicStoreEntity { diff --git a/opencti-platform/opencti-graphql/src/utils/filtering.js b/opencti-platform/opencti-graphql/src/utils/filtering.js index c4ddd36db65f..b52e85c16438 100644 --- a/opencti-platform/opencti-graphql/src/utils/filtering.js +++ b/opencti-platform/opencti-graphql/src/utils/filtering.js @@ -14,14 +14,15 @@ import { ENTITY_TYPE_RESOLVED_FILTERS } from '../schema/stixDomainObject'; // Resolutions export const MARKING_FILTER = 'markedBy'; -export const CREATOR_FILTER = 'createdBy'; +export const CREATED_BY_FILTER = 'createdBy'; +export const CREATOR_FILTER = 'creator'; export const ASSIGNEE_FILTER = 'assigneeTo'; export const OBJECT_CONTAINS_FILTER = 'objectContains'; export const RELATION_FROM = 'fromId'; export const RELATION_TO = 'toId'; export const RESOLUTION_FILTERS = [ MARKING_FILTER, - CREATOR_FILTER, + CREATED_BY_FILTER, ASSIGNEE_FILTER, OBJECT_CONTAINS_FILTER, RELATION_FROM, @@ -192,10 +193,24 @@ export const isStixMatchFilters = async (context, user, stix, filters) => { return false; } } - // Creator filtering - if (key === CREATOR_FILTER) { + // CreatedBy filtering + if (key === CREATED_BY_FILTER) { const ids = values.map((v) => v.id); - const isCreatorAvailable = stix.created_by_ref && ids.includes(stix.created_by_ref); + const isCreatedByAvailable = stix.created_by_ref && ids.includes(stix.created_by_ref); + // If creator is available but must not be + if (operator === 'not_eq' && isCreatedByAvailable) { + return false; + } + // If creator is not available but must be + if (operator === 'eq' && !isCreatedByAvailable) { + return false; + } + } + // Technical creator filter + if (key === CREATOR_FILTER) { + const creators = stix.extensions[STIX_EXT_OCTI]?.creator_ids ?? []; + const extractedValues = values.map((v) => v.id); + const isCreatorAvailable = extractedValues.some((r) => creators.includes(r)); // If creator is available but must not be if (operator === 'not_eq' && isCreatorAvailable) { return false; @@ -207,7 +222,7 @@ export const isStixMatchFilters = async (context, user, stix, filters) => { } // Assignee filtering if (key === ASSIGNEE_FILTER) { - const assignees = stix.extensions[STIX_EXT_OCTI]?.object_assignee_refs ?? []; + const assignees = stix.extensions[STIX_EXT_OCTI]?.assignee_ids ?? []; const extractedValues = values.map((v) => v.id); const isAssigneeAvailable = extractedValues.some((r) => assignees.includes(r)); // If assignee is available but must not be diff --git a/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js b/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js index 381ab54e7a0d..d229b7ae4aa6 100644 --- a/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js +++ b/opencti-platform/opencti-graphql/tests/03-streams/00-Raw/raw-test.js @@ -36,7 +36,7 @@ describe('Raw streams tests', () => { } // 02 - CHECK UPDATE EVENTS const updateEvents = events.filter((e) => e.type === EVENT_TYPE_UPDATE); - expect(updateEvents.length).toBe(99); + expect(updateEvents.length).toBe(100); const updateEventsByTypes = R.groupBy((e) => e.data.data.type, updateEvents); expect(updateEventsByTypes.report.length).toBe(3); for (let updateIndex = 0; updateIndex < updateEvents.length; updateIndex += 1) { diff --git a/opencti-platform/opencti-graphql/tests/utils/testQuery.ts b/opencti-platform/opencti-graphql/tests/utils/testQuery.ts index a131267956be..4ec68787e66f 100644 --- a/opencti-platform/opencti-graphql/tests/utils/testQuery.ts +++ b/opencti-platform/opencti-graphql/tests/utils/testQuery.ts @@ -17,7 +17,7 @@ export const SYNC_LIVE_START_REMOTE_URI = conf.get('app:sync_live_start_remote_u export const SYNC_DIRECT_START_REMOTE_URI = conf.get('app:sync_direct_start_remote_uri'); export const SYNC_RESTORE_START_REMOTE_URI = conf.get('app:sync_restore_start_remote_uri'); export const SYNC_TEST_REMOTE_URI = `http://api-tests:${PORT}`; -export const RAW_EVENTS_SIZE = 718; +export const RAW_EVENTS_SIZE = 719; export const SYNC_LIVE_EVENTS_SIZE = 513; export const PYTHON_PATH = './src/python/testing';