From 12e6d2f99583746ca62b6cc038c5db17d1e94076 Mon Sep 17 00:00:00 2001 From: Bonsai8863 <131906254+Bonsai8863@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:01:56 -0400 Subject: [PATCH 1/3] [frontend/backend] Added 'reports-to' and 'supports' relationships between threat actors --- .../opencti-front/lang/front/de.json | 2 ++ .../opencti-front/lang/front/en.json | 2 ++ .../opencti-front/lang/front/es.json | 2 ++ .../opencti-front/lang/front/fr.json | 2 ++ .../opencti-front/lang/front/ja.json | 2 ++ .../opencti-front/lang/front/ko.json | 4 +++- .../opencti-front/lang/front/zh.json | 2 ++ .../opencti-front/src/components/ItemIcon.jsx | 2 ++ .../ThreatActorIndividualKnowledge.tsx | 9 +++++++- .../opencti-front/src/utils/Colors.js | 2 ++ .../threatActorIndividual.ts | 22 +++++++++++++++++++ .../src/schema/stixCoreRelationship.ts | 4 ++++ 12 files changed, 53 insertions(+), 2 deletions(-) diff --git a/opencti-platform/opencti-front/lang/front/de.json b/opencti-platform/opencti-front/lang/front/de.json index 34de84372298..c02ea8539d2b 100644 --- a/opencti-platform/opencti-front/lang/front/de.json +++ b/opencti-platform/opencti-front/lang/front/de.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "hat", "relationship_remediates": "behebt", "relationship_reported-in": "berichtet in", + "relationship_reports-to": "berichte an", "relationship_resides-in": "wohnt in", "relationship_resolves-to": "löst sich auf in", "relationship_revoked-by": "widerrufen durch", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "gesichtet in/an", "relationship_subnarrative-of": "teilerzählung von", "relationship_subtechnique-of": "untertechnik von", + "relationship_supports": "unterstützt", "relationship_targets": "ziele", "relationship_to": "auf", "relationship_type": "Beziehungsart", diff --git a/opencti-platform/opencti-front/lang/front/en.json b/opencti-platform/opencti-front/lang/front/en.json index 2c4a6be39fea..13bcaf37126d 100644 --- a/opencti-platform/opencti-front/lang/front/en.json +++ b/opencti-platform/opencti-front/lang/front/en.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "has", "relationship_remediates": "remediates", "relationship_reported-in": "reported in", + "relationship_reports-to": "reports to", "relationship_resides-in": "resides in", "relationship_resolves-to": "resolves to", "relationship_revoked-by": "revoked by", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "sighted in/at", "relationship_subnarrative-of": "subnarrative of", "relationship_subtechnique-of": "subtechnique of", + "relationship_supports": "supports", "relationship_targets": "targets", "relationship_to": "to", "relationship_type": "Relationship type", diff --git a/opencti-platform/opencti-front/lang/front/es.json b/opencti-platform/opencti-front/lang/front/es.json index a37626f08074..cf8b5cabfbfe 100644 --- a/opencti-platform/opencti-front/lang/front/es.json +++ b/opencti-platform/opencti-front/lang/front/es.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "tiene", "relationship_remediates": "mitiga", "relationship_reported-in": "reportado en", + "relationship_reports-to": "informes a", "relationship_resides-in": "reside en", "relationship_resolves-to": "resuelve a", "relationship_revoked-by": "revocado por", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "detectado en", "relationship_subnarrative-of": "es subnarrativa de", "relationship_subtechnique-of": "es subtécnica de", + "relationship_supports": "apoya", "relationship_targets": "tiene como objetivo", "relationship_to": "to", "relationship_type": "Tipo de relación", diff --git a/opencti-platform/opencti-front/lang/front/fr.json b/opencti-platform/opencti-front/lang/front/fr.json index 9aba946d6eb4..bedcafe9268c 100644 --- a/opencti-platform/opencti-front/lang/front/fr.json +++ b/opencti-platform/opencti-front/lang/front/fr.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "a", "relationship_remediates": "remédie", "relationship_reported-in": "rapporté dans", + "relationship_reports-to": "rapports à", "relationship_resides-in": "réside dans", "relationship_resolves-to": "résout", "relationship_revoked-by": "révoqué par", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "détecté dans/en", "relationship_subnarrative-of": "sous-narratif de", "relationship_subtechnique-of": "sous-technique de", + "relationship_supports": "prend en charge", "relationship_targets": "cible", "relationship_to": "à", "relationship_type": "Type de relation", diff --git a/opencti-platform/opencti-front/lang/front/ja.json b/opencti-platform/opencti-front/lang/front/ja.json index 4c3d43e03b0d..4e806330eab3 100644 --- a/opencti-platform/opencti-front/lang/front/ja.json +++ b/opencti-platform/opencti-front/lang/front/ja.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "存在する", "relationship_remediates": "対応する", "relationship_reported-in": "で報告", + "relationship_reports-to": "報告先", "relationship_resides-in": "住む", "relationship_resolves-to": "名前解決される", "relationship_revoked-by": "失効", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "目撃", "relationship_subnarrative-of": "サブナラティブ", "relationship_subtechnique-of": "サブテクニック", + "relationship_supports": "サポート", "relationship_targets": "標的", "relationship_to": "to", "relationship_type": "リレーションシップ種別", diff --git a/opencti-platform/opencti-front/lang/front/ko.json b/opencti-platform/opencti-front/lang/front/ko.json index b7f1333b463d..f65d66136a2d 100644 --- a/opencti-platform/opencti-front/lang/front/ko.json +++ b/opencti-platform/opencti-front/lang/front/ko.json @@ -2160,7 +2160,7 @@ "relationship_installed-software": "설치된 소프트웨어", "relationship_investigates": "조사", "relationship_kill-chain-phase": "킬 체인 단계", - "relationship_known-as": "relationship_known-as", + "relationship_known-as": "~로 알려진", "relationship_located-at": "위치", "relationship_mitigates": "완화", "relationship_national-of": "국적", @@ -2187,6 +2187,7 @@ "relationship_relation-has": "보유", "relationship_remediates": "개선", "relationship_reported-in": "보고됨", + "relationship_reports-to": "보고하다", "relationship_resides-in": "거주", "relationship_resolves-to": "해결", "relationship_revoked-by": "취소됨", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "목격", "relationship_subnarrative-of": "하위 서술", "relationship_subtechnique-of": "하위 기술", + "relationship_supports": "지원합니다", "relationship_targets": "표적", "relationship_to": "대상", "relationship_type": "관계 유형", diff --git a/opencti-platform/opencti-front/lang/front/zh.json b/opencti-platform/opencti-front/lang/front/zh.json index 05a1b0ab6861..338c30029c4c 100644 --- a/opencti-platform/opencti-front/lang/front/zh.json +++ b/opencti-platform/opencti-front/lang/front/zh.json @@ -2187,6 +2187,7 @@ "relationship_relation-has": "关系有", "relationship_remediates": "补救", "relationship_reported-in": "报告于", + "relationship_reports-to": "报告给", "relationship_resides-in": "驻留在", "relationship_resolves-to": "解析为", "relationship_revoked-by": "撤销", @@ -2199,6 +2200,7 @@ "relationship_stix-sighting-relationship": "目击关系", "relationship_subnarrative-of": "的子叙事", "relationship_subtechnique-of": "子技术", + "relationship_supports": "支持", "relationship_targets": "目标", "relationship_to": "到", "relationship_type": "关系类型", diff --git a/opencti-platform/opencti-front/src/components/ItemIcon.jsx b/opencti-platform/opencti-front/src/components/ItemIcon.jsx index e840047a0388..6a047013d875 100644 --- a/opencti-platform/opencti-front/src/components/ItemIcon.jsx +++ b/opencti-platform/opencti-front/src/components/ItemIcon.jsx @@ -447,6 +447,8 @@ const iconSelector = (type, variant, fontSize, color, isReversed) => { case 'located-at': case 'related-to': case 'mitigates': + case 'reports-to': + case 'supports': case 'known-as': case 'impersonates': case 'indicates': diff --git a/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx b/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx index 32150d2a6552..7114b1608adc 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx +++ b/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx @@ -95,7 +95,14 @@ const ThreatActorIndividualKnowledgeComponent = ({ element={ { case 'subtechnique-of': case 'numberOfConnectedElement': case 'known-as': + case 'reports-to': + case 'supports': if (dark) { return '#616161'; } diff --git a/opencti-platform/opencti-graphql/src/modules/threatActorIndividual/threatActorIndividual.ts b/opencti-platform/opencti-graphql/src/modules/threatActorIndividual/threatActorIndividual.ts index bcf55125b4a8..1ac1cc4b784f 100644 --- a/opencti-platform/opencti-graphql/src/modules/threatActorIndividual/threatActorIndividual.ts +++ b/opencti-platform/opencti-graphql/src/modules/threatActorIndividual/threatActorIndividual.ts @@ -16,6 +16,8 @@ import { RELATION_HOSTS, RELATION_IMPERSONATES, RELATION_KNOWN_AS, + RELATION_REPORTS_TO, + RELATION_SUPPORTS, RELATION_LOCATED_AT, RELATION_NATIONAL_OF, RELATION_OWNS, @@ -271,6 +273,26 @@ const THREAT_ACTOR_INDIVIDUAL_DEFINITION: ModuleDefinition Date: Fri, 13 Sep 2024 10:57:42 -0400 Subject: [PATCH 2/3] [backend] updated hardcoded api tests to account for additional relationship types --- .../tests/01-unit/domain/filterKeysSchema-test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencti-platform/opencti-graphql/tests/01-unit/domain/filterKeysSchema-test.ts b/opencti-platform/opencti-graphql/tests/01-unit/domain/filterKeysSchema-test.ts index 571d7ee2f5d9..be9c2632e492 100644 --- a/opencti-platform/opencti-graphql/tests/01-unit/domain/filterKeysSchema-test.ts +++ b/opencti-platform/opencti-graphql/tests/01-unit/domain/filterKeysSchema-test.ts @@ -225,7 +225,7 @@ describe('Filter keys schema generation testing', async () => { // Stix Core Relationships filterDefinition = filterKeysSchema.get(ABSTRACT_STIX_CORE_RELATIONSHIP)?.get(RELATION_FROM_FILTER); - expect(filterDefinition?.subEntityTypes.length).toEqual(50); // 49 stix core relationship types + abstract type 'stix-core-relationships' + expect(filterDefinition?.subEntityTypes.length).toEqual(52); // 51 stix core relationship types + abstract type 'stix-core-relationships' // Stix Cyber Observables filterDefinition = filterKeysSchema.get(ABSTRACT_STIX_CYBER_OBSERVABLE)?.get('x_opencti_score'); // attribute existing for all the observables filterDefinition = filterKeysSchema.get(ABSTRACT_STIX_CYBER_OBSERVABLE)?.get(INPUT_LABELS); // ref existing for all the observables From c443bb1569a81efa575869e710e12308cb1bdc8a Mon Sep 17 00:00:00 2001 From: BocognanoSarah Date: Mon, 14 Oct 2024 16:11:20 +0200 Subject: [PATCH 3/3] [frontend] fix lint --- .../threat_actors_individual/ThreatActorIndividualKnowledge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx b/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx index 7114b1608adc..1288628e8a09 100644 --- a/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx +++ b/opencti-platform/opencti-front/src/private/components/threats/threat_actors_individual/ThreatActorIndividualKnowledge.tsx @@ -101,7 +101,7 @@ const ThreatActorIndividualKnowledgeComponent = ({ 'employed-by', 'reports-to', 'supports', - 'derived-from' + 'derived-from', ]} stixCoreObjectTypes={['Threat-Actor']} entityLink={link}