fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.92k stars 406 forks source link

Fleet serve to exit if MySQL database/version is not supported #3346

Closed lucasmrod closed 3 weeks ago

lucasmrod commented 2 years ago

Goal

Discourage users to run Fleet with unsupported MySQL databases/versions.

How

Fleet serve will exit if the MySQL database or version is not supported. Also provide an option FLEET_ALLOW_UNSUPPORTED_MYSQL to allow running fleet serve even if the added start up check fails.

TBD: How exactly to get the server and its version (e.g. in the case of Percona SELECT VERSION() only shows version number...)

Some experiments:

With mariadb:10.6:

mysql> SELECT VERSION();
+-----------------------------------------+
| VERSION()                               |
+-----------------------------------------+
| 10.6.5-MariaDB-1:10.6.5+maria~focal-log |
+-----------------------------------------+

With mysql:5.7:

SELECT VERSION();
+------------+
| VERSION()  |
+------------+
| 5.7.36-log |
+------------+

With 5.7.35-38-log Percona Server (GPL):

SELECT VERSION();
+---------------+
| VERSION()     |
+---------------+
| 5.7.35-38-log |
+---------------+

So we'll need some form of heuristics to determine the database server.

pboushy commented 1 month ago

Instead of checking for versions, how about check for functionality? e.g. can it do JSON?

As I understand it some flavors of MySQL can, some can't?

I'm actually submitting an issue about Fleet failing on MariaDB right now... would be great if MariDB was supported.

lucasmrod commented 3 weeks ago

Closing this as stale. On a related note: Fleet has dropped support for MySQL 5.7 and starting in 4.55.0 is only supporting MySQL 8.0.36+.

fleet-release commented 3 weeks ago

Fleet serves with care, Aegis for MySQL's health, Cloud city's calm guard.