Skip to content

Commit 514f7d2

Browse files
authored
[backend/frontend] add the relationship type "belongs to" between Organization and Infrastructure(#5376)
1 parent 9903d08 commit 514f7d2

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

opencti-platform/opencti-front/src/private/components/entities/organizations/OrganizationKnowledge.jsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,19 @@ const OrganizationKnowledgeComponent = ({
297297
/>
298298
)}
299299
/>
300+
<Route
301+
path="/infrastructures"
302+
element={(
303+
<EntityStixCoreRelationships
304+
key={location.pathname}
305+
entityId={organization.id}
306+
relationshipTypes={['belongs-to']}
307+
stixCoreObjectTypes={['Infrastructure']}
308+
entityLink={link}
309+
isRelationReversed={true}
310+
/>
311+
)}
312+
/>
300313
<Route index element={<Navigate replace={true} to="overview" />} />
301314
</Routes>
302315
</div>

opencti-platform/opencti-front/src/private/components/entities/organizations/Root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ const RootOrganization = ({ organizationId, queryRef }: RootOrganizationProps) =
164164
'attack_patterns',
165165
'tools',
166166
'vulnerabilities',
167+
'infrastructures',
167168
'observables',
168169
]}
169170
data={organization}

opencti-platform/opencti-front/src/private/components/observations/infrastructures/InfrastructureKnowledge.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const InfrastructureKnowledge = ({ infrastructure }: { infrastructure: Infrastru
5252
'tools',
5353
'vulnerabilities',
5454
'infrastructures',
55+
'organizations',
5556
'indicators',
5657
'observables',
5758
'observed_data',
@@ -343,6 +344,21 @@ const InfrastructureKnowledge = ({ infrastructure }: { infrastructure: Infrastru
343344
/>
344345
)}
345346
/>
347+
<Route
348+
path="/organizations"
349+
element={(
350+
<EntityStixCoreRelationships
351+
key={location.pathname}
352+
entityId={infrastructureData.id}
353+
relationshipTypes={['belongs-to']}
354+
stixCoreObjectTypes={['Organization']}
355+
entityLink={link}
356+
defaultStartTime={infrastructureData.first_seen}
357+
defaultStopTime={infrastructureData.last_seen}
358+
isRelationReversed={false}
359+
/>
360+
)}
361+
/>
346362
<Route index element={<Navigate replace={true} to="overview" />} />
347363
</Routes>
348364
</div>

opencti-platform/opencti-graphql/src/database/stix.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,9 @@ export const stixCoreRelationshipsMapping: RelationshipMappings = {
571571
{ name: RELATION_TECHNOLOGY_TO, type: REL_EXTENDED },
572572
{ name: RELATION_TECHNOLOGY_FROM, type: REL_EXTENDED },
573573
],
574+
[`${ENTITY_TYPE_INFRASTRUCTURE}_${ENTITY_TYPE_IDENTITY_ORGANIZATION}`]: [
575+
{ name: RELATION_BELONGS_TO, type: REL_EXTENDED },
576+
],
574577
[`${ENTITY_TYPE_INFRASTRUCTURE}_${ENTITY_TYPE_ATTACK_PATTERN}`]: [
575578
{ name: RELATION_DETECTS, type: REL_NEW },
576579
],

0 commit comments

Comments
 (0)