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

Bug: The /galaxy_clusters/index/{galaxyId} API call does not work #10062

Open
1 task done
adpaccent opened this issue Nov 26, 2024 · 10 comments
Open
1 task done

Bug: The /galaxy_clusters/index/{galaxyId} API call does not work #10062

adpaccent opened this issue Nov 26, 2024 · 10 comments
Assignees
Labels
needs triage This issue has been automatically labelled and needs further triage T: potential bug Type: potential bug. This issue may be a bug

Comments

@adpaccent
Copy link

Actual behavior

Instead, when executing a call successfully, it returns "500 An Internal Error Has Occured" and the JSON response is:

{"name":"An Internal Error Has Occurred.","message":"An Internal Error Has Occurred.","url":"/galaxy_clusters/index/3"}

Expected behavior

When executing a call successfully, it should return "200 Get galaxy clusters response" and the JSON response should be:

{ "GalaxyCluster": { ... } }

Steps to reproduce

Tried executing a GET to /galaxy_clusters/index/3 using the PyMISP - Python library using the MISP Rest API client.

Please note, we do not have this issue with MISP 2.5.1, but only with MISP 2.5.2.

Reference:
https://www.misp-project.org/openapi/#tag/Galaxy-Clusters/operation/getGalaxyClusters

Version

2.5.2

Operating System

Ubuntu

Operating System version

24.04

PHP version

8.2

Browser

No response

Browser version

No response

Relevant log output

error.log:

