Projects STRLCPY opencti Commits 19d842fd
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/data/entities/EntitiesStixDomainObjectLine.js
    skipped 200 lines
    201 201   description
    202 202   x_opencti_aliases
    203 203   }
     204 + ... on DataComponent {
     205 + name
     206 + aliases
     207 + description
     208 + }
    204 209   ... on Individual {
    205 210   name
    206 211   description
    skipped 239 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/private/components/data/entities/EntitiesStixDomainObjectsLines.js
    skipped 144 lines
    145 145   description
    146 146   x_opencti_aliases
    147 147   }
     148 + ... on DataComponent {
     149 + name
     150 + aliases
     151 + description
     152 + }
    148 153   ... on Individual {
    149 154   name
    150 155   description
    skipped 183 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-front/src/schema/relay.schema.graphql
    skipped 8574 lines
    8575 8575   workflowEnabled: Boolean
    8576 8576   name: String!
    8577 8577   description: String
    8578  - dataComponent_types: [String]
    8579 8578   aliases: [String]
    8580  - parentDataComponents: DataComponentConnection
    8581  - subDataComponents: DataComponentConnection
    8582  - isSubDataComponents: Boolean
    8583 8579   dataSource: DataSource
    8584 8580  }
    8585 8581   
    skipped 46 lines
    8632 8628   createdBy: String
    8633 8629   objectMarking: [String]
    8634 8630   objectLabel: [String]
     8631 + objectOrganization: [String]
    8635 8632   externalReferences: [String]
    8636 8633   created: DateTime
    8637 8634   modified: DateTime
    skipped 99 lines
    8737 8734   createdBy: String
    8738 8735   objectMarking: [String]
    8739 8736   objectLabel: [String]
     8737 + objectOrganization: [String]
    8740 8738   externalReferences: [String]
    8741 8739   created: DateTime
    8742 8740   modified: DateTime
    skipped 8 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/generated/graphql.ts
    skipped 2584 lines
    2585 2585   createdBy?: Maybe<Identity>;
    2586 2586   created_at: Scalars['DateTime'];
    2587 2587   creator?: Maybe<User>;
    2588  - dataComponent_types?: Maybe<Array<Maybe<Scalars['String']>>>;
    2589 2588   dataSource?: Maybe<DataSource>;
    2590 2589   description?: Maybe<Scalars['String']>;
    2591 2590   editContext?: Maybe<Array<Maybe<EditUserContext>>>;
    skipped 3 lines
    2595 2594   groupings?: Maybe<GroupingConnection>;
    2596 2595   id: Scalars['ID'];
    2597 2596   importFiles?: Maybe<FileConnection>;
    2598  - isSubDataComponents?: Maybe<Scalars['Boolean']>;
    2599 2597   is_inferred: Scalars['Boolean'];
    2600 2598   jobs?: Maybe<Array<Maybe<Work>>>;
    2601 2599   lang?: Maybe<Scalars['String']>;
    skipped 5 lines
    2607 2605   objectOrganization?: Maybe<OrganizationConnection>;
    2608 2606   observedData?: Maybe<ObservedDataConnection>;
    2609 2607   opinions?: Maybe<OpinionConnection>;
    2610  - parentDataComponents?: Maybe<DataComponentConnection>;
    2611 2608   parent_types: Array<Maybe<Scalars['String']>>;
    2612 2609   pendingFiles?: Maybe<FileConnection>;
    2613 2610   reports?: Maybe<ReportConnection>;
    skipped 2 lines
    2616 2613   standard_id: Scalars['String'];
    2617 2614   status?: Maybe<Status>;
    2618 2615   stixCoreRelationships?: Maybe<StixCoreRelationshipConnection>;
    2619  - subDataComponents?: Maybe<DataComponentConnection>;
    2620 2616   toStix?: Maybe<Scalars['String']>;
    2621 2617   updated_at: Scalars['DateTime'];
    2622 2618   workflowEnabled?: Maybe<Scalars['Boolean']>;
    skipped 96 lines
    2719 2715   name: Scalars['String'];
    2720 2716   objectLabel?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
    2721 2717   objectMarking?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
     2718 + objectOrganization?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
    2722 2719   revoked?: InputMaybe<Scalars['Boolean']>;
    2723 2720   stix_id?: InputMaybe<Scalars['StixId']>;
    2724 2721   update?: InputMaybe<Scalars['Boolean']>;
    skipped 182 lines
    2907 2904   name: Scalars['String'];
    2908 2905   objectLabel?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
    2909 2906   objectMarking?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
     2907 + objectOrganization?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
    2910 2908   revoked?: InputMaybe<Scalars['Boolean']>;
    2911 2909   stix_id?: InputMaybe<Scalars['StixId']>;
    2912 2910   update?: InputMaybe<Scalars['Boolean']>;
    skipped 18652 lines
    21565 21563   createdBy?: Resolver<Maybe<ResolversTypes['Identity']>, ParentType, ContextType>;
    21566 21564   created_at?: Resolver<ResolversTypes['DateTime'], ParentType, ContextType>;
    21567 21565   creator?: Resolver<Maybe<ResolversTypes['User']>, ParentType, ContextType>;
    21568  - dataComponent_types?: Resolver<Maybe<Array<Maybe<ResolversTypes['String']>>>, ParentType, ContextType>;
    21569 21566   dataSource?: Resolver<Maybe<ResolversTypes['DataSource']>, ParentType, ContextType>;
    21570 21567   description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
    21571 21568   editContext?: Resolver<Maybe<Array<Maybe<ResolversTypes['EditUserContext']>>>, ParentType, ContextType>;
    skipped 3 lines
    21575 21572   groupings?: Resolver<Maybe<ResolversTypes['GroupingConnection']>, ParentType, ContextType, Partial<DataComponentGroupingsArgs>>;
    21576 21573   id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
    21577 21574   importFiles?: Resolver<Maybe<ResolversTypes['FileConnection']>, ParentType, ContextType, Partial<DataComponentImportFilesArgs>>;
    21578  - isSubDataComponents?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
    21579 21575   is_inferred?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
    21580 21576   jobs?: Resolver<Maybe<Array<Maybe<ResolversTypes['Work']>>>, ParentType, ContextType, Partial<DataComponentJobsArgs>>;
    21581 21577   lang?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
    skipped 5 lines
    21587 21583   objectOrganization?: Resolver<Maybe<ResolversTypes['OrganizationConnection']>, ParentType, ContextType>;
    21588 21584   observedData?: Resolver<Maybe<ResolversTypes['ObservedDataConnection']>, ParentType, ContextType, Partial<DataComponentObservedDataArgs>>;
    21589 21585   opinions?: Resolver<Maybe<ResolversTypes['OpinionConnection']>, ParentType, ContextType, Partial<DataComponentOpinionsArgs>>;
    21590  - parentDataComponents?: Resolver<Maybe<ResolversTypes['DataComponentConnection']>, ParentType, ContextType>;
    21591 21586   parent_types?: Resolver<Array<Maybe<ResolversTypes['String']>>, ParentType, ContextType>;
    21592 21587   pendingFiles?: Resolver<Maybe<ResolversTypes['FileConnection']>, ParentType, ContextType, Partial<DataComponentPendingFilesArgs>>;
    21593 21588   reports?: Resolver<Maybe<ResolversTypes['ReportConnection']>, ParentType, ContextType, Partial<DataComponentReportsArgs>>;
    skipped 2 lines
    21596 21591   standard_id?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
    21597 21592   status?: Resolver<Maybe<ResolversTypes['Status']>, ParentType, ContextType>;
    21598 21593   stixCoreRelationships?: Resolver<Maybe<ResolversTypes['StixCoreRelationshipConnection']>, ParentType, ContextType, Partial<DataComponentStixCoreRelationshipsArgs>>;
    21599  - subDataComponents?: Resolver<Maybe<ResolversTypes['DataComponentConnection']>, ParentType, ContextType>;
    21600 21594   toStix?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
    21601 21595   updated_at?: Resolver<ResolversTypes['DateTime'], ParentType, ContextType>;
    21602 21596   workflowEnabled?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
    skipped 5303 lines
  • ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/graphql/schema.js
    skipped 79 lines
    80 80   throw new UserInputError('Provided value is not a valid STIX ID');
    81 81   }
    82 82   const [type, uuid] = stixId.split('--');
    83  - if (!isSupportedStixType(type)) {
     83 + if (!isSupportedStixType(type.replace('x-mitre-', ''))) {
    84 84   throw new UserInputError('Provided value is not a valid STIX ID (type not supported)');
    85 85   }
    86 86   if (!uuidValidate(uuid)) {
    skipped 159 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/channel/channel.graphql
    skipped 2 lines
    3 3   standard_id: String!
    4 4   entity_type: String!
    5 5   parent_types: [String]!
    6  - # StixObject
     6 + 
     7 + # Stix Object
    7 8   x_opencti_stix_ids: [StixId]
    8 9   is_inferred: Boolean!
    9 10   spec_version: String!
    skipped 153 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent-converter.ts
    1  -import { buildStixDomain, cleanObject } from '../../database/stix-converter';
     1 +import { buildStixDomain } from '../../database/stix-converter';
    2 2  import type { StixDataComponent, StoreEntityDataComponent } from './dataComponent-types';
    3  -import { STIX_EXT_OCTI } from '../../types/stix-extensions';
     3 +import { STIX_EXT_MITRE, STIX_EXT_OCTI } from '../../types/stix-extensions';
     4 +import type { StixMitreExtension } from '../../types/stix-common';
    4 5   
    5 6  const convertDataComponentToStix = (instance: StoreEntityDataComponent): StixDataComponent => {
    6 7   const stixDomainObject = buildStixDomain(instance);
    skipped 3 lines
    10 11   description: instance.description,
    11 12   aliases: instance.aliases,
    12 13   extensions: {
    13  - [STIX_EXT_OCTI]: cleanObject({
    14  - ...stixDomainObject.extensions[STIX_EXT_OCTI],
     14 + [STIX_EXT_OCTI]: stixDomainObject.extensions[STIX_EXT_OCTI],
     15 + [STIX_EXT_MITRE]: {
    15 16   extension_type: 'new-sdo'
    16  - })
     17 + } as StixMitreExtension
    17 18   }
    18 19   };
    19 20  };
    skipped 3 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent-types.ts
    1  -import type { StixDomainObject } from '../../types/stix-common';
     1 +import type { StixDomainObject, StixMitreExtension, StixOpenctiExtension } from '../../types/stix-common';
    2 2  import type { BasicStoreEntity, StoreEntity } from '../../types/store';
     3 +import { STIX_EXT_MITRE, STIX_EXT_OCTI } from '../../types/stix-extensions';
    3 4   
    4 5  export const ENTITY_TYPE_DATA_COMPONENT = 'Data-Component';
    5 6   
    skipped 11 lines
    17 18   name: string;
    18 19   description: string;
    19 20   aliases: Array<string>;
     21 + extensions: {
     22 + [STIX_EXT_OCTI]: StixOpenctiExtension
     23 + [STIX_EXT_MITRE]: StixMitreExtension;
     24 + };
    20 25  }
    21 26   
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/dataComponent/dataComponent.graphql
    skipped 71 lines
    72 72   # DataComponents
    73 73   name: String!
    74 74   description: String
    75  -# TODO: why ?
    76  - dataComponent_types: [String]
    77 75   aliases: [String]
    78  -# TODO: why ?
    79  - parentDataComponents: DataComponentConnection
    80  - subDataComponents: DataComponentConnection
    81  - isSubDataComponents: Boolean
    82  - 
    83 76   dataSource: DataSource
    84 77  }
    85 78   
    skipped 64 lines
    150 143   createdBy: String
    151 144   objectMarking: [String]
    152 145   objectLabel: [String]
     146 + objectOrganization: [String]
    153 147   externalReferences: [String]
    154 148   created: DateTime
    155 149   modified: DateTime
    skipped 19 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/dataSource/dataSource-converter.ts
    1 1  import type { StixDataSource, StoreEntityDataSource } from './dataSource-types';
    2  -import { buildMITREExtensions, buildStixDomain, cleanObject } from '../../database/stix-converter';
     2 +import { buildStixDomain } from '../../database/stix-converter';
    3 3  import { STIX_EXT_MITRE, STIX_EXT_OCTI } from '../../types/stix-extensions';
     4 +import type { StixMitreExtension } from '../../types/stix-common';
    4 5   
    5 6  const convertDataSourceToStix = (instance: StoreEntityDataSource): StixDataSource => {
    6 7   const stixDomainObject = buildStixDomain(instance);
    skipped 3 lines
    10 11   description: instance.description,
    11 12   aliases: instance.aliases,
    12 13   extensions: {
    13  - [STIX_EXT_OCTI]: cleanObject({
    14  - ...stixDomainObject.extensions[STIX_EXT_OCTI],
    15  - extension_type: 'new-sdo',
    16  - }),
    17  - [STIX_EXT_MITRE]: buildMITREExtensions(instance)
     14 + [STIX_EXT_OCTI]: stixDomainObject.extensions[STIX_EXT_OCTI],
     15 + [STIX_EXT_MITRE]: {
     16 + extension_type: 'new-sdo'
     17 + } as StixMitreExtension
    18 18   }
    19 19   };
    20 20  };
    skipped 3 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/modules/dataSource/dataSource.graphql
    skipped 141 lines
    142 142   createdBy: String
    143 143   objectMarking: [String]
    144 144   objectLabel: [String]
     145 + objectOrganization: [String]
    145 146   externalReferences: [String]
    146 147   created: DateTime
    147 148   modified: DateTime
    skipped 20 lines
  • ■ ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/schema/identifier.js
    skipped 58 lines
    59 59  export const X_MITRE_ID_FIELD = 'x_mitre_id';
    60 60  export const X_DETECTION = 'x_opencti_detection';
    61 61  export const X_WORKFLOW_ID = 'x_opencti_workflow_id';
     62 +export const DATA_SOURCE_ID = 'data_source';
    62 63  // endregion
    63 64   
    64 65  export const normalizeName = (name) => {
    skipped 27 lines
    92 93   [C.ENTITY_EMAIL_ADDR]: [{ src: 'value' }], // value
    93 94   [C.ENTITY_EMAIL_MESSAGE]: [{ src: 'from', dest: 'from_ref' }, { src: 'subject' }, { src: 'body' }], // from_ref, subject, body
    94 95   [C.ENTITY_HASHED_OBSERVABLE_ARTIFACT]: [[{ src: 'hashes' }], [{ src: 'url' }]], // hashes, (!) payload_bin > Cause of volume
    95  - [C.ENTITY_HASHED_OBSERVABLE_STIX_FILE]: [[{ src: 'hashes' }], [{ src: 'name' }]], // hashes, name, (!) extensions, parent_directory_ref
     96 + [C.ENTITY_HASHED_OBSERVABLE_STIX_FILE]: [[{ src: 'hashes' }], [{ src: NAME_FIELD }]], // hashes, name, (!) extensions, parent_directory_ref
    96 97   [C.ENTITY_HASHED_OBSERVABLE_X509_CERTIFICATE]: [[{ src: 'hashes' }], [{ src: 'serial_number' }], [{ src: 'subject' }]], // hashes, serial_number
    97 98   [C.ENTITY_IPV4_ADDR]: [{ src: 'value' }], // value
    98 99   [C.ENTITY_IPV6_ADDR]: [{ src: 'value' }], // value
    skipped 52 lines
    151 152   },
    152 153   },
    153 154  };
    154  -const stixBaseEntityContribution = {
     155 +const stixBaseEntityContribution = { // Use definition
    155 156   definition: {
    156 157   // Internal
    157 158   [I.ENTITY_TYPE_SETTINGS]: () => OPENCTI_PLATFORM_UUID,
    skipped 42 lines
    200 201   [D.ENTITY_TYPE_TOOL]: [{ src: NAME_FIELD }],
    201 202   [D.ENTITY_TYPE_VULNERABILITY]: [{ src: NAME_FIELD }],
    202 203   [D.ENTITY_TYPE_INCIDENT]: [{ src: NAME_FIELD }],
     204 + [D.ENTITY_TYPE_DATA_COMPONENT]: [[{ src: NAME_FIELD }]], // TODO: ask Samuel, quel clé veut-on pour la génération de l'ID -> [{ src: DATA_SOURCE_ID }],
    203 205   // Stix Meta
    204 206   [M.ENTITY_TYPE_MARKING_DEFINITION]: [{ src: 'definition', dependencies: ['definition_type'] }, { src: 'definition_type' }],
    205 207   [M.ENTITY_TYPE_LABEL]: [{ src: 'value' }],
    skipped 291 lines
  • ■ ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/schema/stixDomainObject.ts
    skipped 51 lines
    52 52  export const ENTITY_TYPE_TOOL = 'Tool';
    53 53  export const ENTITY_TYPE_VULNERABILITY = 'Vulnerability';
    54 54  export const ENTITY_TYPE_INCIDENT = 'Incident';
     55 +export const ENTITY_TYPE_DATA_COMPONENT = 'Data-Component';
    55 56   
    56 57  const STIX_DOMAIN_OBJECT_CONTAINERS: Array<string> = [
    57 58   ENTITY_TYPE_CONTAINER_NOTE,
    skipped 894 lines
  • ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/types/module.ts
    skipped 54 lines
    55 55   name: string;
    56 56   targets: Array<RelationDefinition>;
    57 57   }>;
    58  - relationsRefs: Array<{
     58 + relationsRefs?: Array<{
    59 59   input: string;
    60 60   relation: string;
    61 61   checker: (fromType: string, toType: string) => boolean;
    skipped 61 lines
  • ■ ■ ■ ■
    opencti-platform/opencti-graphql/src/types/stix-common.d.ts
    skipped 15 lines
    16 16  }
    17 17   
    18 18  interface StixMitreExtension {
    19  - 'extension_type': 'property-extension',
     19 + 'extension_type': 'property-extension' | 'new-sdo',
    20 20   id: string;
    21 21   detection: string;
    22 22   permissions_required: Array<string>;
    skipped 132 lines
Please wait...
Page is in error, reload to recover