MISP / PyMISP

Python library using the MISP Rest API
Other
439 stars 278 forks source link

List of all warninglists returned is limited to 60 #851

Open cudeso opened 2 years ago

cudeso commented 2 years ago

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

Rafiot commented 2 years ago

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

cudeso commented 2 years ago

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

fukusuket commented 2 years ago

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());
}