2024-11-26 10:41:10 Error: [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Galaxy.default' in 'where clause'
Request URL: /galaxy_clusters/index/3
Stack Trace:
#0 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(502): PDOStatement->execute()
#1 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(468): DboSource->_execute()
#2 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(715): DboSource->execute()
#3 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Datasource/DboSource.php(1226): DboSource->fetchAll()
#4 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3054): DboSource->read()
#5 /var/www/MISP/app/Lib/cakephp/lib/Cake/Model/Model.php(3026): Model->_readDataSource()
#6 /var/www/MISP/app/Model/AppModel.php(4346): Model->find()
#7 /var/www/MISP/app/Controller/GalaxyClustersController.php(101): AppModel->find()
#8 [internal function]: GalaxyClustersController->index()
#9 /var/www/MISP/app/Lib/cakephp/lib/Cake/Controller/Controller.php(500): ReflectionMethod->invokeArgs()
#10 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#11 /var/www/MISP/app/Lib/cakephp/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#12 /var/www/MISP/app/webroot/index.php(107): Dispatcher->dispatch()
#13 {main}

Extra attachments

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@adpaccent adpaccent added the needs triage This issue has been automatically labelled and needs further triage label Nov 26, 2024
@adulau adulau added the T: potential bug Type: potential bug. This issue may be a bug label Nov 26, 2024
@simonbjorzen-ts
Copy link

Can confirm this behaviour on version 2.4.200 with PyMISP 2.5.2.
This breaks some integrations for us that rely on the search_galaxy_clusters function in PyMISP.

@adpaccent
Copy link
Author

Please consider this issue urgent because it is blocking our integration between MISP and Crowdstrike (MISP Tools Manual Import):

https://github.com/CrowdStrike/MISP-tools/

Please let us know.

@simonbjorzen-ts
Copy link

Any progress on this? Thanks

@iglocska
Copy link
Member

Just to rule out some issues that may have gone wrong:

  1. Could you go to your diagnostics page as an admin and click the "clean cache" button?
  2. Could you log into your mysql and run the following query?

describe galaxies;
describe galaxy_clusters;

@simonbjorzen-ts
Copy link

Hi @iglocska,

  1. Tried, still the same error when using PyMISP misp.search_galaxy_clusters(galaxy="c4e851fa-775f-11e7-8163-b774922098cd", searchall="T1453")
MariaDB [misp]> describe galaxies;
+------------------+------------------+------+-----+---------+----------------+
| Field            | Type             | Null | Key | Default | Extra          |
+------------------+------------------+------+-----+---------+----------------+
| id               | int(11)          | NO   | PRI | NULL    | auto_increment |
| uuid             | varchar(255)     | NO   | UNI | NULL    |                |
| name             | varchar(255)     | NO   | MUL |         |                |
| type             | varchar(255)     | NO   | MUL | NULL    |                |
| description      | text             | NO   |     | NULL    |                |
| version          | varchar(255)     | NO   |     | NULL    |                |
| icon             | varchar(255)     | NO   |     |         |                |
| namespace        | varchar(255)     | NO   | MUL | misp    |                |
| enabled          | tinyint(1)       | NO   |     | 1       |                |
| local_only       | tinyint(1)       | NO   |     | 0       |                |
| kill_chain_order | text             | YES  |     | NULL    |                |
| default          | tinyint(1)       | NO   |     | 0       |                |
| org_id           | int(10) unsigned | NO   |     | NULL    |                |
| orgc_id          | int(10) unsigned | NO   |     | NULL    |                |
| created          | datetime         | NO   |     | NULL    |                |
| modified         | datetime         | NO   |     | NULL    |                |
| distribution     | tinyint(4)       | NO   |     | NULL    |                |
+------------------+------------------+------+-----+---------+----------------+
17 rows in set (0.001 sec)
MariaDB [misp]> describe galaxy_clusters;
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| id               | int(11)      | NO   | PRI | NULL    | auto_increment |
| uuid             | varchar(255) | NO   | MUL |         |                |
| collection_uuid  | varchar(255) | NO   | MUL | NULL    |                |
| type             | varchar(255) | NO   | MUL | NULL    |                |
| value            | text         | NO   | MUL | NULL    |                |
| tag_name         | varchar(255) | NO   | MUL |         |                |
| description      | text         | NO   |     | NULL    |                |
| galaxy_id        | int(11)      | NO   | MUL | NULL    |                |
| source           | varchar(255) | NO   |     |         |                |
| authors          | text         | NO   |     | NULL    |                |
| version          | int(11)      | YES  | MUL | 0       |                |
| distribution     | tinyint(4)   | NO   |     | 0       |                |
| sharing_group_id | int(11)      | YES  | MUL | NULL    |                |
| org_id           | int(11)      | NO   | MUL | NULL    |                |
| orgc_id          | int(11)      | NO   | MUL | NULL    |                |
| default          | tinyint(1)   | NO   | MUL | 0       |                |
| locked           | tinyint(1)   | NO   |     | 0       |                |
| extends_uuid     | varchar(40)  | YES  | MUL |         |                |
| extends_version  | int(11)      | YES  | MUL | 0       |                |
| published        | tinyint(1)   | NO   |     | 0       |                |
| deleted          | tinyint(1)   | NO   |     | 0       |                |
+------------------+--------------+------+-----+---------+----------------+
21 rows in set (0.001 sec)

Thanks!

@simonbjorzen-ts
Copy link

Just to clarify, this was not an issue on v2.4.199, but happened after upgrading to v2.4.200.

@iglocska
Copy link
Member

Interesting, sadly my theory was wrong.

@adpaccent
Copy link
Author

From our side, this was not an issue on v2.5.1, but happened after upgrading to v2.5.2.

@iglocska
Copy link
Member

hmm, I am testing it on v2.4.200 and I can't seem to be able to reproduce it so far.

Just wondering, do you also have the issue if you navigate to /galaxy_clusters/index/c4e851fa-775f-11e7-8163-b774922098cd.json via your browser?

@simonbjorzen-ts
Copy link

hmm, I am testing it on v2.4.200 and I can't seem to be able to reproduce it so far.

Just wondering, do you also have the issue if you navigate to /galaxy_clusters/index/c4e851fa-775f-11e7-8163-b774922098cd.json via your browser?

That works fine and returns the expected clusters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has been automatically labelled and needs further triage T: potential bug Type: potential bug. This issue may be a bug
Projects
None yet
Development

No branches or pull requests

5 participants