Merge remote-tracking branch 'origin/develop' into notes

notes
Sami Mokaddem 2024-02-16 15:29:03 +01:00
commit 6f99b148f0
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
6 changed files with 39 additions and 16 deletions

2
PyMISP

@ -1 +1 @@
Subproject commit 05beec393c5613c352dafdaeaf5dcf983bfb2d51
Subproject commit 492cfba2d2ad015d3fcda6e16c221fdefd93eca2

View File

@ -34,7 +34,7 @@ class AppController extends Controller
public $helpers = array('OrgImg', 'FontAwesome', 'UserName');
private $__queryVersion = '159';
public $pyMispVersion = '2.4.184';
public $pyMispVersion = '2.4.185';
public $phpmin = '7.2';
public $phprec = '7.4';
public $phptoonew = '8.0';

View File

@ -2403,11 +2403,15 @@ class Attribute extends AppModel
$timestamp[0] = $timestamp[1];
$timestamp[1] = $temp;
}
$conditions['AND'][] = array($scope . ' >=' => $timestamp[0]);
if ($timestamp[0] != 0) {
$conditions['AND'][] = array($scope . ' >=' => $timestamp[0]);
}
$conditions['AND'][] = array($scope . ' <=' => $timestamp[1]);
} else {
$timestamp = $this->resolveTimeDelta($timestamp);
$conditions['AND'][] = array($scope . ' >=' => $timestamp);
if ($timestamp !== 0) {
$conditions['AND'][] = array($scope . ' >=' => $timestamp);
}
}
if ($returnRaw) {
return $timestamp;

View File

@ -1102,8 +1102,12 @@ class Sighting extends AppModel
$conditions['Attribute.uuid'] = $filters['uuid'];
$contain[] = 'Attribute';
} elseif ($filters['context'] === 'event') {
$conditions['Event.uuid'] = $filters['uuid'];
$contain[] = 'Event';
$temp = $this->Event->find('column', [
'recursive' => -1,
'fields' => ['Event.id'],
'conditions' => ['Event.uuid IN' => $filters['uuid']]
]);
$conditions['Sighting.event_id'] = empty($temp) ? -1 : $temp;
}
}
@ -1131,15 +1135,30 @@ class Sighting extends AppModel
$tmpfile = new TmpFileTool();
$tmpfile->write($exportTool->header($exportToolParams));
$separator = $exportTool->separator($exportToolParams);
// fetch sightings matching the query without ACL checks
$sightingIds = $this->find('column', [
'conditions' => $conditions,
'fields' => ['Sighting.id'],
'contain' => $contain,
'order' => 'Sighting.id',
]);
if (!empty($conditions['Sighting.event_id']) && is_array($conditions['Sighting.event_id'])) {
$conditions_copy = $conditions;
$sightingIds = [];
foreach ($conditions['Sighting.event_id'] as $e_id) {
$conditions_copy['Sighting.event_id'] = $e_id;
$tempIds = $this->find('column', [
'conditions' => $conditions,
'fields' => ['Sighting.id'],
'contain' => $contain
]);
if (!empty($tempIds)) {
$sightingIds = array_merge($sightingIds, $tempIds);
}
}
} else {
$sightingIds = $this->find('column', [
'conditions' => $conditions,
'fields' => ['Sighting.id'],
'contain' => $contain
]);
}
foreach (array_chunk($sightingIds, 500) as $chunk) {
// fetch sightings with ACL checks and sighting policies
$sightings = $this->getSightings($user, $chunk, $includeEvent, $includeAttribute, $includeUuid);

View File

@ -10548,4 +10548,4 @@
}
},
"db_version": "122"
}
}

View File

@ -6,7 +6,7 @@ misp-lib-stix2>=3.0.1.1
mixbox>=1.0.5
plyara>=2.1.1
pydeep2>=0.5.1
pymisp==2.4.184
pymisp==2.4.185
python-magic>=0.4.27
pyzmq>=25.1.1
redis>=5.0.1