PyMISP icon indicating copy to clipboard operation
PyMISP copied to clipboard

List of all warninglists returned is limited to 60

Open cudeso opened this issue 1 year ago • 3 comments

When requesting all warninglists to be returned (yes, this can consume a lot of memory), the list is capped at 60 warninglists (limit of the index page?).

warninglists = misp.warninglists(pythonify=True)
print(len(warninglists))

return 60

cudeso avatar Jul 25 '22 18:07 cudeso

This is very weird, @iglocska, do you know why MISP does that? I have no specific config on PyMISP side.

Rafiot avatar Jul 25 '22 19:07 Rafiot

@iglocska this is what's requested r = self._prepare_request('GET', 'warninglists/index')

cudeso avatar Jul 25 '22 19:07 cudeso

I am in the same situation. (MISP/PyMISP version2.4.159).

It seems that the cause is that pagination limit(60) set below.(MISP side) https://github.com/MISP/MISP/blob/v2.4.159/app/Controller/WarninglistsController.php#L43

The problem was solved by unsetting the pagination limit in WarninglistsController.php as follows hack.

if ($this->_isRest()) {
    unset($this->paginate['limit']);
    $warninglists = $this->Warninglist->find('all', $this->paginate);
    return $this->RestResponse->viewData(['Warninglists' => $warninglists], $this->response->type());
}

fukusuket avatar Aug 04 '22 21:08 fukusuket