2011-11-26 10:45:31 +01:00
<div class="events view">
<div class="actions" style="float:right;">
2012-03-27 14:49:31 +02:00
<?php if ( 0 == $event['Event']['published'] && ($isAdmin || $event['Event']['org'] == $me['org'])):
2012-03-25 16:25:16 +02:00
// only show button if alert has not been sent // LATER show the ALERT button in red-ish
2011-11-26 10:45:31 +01:00
?>
2012-03-25 16:25:16 +02:00
<ul><li><?php
2012-06-26 09:40:52 +02:00
echo $this->Form->postLink('Publish Event', array('action' => 'alert', $event['Event']['id']), null, 'Are you sure this event is complete and everyone should be informed?');
echo $this->Form->postLink('Publish (no email)', array('action' => 'publish', $event['Event']['id']), null, 'Publish but do NOT send alert email? Only for minor changes!');
2012-03-15 15:06:45 +01:00
?> </li></ul>
2012-03-27 14:49:31 +02:00
<?php elseif (0 == $event['Event']['published']): ?>
2012-03-21 11:01:37 +01:00
<ul><li>Not published</li></ul>
2011-11-26 10:45:31 +01:00
<?php else: ?>
<!-- ul><li>Alert already sent</li></ul -->
<?php endif; ?>
2011-12-17 10:27:45 +01:00
<ul><li><?php echo $this->Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?> </li></ul>
2011-11-26 10:45:31 +01:00
</div>
2012-08-31 10:23:40 +02:00
<?php if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
<?php echo $this->Html->image('orgs/'.h($event['Event']['org']).'.png', array('alt' => h($event['Event']['org']),'width'=>'50','hight'=>'50', 'style' => 'float:right;')); ?>
<?php endif; ?>
2012-03-15 15:06:45 +01:00
<h2>Event</h2>
<dl>
<dt>ID</dt>
<dd>
2012-06-05 10:00:36 +02:00
<?php echo h($event['Event']['id']); ?>
2012-01-05 11:03:51 +01:00
</dd>
2012-03-06 07:45:02 +01:00
<?php if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
2012-03-15 15:06:45 +01:00
<dt>Org</dt>
<dd>
2012-06-05 10:00:36 +02:00
<?php echo h($event['Event']['org']); ?>
2011-11-26 10:45:31 +01:00
</dd>
2012-08-31 10:23:40 +02:00
<?php endif; ?>
<?php if ('true' == Configure::read('CyDefSIG.showowner') || $isAdmin): ?>
2012-07-19 14:53:12 +02:00
<dt>Email</dt>
<dd>
<?php echo h($event['User']['email']); ?>
</dd>
2012-01-17 10:43:31 +01:00
<?php endif; ?>
2012-03-15 15:06:45 +01:00
<dt>Date</dt>
<dd>
2012-06-05 10:00:36 +02:00
<?php echo h($event['Event']['date']); ?>
2011-11-26 10:45:31 +01:00
</dd>
2012-05-29 16:53:50 +02:00
<dt<?php echo ' title="' . $event_descriptions['risk']['desc'] . '"';?>>Risk</dt>
2012-03-15 15:06:45 +01:00
<dd>
2011-11-26 10:45:31 +01:00
<?php echo $event['Event']['risk']; ?>
</dd>
2012-04-01 18:41:47 +02:00
<?php if ('true' == Configure::read('CyDefSIG.sync')): ?>
<dt>Private</dt>
<dd>
<?php echo ($event['Event']['private'])? 'Yes, never upload Event or any Attributes.' : 'No, upload Event and all Attributes except those marked as Private.'; ?>
</dd>
<?php endif; ?>
2012-03-20 13:40:58 +01:00
<!-- dt>UUID</dt>
<dd>
<?php echo $event['Event']['uuid']; ?>
</dd -->
2012-03-15 15:06:45 +01:00
<dt>Info</dt>
<dd>
2012-06-05 10:00:36 +02:00
<?php echo nl2br(h($event['Event']['info'])); ?>
2011-11-26 10:45:31 +01:00
</dd>
</dl>
2011-11-27 15:32:11 +01:00
<?php if (!empty($relatedEvents)):?>
2011-11-27 14:58:54 +01:00
<div class="related">
2012-03-15 15:06:45 +01:00
<h3>Related Events</h3>
2011-11-27 14:58:54 +01:00
<ul>
<?php foreach ($relatedEvents as $relatedEvent): ?>
2012-03-25 16:25:16 +02:00
<li><?php
2012-09-04 16:14:10 +02:00
$link_text = $relatedEvent['Event']['date'].' ('.$relatedEvent['Event']['id'].')';
echo $this->Html->link($link_text, array('controller' => 'events', 'action' => 'view', $relatedEvent['Event']['id']));
2012-02-20 19:46:37 +01:00
?></li>
2011-11-27 14:58:54 +01:00
<?php endforeach; ?>
2012-03-25 16:25:16 +02:00
</ul>
2011-11-27 14:58:54 +01:00
</div>
2011-11-27 15:32:11 +01:00
<?php endif; ?>
2012-03-25 16:25:16 +02:00
2011-11-26 10:45:31 +01:00
<div class="related">
2012-03-21 21:25:16 +01:00
<h3>Attributes</h3>
2012-03-26 19:56:44 +02:00
<?php if (!empty($event['Attribute'])):?>
2011-11-26 10:45:31 +01:00
<table cellpadding = "0" cellspacing = "0">
<tr>
2012-03-23 20:04:22 +01:00
<th>Category</th>
2012-01-05 13:54:09 +01:00
<th>Type</th>
<th>Value</th>
2011-11-27 14:58:54 +01:00
<th>Related Events</th>
2012-05-29 16:53:50 +02:00
<th <?php echo "title='" . $attr_descriptions['signature']['desc'] . "'";?>>IDS Signature</th>
2012-04-01 18:41:47 +02:00
<?php if ('true' == Configure::read('CyDefSIG.sync')): ?>
2012-05-29 16:53:50 +02:00
<th <?php echo "title='" . $attr_descriptions['private']['desc'] . "'";?>>Private</th>
2012-04-01 18:41:47 +02:00
<?php endif;?>
2012-06-05 10:00:36 +02:00
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
2012-03-20 15:11:02 +01:00
<th class="actions">Actions</th>
2012-04-01 18:41:47 +02:00
<?php endif;?>
2011-11-26 10:45:31 +01:00
</tr>
<?php
2012-04-04 17:53:51 +02:00
foreach ($categories as $category):
$first = 1;
2012-03-26 19:56:44 +02:00
foreach ($event['Attribute'] as $attribute):
2012-04-04 17:53:51 +02:00
if($attribute['category'] != $category) continue;
2011-11-26 10:45:31 +01:00
?>
2012-03-15 15:06:45 +01:00
<tr>
2012-05-29 16:53:50 +02:00
<td class="short" title="<?php if('' != $attribute['category']) echo $category_definitions[$attribute['category']]['desc'];?>"><?php
2012-04-04 17:53:51 +02:00
if ($first) {
if ('' == $attribute['category']) echo '(no category)';
echo $attribute['category'];
2012-03-23 20:04:22 +01:00
} else {
2012-04-04 17:53:51 +02:00
echo ' ';
2012-03-25 16:25:16 +02:00
}
2012-03-23 20:04:22 +01:00
?></td>
2012-05-29 16:53:50 +02:00
<td class="short" title="<?php echo $type_definitions[$attribute['type']]['desc'];?>"><?php echo $attribute['type'];?></td>
2012-03-25 16:25:16 +02:00
<td><?php
2012-06-05 10:00:36 +02:00
$sig_display = nl2br(h($attribute['value']));
2012-05-21 13:41:04 +02:00
if('attachment' == $attribute['type'] ||
'malware-sample' == $attribute['type'] ) {
2012-06-05 10:00:36 +02:00
$filename_hash = explode('|', h($attribute['value']));
2012-05-21 13:41:04 +02:00
echo $this->Html->link($filename_hash[0], array('controller' => 'attributes', 'action' => 'download', $attribute['id']));
if (isset($filename_hash[1])) echo ' | '.$filename_hash[1];
} elseif (strpos($attribute['type'], '|') !== false) {
2012-06-05 10:00:36 +02:00
$filename_hash = explode('|', h($attribute['value']));
2012-05-21 13:41:04 +02:00
echo $filename_hash[0];
if (isset($filename_hash[1])) echo ' | '.$filename_hash[1];
2012-03-31 21:55:09 +02:00
} elseif ('vulnerability' == $attribute['type']) {
echo $this->Html->link($sig_display, 'http://www.google.com/search?q='.$sig_display, array('target'=> '_blank'));
2012-07-04 15:51:19 +02:00
} elseif ('link' == $attribute['type']) {
echo $this->Html->link($sig_display, $sig_display);
2012-03-31 21:55:09 +02:00
} else {
echo $sig_display;
2012-03-23 20:04:22 +01:00
}
2012-04-04 17:53:51 +02:00
?></td>
2012-03-20 15:11:02 +01:00
<td class="short" style="text-align: center;">
2012-02-20 19:46:37 +01:00
<?php
2012-04-02 11:53:44 +02:00
$first = 0;
2012-08-03 12:00:16 +02:00
if (isset($relatedAttributes[$attribute['id']]) && (null != $relatedAttributes[$attribute['id']])) {
2012-03-26 19:56:44 +02:00
foreach ($relatedAttributes[$attribute['id']] as $relatedAttribute) {
2012-09-04 16:14:10 +02:00
echo $this->Html->link($relatedAttribute['Attribute']['event_id'], array('controller' => 'events', 'action' => 'view', $relatedAttribute['Attribute']['event_id']));
2012-03-25 16:25:16 +02:00
echo ' ';
2012-02-20 19:46:37 +01:00
}
}
2012-04-25 10:30:23 +02:00
?>
2012-02-20 19:46:37 +01:00
</td>
2012-03-26 19:56:44 +02:00
<td class="short" style="text-align: center;"><?php echo $attribute['to_ids'] ? 'Yes' : 'No';?></td>
2012-04-01 18:41:47 +02:00
<?php if ('true' == Configure::read('CyDefSIG.sync')): ?>
2012-04-25 10:30:23 +02:00
<td class="short" style="text-align: center;"><?php echo $attribute['private'] ? 'Private' : ' ';?></td>
2012-04-01 18:41:47 +02:00
<?php endif;?>
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
2012-03-20 15:11:02 +01:00
<td class="actions">
2011-11-26 10:45:31 +01:00
<?php
2012-06-26 09:40:52 +02:00
echo $this->Html->link(__('Edit', true), array('controller' => 'attributes', 'action' => 'edit', $attribute['id']));
echo $this->Form->postLink(__('Delete'), array('controller' => 'attributes', 'action' => 'delete', $attribute['id']), null, __('Are you sure you want to delete this attribute?'));
2012-04-01 18:41:47 +02:00
?>
2011-11-26 10:45:31 +01:00
</td>
2012-04-01 18:41:47 +02:00
<?php endif;?>
2011-11-26 10:45:31 +01:00
</tr>
<?php endforeach; ?>
2012-04-02 11:53:44 +02:00
<?php endforeach; ?>
2011-11-26 10:45:31 +01:00
</table>
<?php endif; ?>
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
<div class="actions">
<ul>
2012-06-26 09:40:52 +02:00
<li><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?> </li>
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?> </li>
2011-11-26 10:45:31 +01:00
</ul>
</div>
<?php endif; ?>
</div>
</div>
<div class="actions">
<ul>
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
2012-06-26 09:40:52 +02:00
<li><?php echo $this->Html->link(__('Add Attribute', true), array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?> </li>
<li><?php echo $this->Html->link(__('Add Attachment', true), array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?> </li>
<li><?php echo $this->Html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Event'), array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?></li>
2011-11-26 10:45:31 +01:00
<li> </li>
<?php endif; ?>
<?php echo $this->element('actions_menu'); ?>
</ul>
</div>