chg: [upload_stix] Visual improvement with descriptions added

- More information on the different options to
  handle galaxies and clusters while importing
  STIX 2 content
- More information on the debugging options
pull/9305/head
Christian Studer 2023-09-28 12:46:43 +02:00
parent d04e191e19
commit 35ea184c2d
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
3 changed files with 58 additions and 6 deletions

View File

@ -2501,6 +2501,16 @@ class EventsController extends AppController
foreach ($distributionLevels as $key => $value) {
$fieldDesc['distribution'][$key] = $this->Event->distributionDescriptions[$key]['formdesc'];
}
$debugOptions = $this->Event->debugOptions;
$this->set('debugOptions', $debugOptions);
foreach ($debugOptions as $key => $value) {
$fieldDesc['debug'][$key] = $this->Event->debugDescriptions[$key];
}
$galaxiesOptions = $this->Event->galaxiesOptions;
$this->set('galaxiesOptions', $galaxiesOptions);
foreach ($galaxiesOptions as $key => $value) {
$fieldDesc['galaxies_handling'][$key] = $this->Event->galaxiesOptionsDescriptions[$key];
}
$this->set('sharingGroups', $sgs);
$this->set('fieldDesc', $fieldDesc);
}

View File

@ -63,6 +63,11 @@ class Event extends AppModel
2 => array('desc' => '*Complete* means that the event\'s creation is complete', 'formdesc' => 'The event creator considers the analysis complete')
);
public $debugDescriptions = array(
0 => 'The critical errors are logged in the usual log file.',
1 => 'All the errors and warnings are logged in the usual log file.'
);
public $distributionDescriptions = [
self::DISTRIBUTION_ORGANISATION => [
'desc' => 'This field determines the current distribution of the event',
@ -86,6 +91,16 @@ class Event extends AppModel
],
];
public $galaxiesOptionsDescriptions = array(
0 => 'Galaxies and Clusters are passed as MISP standard format. New generic Galaxies and Clusters are created when there is no match with existing ones.',
1 => 'Galaxies are passed as tags and there is only a simple search with existing galaxy tag names.'
);
public $debugOptions = array(
0 => 'Standard debugging',
1 => 'Advanced debugging'
);
public $distributionLevels = [
self::DISTRIBUTION_ORGANISATION => 'Your organisation only',
self::DISTRIBUTION_COMMUNITY => 'This community only',
@ -94,6 +109,11 @@ class Event extends AppModel
self::DISTRIBUTION_SHARING_GROUP => 'Sharing group',
];
public $galaxiesOptions = array(
0 => 'As MISP standard format',
1 => 'As tag names'
);
public $analysisLevels = array(
0 => 'Initial', 1 => 'Ongoing', 2 => 'Completed'
);

View File

@ -52,17 +52,39 @@
'label' => __('Include the original imported file as attachment')
));
if ($me['Role']['perm_site_admin'] || $me['Role']['perm_galaxy_editor']) {
$galaxiesFormInfo = $this-> element(
'genericElements/Form/formInfo',
[
'field' => [
'field' => 'galaxies_handling'
],
'modelForForm' => 'Event',
'fieldDesc' => $fieldDesc['galaxies_handling']
]
);
echo '<div class="input clear"></div>';
echo $this->Form->input('galaxies_parsing', array(
'checked' => false,
'label' => __('Use Galaxies 2.0')
echo $this->Form->input('galaxies_handling', array(
'options' => array($galaxiesOptions),
'label' => __('How to handle Galaxies and Clusters') . $galaxiesFormInfo,
'selected' => 0
));
}
if ($me['Role']['perm_site_admin']) {
if ($me['Role']['perm_site_admin'] && Configure::read('debug') > 0) {
$debugFormInfo = $this->element(
'genericElements/Form/formInfo',
[
'field' => [
'field' => 'debug'
],
'modelForForm' => 'Event',
'fieldDesc' => $fieldDesc['debug'],
]
);
echo '<div class="input clear"></div>';
echo $this->Form->input('debug', array(
'checked' => true,
'label' => __('Advanced conversion debugging')
'options' => array($debugOptions),
'label' => __('Debugging option') . $debugFormInfo,
'selected' => 0
));
}
?>