Skip to main content

MySQL / MariaDB

Description

The MySQL/MariaDB connector scans a MySQL or MariaDB instance via JDBC (MySQL Connector/J) to discover database user accounts and their global privilege grants. MySQL 8.x and MariaDB 10.x role memberships are discovered where available.

System Type Classification

FieldValue
System TypeInfrastructure
Default Scan Priority500

Version Support

OrbisID EditionSupported
CommunityNo
ProYes
EnterpriseYes

MySQL/MariaDB scanning requires a Pro or Enterprise licence.

Supported Protocol

ProtocolPortNotes
JDBC / MySQL Protocol (TCP)3306 TCPDefault; configurable per instance

What OrbisID Discovers

DataSourceMinimum Version
User accountsmysql.userMySQL 5.7 / MariaDB 10.x
Account lock statusmysql.user.account_lockedMySQL 5.7.6+
Password expiry statusmysql.user.password_expiredMySQL 5.7+
Global privilege flagsmysql.user columnsMySQL 5.7 / MariaDB 10.x
Role membershipsmysql.role_edgesMySQL 8.0+ / MariaDB 10.3+

Privileged Flag Detection

A user is flagged as privileged when any of the following mysql.user columns is set to Y:

Super_priv, Grant_priv, Shutdown_priv, Reload_priv, Process_priv, File_priv, Create_user_priv

Connection Requirements

Credential Requirements

Recommended: Create a dedicated MySQL user for OrbisID with minimal permissions:

-- MySQL / MariaDB
CREATE USER 'orbisid_scanner'@'%' IDENTIFIED BY '<strong-password>';
GRANT SELECT ON mysql.user TO 'orbisid_scanner'@'%';
GRANT SELECT ON mysql.role_edges TO 'orbisid_scanner'@'%'; -- MySQL 8+ / MariaDB 10.3+
FLUSH PRIVILEGES;
Host Binding

Replace % with the OrbisID server IP address for tighter access control (e.g., 'orbisid_scanner'@'10.0.1.50').

Credential Mapping

OrbisID FieldMySQL Value
credential.usernameMySQL username
credential.passwordMySQL password

System Attributes

AttributeRequiredDefaultDescription
mysqlDatabaseNomysqlInitial database to connect to. Account discovery always reads from the mysql system schema regardless of this setting.
mysqlSslModeNoPREFERREDSSL mode for the JDBC connection. Values: DISABLED, PREFERRED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY.

Network Requirements

RequirementDetail
TCP port 3306Must be accessible from the OrbisID server (or On-Premise Agent)
MySQL remote connectionsThe bind-address in my.cnf must not restrict connections from the OrbisID server

Configuration Steps

  1. Create the orbisid_scanner user with the grants above
  2. Create a Credential in OrbisID:
    • Username: orbisid_scanner
    • Password: The scanning user's password
  3. Navigate to Systems → Add System
  4. Fill in the fields:
FieldValue
NameDescriptive name (e.g., MySQL – prod-db01 or MariaDB – prod-db01)
Hostname / IPMySQL/MariaDB host
Port3306 (or custom port)
OS TypeMySQL
System TypeInfrastructure
CredentialThe scanning credential
  1. Optionally, set mysqlSslMode in system attributes
  2. Click Test Connection to verify connectivity and authentication
  3. Click Save
MariaDB Compatibility

MySQL Connector/J is fully compatible with MariaDB when using the standard jdbc:mysql:// URL. For strict MariaDB-native behaviour (e.g., specific MariaDB features), consider using the On-Premise Agent with a Custom Script scanner backed by the MariaDB JDBC driver.

Troubleshooting

SymptomLikely CauseResolution
Access denied for userInvalid credentials or host not allowedVerify the password; check the user's host column in mysql.user — it must match the OrbisID server IP
Connection refused / timeoutPort blocked or bind-address restricts accessCheck bind-address in my.cnf; open port 3306 in firewall rules
SELECT command denied … mysql.userInsufficient privilegesGrant SELECT ON mysql.user to the scanning user
No roles returnedMySQL < 8.0 or mysql.role_edges not accessibleRole discovery is skipped on MySQL 5.x; grant SELECT ON mysql.role_edges on MySQL 8+
SSL errorSSL certificate validation failedSet mysqlSslMode to DISABLED for testing; use REQUIRED with a valid certificate for production