new: [Export] Added a secondary CSV export that includes more context to the UI download tool

pull/1994/merge
iglocska 2018-05-09 14:10:23 +02:00
parent fb4efa9d10
commit fefe92bde8
2 changed files with 13 additions and 2 deletions

View File

@ -2465,6 +2465,9 @@ class EventsController extends AppController {
$requested_attributes = array('uuid', 'event_id', 'category', 'type',
'value', 'comment', 'to_ids', 'timestamp');
$requested_obj_attributes = array('uuid', 'name', 'meta-category');
if ($includeContext) {
$requested_attributes[] = 'attribute_tag';
}
if (isset($this->params['url']['attributes'])) {
if (!isset($this->params['url']['obj_attributes'])) $requested_obj_attributes = array();
$requested_attributes = explode(',', $this->params['url']['attributes']);
@ -3978,6 +3981,14 @@ class EventsController extends AppController {
'checkbox_text' => 'Include non-IDS marked attributes',
'checkbox_set' => '/events/csv/download/' . $id . '/1'
),
'csv_with_context' => array(
'url' => '/events/csv/download/' . $id . '/0/0/0/0/1',
'text' => 'CSV with additional context',
'requiresPublished' => true,
'checkbox' => true,
'checkbox_text' => 'Include non-IDS marked attributes',
'checkbox_set' => '/events/csv/download/' . $id . '/1/0/0/0/1'
),
'stix_xml' => array(
'url' => '/events/stix/download/' . $id . '.xml',
'text' => 'STIX XML (metadata + all attributes)',

View File

@ -2009,9 +2009,9 @@ class Event extends AppModel {
$tags[] = $attributeTag['Tag']['name'];
}
}
$attribute['attribute_tag'] = implode(',', $tags);
$attribute['Attribute']['attribute_tag'] = implode(',', $tags);
}
$this->__escapeCSVField($attribute['attribute_tag']);
$this->__escapeCSVField($attribute['Attribute']['attribute_tag']);
if (!empty($attribute['Event']['EventTag'])) {
$tags = array();
foreach ($attribute['Event']['EventTag'] as $eventTag) {