OpenCTI-Platform / opencti

Open Cyber Threat Intelligence Platform
https://opencti.io
Other
5.17k stars 819 forks source link

Created field not present but required for CSV Mapper #7226

Open 3d6564 opened 1 month ago

3d6564 commented 1 month ago

Description

Any of the Cases items that have the MANDATORY field 'created' fail because the field does not show up in the CSV Mapper and does not automatically pull the field, even if it is present in the file.

Environment

  1. OS (where OpenCTI server runs): container
  2. OpenCTI version: <6.1.8
  3. OpenCTI client: frontend
  4. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. generate a CSV from outside source of RFIs, Incident Responses, etc
  2. Create a basic CSV Map for any of those items and attempt to test, receive message about 'created' attribute missing.

Expected Output

Ingest those entity types

Actual Output

image

Additional information

`{ "category":"APP", "errors":[ { "attributes":{ "attribute":"created", "genre":"BUSINESS", "http_status":400, "representation":"#1 Case-Rfi" }, "message":"Missing values for required attribute", "name":"FUNCTIONAL_ERROR", "stack":"FUNCTIONAL_ERROR: Missing values for required attribute\n at error (/opt/opencti/build/src/config/errors.js:8:10)\n at FunctionalError (/opt/opencti/build/src/config/errors.js:95:50)\n at /opt/opencti/build/src/modules/internal/csvMapper/csvMapper-utils.ts:165:17\n at Array.forEach ()\n at /opt/opencti/build/src/modules/internal/csvMapper/csvMapper-utils.ts:159:8\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Promise.all (index 0)\n at validateCsvMapper (/opt/opencti/build/src/modules/internal/csvMapper/csvMapper-utils.ts:137:3)\n at bundleProcess (/opt/opencti/build/src/parser/csv-bundler.ts:32:3)\n at csvMapperTest (/opt/opencti/build/src/modules/internal/csvMapper/csvMapper-domain.ts:31:18)" } ], "inner_relation_creation":0, "level":"error", "message":"Missing values for required attribute", "operation":"Unspecified", "query_attributes":[ [ { "arguments":[ [ { "is_empty":true, "name":"configuration", "type":"Variable" } ], [ { "is_empty":true, "name":"content", "type":"Variable" } ] ], "name":"csvMapperTest" } ] ], "size":484, "source":"backend", "time":3, "timestamp":"2024-06-04T14:19:25.888Z", "type":"READ_ERROR", "user":{ "group_ids":[ "668ad6ec-ff03-450f-889f-656371d42deb" ], "ip":"::ffff:172.19.0.1", "organization_ids":[

  ],
  "referer":"http://localhost:8080/dashboard/data/processing/csv_mapper",
  "socket":"query",
  "user_id":"88ec0c6a-13ce-5e39-b486-354fe4a7084f",
  "user_metadata":{

  }

}, "version":"6.1.8" }`

Screenshots (optional)

nino-filigran commented 1 month ago

The create date represents for: