Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [search_index] Update date_from and date_to parameters to date str #1304

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomking2
Copy link
Contributor

I don't think it was always this way, but it now appears that MISP is unable to handle the datefrom and dateto parameters for the event index as timestamps. The value is directly passed to the DB, which has unexpected results depending on the DB choice:

  • MariaDB: Seems to return everything, ignoring the filter
  • Azure MySQL: Returns nothing

The solution is to instead format the field as a date string YYYY-MM-DD which correctly enables you to use these filters on the search_index endpoint. This should be a non-breaking change, as the fields accept the same input types as before.

@Lobasin

This comment was marked as abuse.

@Rafiot
Copy link
Member

Rafiot commented Oct 10, 2024

Just checking, which version of MISP are you using? That might be a new thing with 2.5 and PHP8.

cc @iglocska @mokaddem

@tomking2
Copy link
Contributor Author

I've tested on both 2.4 and 2.5 and a timestamp doesn't appear to work for either. A quick scan of the MISP codebase shows no changes to the index function in months so I think this predates any 2.5 and PHP8 switch, but I'll let @iglocska and @mokaddem confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants