mirror of https://github.com/MISP/MISP
fix: [stix 1&2 import] Fixed version attribute of the original filename
parent
9d0c6fa8fe
commit
dee614b4b8
|
@ -5071,11 +5071,13 @@ class Event extends AppModel
|
|||
$tempFilePath = APP . 'files/scripts/tmp/' . $filename;
|
||||
$shell_command = $this->getPythonVersion() . ' ' . $scriptFile . ' ' . $tempFilePath;
|
||||
$output_path = $tempFilePath . '.stix2';
|
||||
$stix_version = "STIX 2.0";
|
||||
} elseif ($stix_version == '1' || $stix_version == '1.1' || $stix_version == '1.2') {
|
||||
$scriptFile = APP . 'files/scripts/stix2misp.py';
|
||||
$tempFilePath = APP . 'files/scripts/tmp/' . $filename;
|
||||
$shell_command = $this->getPythonVersion() . ' ' . $scriptFile . ' ' . $filename;
|
||||
$output_path = $tempFilePath . '.json';
|
||||
$stix_version = "STIX 1.1";
|
||||
} else {
|
||||
throw new MethodNotAllowedException('Invalid STIX version');
|
||||
}
|
||||
|
@ -5091,7 +5093,7 @@ class Event extends AppModel
|
|||
$validationIssues = false;
|
||||
$result = $this->_add($data, true, $user, '', null, false, null, $created_id, $validationIssues);
|
||||
if ($result) {
|
||||
$this->add_original_file($tempFile, $original_file, $created_id, 'STIX 1.1');
|
||||
$this->add_original_file($tempFile, $original_file, $created_id, $stix_version);
|
||||
return $created_id;
|
||||
}
|
||||
return $validationIssues;
|
||||
|
@ -5685,7 +5687,7 @@ class Event extends AppModel
|
|||
'distribution' => $distribution,
|
||||
'object_id' => $object_id,
|
||||
'object_relation' => 'format',
|
||||
'value' => 'STIX 1.1'
|
||||
'value' => $format
|
||||
)
|
||||
);
|
||||
foreach ($attributes as $attribute) {
|
||||
|
|
Loading…
Reference in New Issue