mirror of https://github.com/MISP/MISP
Compare commits
9 Commits
41f10f24ba
...
8005eedbfc
Author | SHA1 | Date |
---|---|---|
JustKiddingCode | 8005eedbfc | |
iglocska | 14106b811a | |
iglocska | ee196c1349 | |
Konstantin Zangerle | 159512a174 | |
Konstantin Zangerle | 952b667db1 | |
Konstantin Zangerle | 2cd4e0b40b | |
Konstantin Zangerle | 42b8d35ee4 | |
Konstantin Zangerle | 882d57ff67 | |
Konstantin Zangerle | 7cb3ee6e3b |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -3763,7 +3763,7 @@ class EventsController extends AppController
|
|||
$result = $this->ShadowAttribute->find('column', [
|
||||
'fields' => ['event_id'],
|
||||
'conditions' => $conditions,
|
||||
'unique' => true,
|
||||
// 'unique' => true,
|
||||
]);
|
||||
$this->Event->recursive = -1;
|
||||
|
||||
|
@ -4160,7 +4160,13 @@ class EventsController extends AppController
|
|||
}
|
||||
}
|
||||
$this->Event->Attribute->fetchRelated($this->Auth->user(), $resultArray);
|
||||
$typeCategoryMapping = array();
|
||||
$typeCategoryMapping = [
|
||||
'ip-src/ip-dst' => [
|
||||
'Network activity' => 'Network activity',
|
||||
'Payload delivery' => 'Payload delivery',
|
||||
'External analysis' => 'External analysis'
|
||||
],
|
||||
];
|
||||
foreach ($this->Event->Attribute->categoryDefinitions as $k => $cat) {
|
||||
foreach ($cat['types'] as $type) {
|
||||
$typeCategoryMapping[$type][$k] = $k;
|
||||
|
|
|
@ -1987,8 +1987,12 @@ class ServersController extends AppController
|
|||
$updateProgress['update_fail_number_reached'] = $this->Server->UpdateFailNumberReached();
|
||||
$currentIndex = $updateProgress['current'];
|
||||
$currentCommand = !isset($updateProgress['commands'][$currentIndex]) ? '' : $updateProgress['commands'][$currentIndex];
|
||||
$lookupString = preg_replace('/\s{2,}/', '', substr($currentCommand, 0, -1));
|
||||
$sqlInfo = $this->Server->query("SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;");
|
||||
$lookupString = preg_replace('/\s{2,}/', '', substr($currentCommand, 0, -1));
|
||||
if (empty($this->Server->query("SELECT * FROM version() WHERE version LIKE 'PostgreS%';"))) {
|
||||
$sqlInfo = $this->Server->query("SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;");
|
||||
} else {
|
||||
$this->Server->query("SELECT * FROM pg_stat_activity WHERE datname = 'misp';");
|
||||
}
|
||||
if (empty($sqlInfo)) {
|
||||
$updateProgress['process_list'] = array();
|
||||
} else {
|
||||
|
|
|
@ -2603,6 +2603,7 @@ class UsersController extends AppController
|
|||
'org_name',
|
||||
'org_uuid',
|
||||
'message',
|
||||
'pgp',
|
||||
'custom_perms',
|
||||
'perm_sync',
|
||||
'perm_publish',
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1082,9 +1082,16 @@ class Correlation extends AppModel
|
|||
$this->CorrelationExclusion = ClassRegistry::init('CorrelationExclusion');
|
||||
$results['excluded_correlations'] = $this->CorrelationExclusion->find('count');
|
||||
foreach ($results['db'] as &$result) {
|
||||
foreach ($result['tables'] as $table_name => &$table_data) {
|
||||
$size_metrics = $this->query(sprintf('show table status like \'%s\';', $table_name));
|
||||
if (!empty($size_metrics)) {
|
||||
foreach ($result['tables'] as $table_name => &$table_data) {
|
||||
$row_count = 0;
|
||||
if ($this->isMysql()){
|
||||
$size_metrics = $this->query(sprintf('show table status like \'%s\';', $table_name));
|
||||
$row_count = (empty($size_metrics)) ? 0 : $size_metrics[0]['TABLES']['Rows'];
|
||||
} else {
|
||||
$size_metrics = $this->query(sprintf("select reltuples as estimate from pg_class where relname='%s';", $table_name));
|
||||
$row_count = (empty($size_metrics)) ? 0 : $size_metrics[0]['estimate'];
|
||||
}
|
||||
if ($row_count > 0) {
|
||||
$table_data['size_on_disk'] = $this->query(
|
||||
//'select FILE_SIZE from information_schema.innodb_sys_tablespaces where FILENAME like \'%/' . $table_name . '.ibd\';'
|
||||
sprintf(
|
||||
|
@ -1094,7 +1101,7 @@ class Correlation extends AppModel
|
|||
)
|
||||
)[0][0]['size'];
|
||||
$last_id = $this->query(sprintf('select max(id) as max_id from %s;', $table_name));
|
||||
$table_data['row_count'] = $size_metrics[0]['TABLES']['Rows'];
|
||||
$table_data['row_count'] = $row_count;
|
||||
$table_data['last_id'] = $last_id[0][0]['max_id'];
|
||||
$table_data['id_saturation'] = round(100 * $table_data['last_id'] / $table_data['id_limit'], 2);
|
||||
}
|
||||
|
|
|
@ -206,19 +206,19 @@ class EventTag extends AppModel
|
|||
}
|
||||
|
||||
public function getSortedTagList($context = false)
|
||||
{
|
||||
{
|
||||
$tag_counts = $this->find('all', array(
|
||||
'recursive' => -1,
|
||||
'fields' => array('tag_id', 'count(*)'),
|
||||
'group' => array('tag_id'),
|
||||
'fields' => array('tag_id', 'count(*) AS count'),
|
||||
'group' => array('Tag.id', 'Tag.name', 'EventTag.tag_id'),
|
||||
'contain' => array('Tag.name')
|
||||
));
|
||||
$temp = array();
|
||||
$tags = array();
|
||||
foreach ($tag_counts as $tag_count) {
|
||||
foreach ($tag_counts as $tag_count) {
|
||||
$temp[$tag_count['Tag']['name']] = array(
|
||||
'tag_id' => $tag_count['Tag']['id'],
|
||||
'eventCount' => $tag_count[0]['count(*)'],
|
||||
'eventCount' => $tag_count[0]['count'],
|
||||
'name' => $tag_count['Tag']['name'],
|
||||
);
|
||||
$tags[$tag_count['Tag']['name']] = $tag_count[0]['count(*)'];
|
||||
|
|
|
@ -26,7 +26,7 @@ class News extends AppModel
|
|||
public function latestNewsTimestamp()
|
||||
{
|
||||
$data = $this->find('first', [
|
||||
'order' => 'date_created DESC',
|
||||
'order' => 'News.date_created DESC',
|
||||
'fields' => ['date_created'],
|
||||
]);
|
||||
if (!$data) {
|
||||
|
|
|
@ -1714,7 +1714,7 @@ class User extends AppModel
|
|||
'ShadowAttribute.event_org_id' => $user['org_id'],
|
||||
'ShadowAttribute.deleted' => 0,
|
||||
),
|
||||
'fields' => 'distinct event_id'
|
||||
'fields' => 'DISTINCT event_id'
|
||||
]);
|
||||
return $results;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue