CBOM Documentation

CBOM Secure

  • Administrative Guide
  • Login and Authentication
    • Overview
    • Dashboard Interface
    • Dashboard Operations
    • Data Visualization
    • Overview
    • Host
    • Template
      • Networked Deployments
      • Cloud Deployments
      • Off-Grid Deployments
      • Tags
      • Integrations
      • Cloud Servers
      • CycloneDX Export
    • Sensors Reference
    • Overview
    • Summary Report
    • PQC Report
    • AI Services
    • Source Code Visualizer
    • Key
    • Certificate
    • CipherSuites
    • Analysis
    • Policy Management
    • User Policy
    • Standard Policy
    • User Management
    • Roles & Permissions
    • System Configuration
    • Introduction
      • Components
      • Data Flows
      • Execution Models
      • Incremental Scanning
      • Security Model
      • Quick Start
      • Topologies
      • Sizing Guide
      • HA and Scaling
      • HA Runbooks
      • Ports and Firewall
      • Reverse Proxy
      • Prerequisites
      • Docker Compose
      • Native on Linux
      • Deployment Server
      • Install Troubleshooting
      • Validation Checklist
      • Managing Services
      • Logging
      • Certificates
      • Configuration
      • Database Administration
      • Backup and Recovery
      • Upgrade and Migration
      • Ops Troubleshooting
      • Methods
      • SAML 2.0 SSO
      • OIDC and Entra ID
      • Token Authentication
      • Password Policy
      • Sensor vs Connector
      • Sensor Guide Structure
      • Capability Matrix
        • AWS
        • Azure
        • Google Cloud
        • Active Directory
        • LDAP Directories
        • AD CS
        • EJBCA
        • CertSecure Manager
        • Thales Luna HSM
        • Entrust nShield HSM
        • SoftHSM2
        • HashiCorp Vault KMIP
        • MSSQL TDE
        • Oracle TDE
        • MySQL TDE
        • MariaDB TDE
        • HTTPS and TLS
        • SSH Servers
        • Windows Certificate Store
        • Linux Trust Store
        • Java Keystores
        • PKCS#12 Keystores
        • GnuPG Keyrings
        • Binaries and Libraries
        • Source Code Scanning
        • GitHub
        • GitLab
        • Bitbucket
        • Local Git
      • Roadmap
      • Integration Model
      • CrowdStrike
      • ServiceNow
      • ServiceNow and Jira Setup
      • Notification Engine
    • Glossary
    • Configuration Reference
    • Data Model Reference
    • API Reference
    • API Authentication
    • Running a Scan via API
    • Searching via API
    • CycloneDX Export Specification
    • Risk and PQC Scoring
    • Built-in Standards
    • Widget Catalogue
    • AI Services Data Handling

MySQL Setup Guide for CBOM Database TDE Sensor

1. Purpose

This guide covers the configuration required to connect the CBOM Database TDE sensor to a MySQL 8.0+ instance using InnoDB data-at-rest encryption. The CBOM sensor discovers cryptographic material managed by MySQL keyring plugins, including:

  • Encryption keys registered in the keyring (keyring_file, keyring_okv, keyring_hashicorp)

  • InnoDB tablespace encryption status and associated key identifiers

  • Active keyring plugin metadata and configuration state

The sensor operates in read-only mode using a dedicated least-privilege MySQL user. No data is modified, and no encryption keys are extracted — only metadata is collected for inventory and compliance purposes.

2. Prerequisites

Before beginning this setup, ensure the following conditions are met:

  1. MySQL 8.0 or later is installed and running.

  2. InnoDB data-at-rest encryption is enabled with a supported keyring plugin (keyring_file, keyring_okv, or keyring_hashicorp).

  3. The performance_schema is enabled (default in MySQL 8.0+).

  4. You have access to a MySQL account with GRANT privileges (typically root or a DBA account).

  5. Network connectivity exists between the CBOM sensor host and the MySQL server on the configured port (default: 3306).

  6. The CBOM agent is installed on the sensor host and the Discover_DB sensor module is available.

  7. SSL/TLS is configured on the MySQL server if the connection traverses an untrusted network.

3. Create the CBOM Reader Account

Create a dedicated MySQL user for the CBOM sensor. This user requires read-only access to specific system schemas and no access to application data.

3.1 Create the User

Connect to MySQL as an administrative user and run the following statement. Replace 'StrongPassword123!' with a secure password that meets your organization's password policy.

CREATE USER 'cbom_reader'@'%' IDENTIFIED BY 'StrongPassword123!';

If the CBOM sensor will connect from a specific host, replace '%' with the sensor's IP address or hostname to restrict the login origin:

CREATE USER 'cbom_reader'@'cbom-agent.example.com' IDENTIFIED BY 'StrongPassword123!';
3.2 Grant Required Privileges

Grant the minimum privileges needed for the CBOM sensor to query keyring and tablespace metadata.

-- Allow the sensor to read registered keyring key metadata
GRANT SELECT ON performance_schema.keyring_keys TO 'cbom_reader'@'%';

-- Allow the sensor to query running process and session state
GRANT PROCESS ON *.* TO 'cbom_reader'@'%';

-- Allow the sensor to read tablespace encryption status
GRANT SELECT ON information_schema.INNODB_TABLESPACES TO 'cbom_reader'@'%';

-- Apply the privilege changes immediately
FLUSH PRIVILEGES;
3.3 Verify the User and Privileges

Confirm the account was created and the grants were applied correctly:

SELECT user, host, account_locked, password_expired
FROM mysql.user
WHERE user = 'cbom_reader';

SHOW GRANTS FOR 'cbom_reader'@'%';

Expected output for SHOW GRANTS:

+-----------------------------------------------------------------------------------+
| Grants for cbom_reader@%                                                          |
+-----------------------------------------------------------------------------------+
| GRANT PROCESS ON *.* TO `cbom_reader`@`%`                                        |
| GRANT SELECT ON `performance_schema`.`keyring_keys` TO `cbom_reader`@`%`         |
| GRANT SELECT ON `information_schema`.`INNODB_TABLESPACES` TO `cbom_reader`@`%`   |
+-----------------------------------------------------------------------------------+

4. Verify the Keyring Plugin Is Active

The CBOM sensor requires a keyring plugin to be loaded and active. Without an active keyring plugin, no key metadata will be available.

4.1 Check Loaded Plugins

Run the following query to confirm a keyring plugin is present and active:

SHOW PLUGINS;

Look for a row where Name contains keyring and Status is ACTIVE. Example output:

+-------------------+--------+--------------------+----------------------+---------+
| Name              | Status | Type               | Library              | License |
+-------------------+--------+--------------------+----------------------+---------+
| keyring_file      | ACTIVE | KEYRING            | keyring_file.so      | GPL     |
+-------------------+--------+--------------------+----------------------+---------+
4.2 Verify Keyring Keys Are Accessible

Confirm that key entries are visible in performance_schema:

SELECT * FROM performance_schema.keyring_keys;

If the table returns rows, the keyring is populated and the CBOM sensor will be able to collect key identifiers. An empty result set indicates encryption is configured but no keys have been generated yet, which may occur on a freshly initialized instance.

4.3 Verify Tablespace Encryption Status

Confirm encrypted tablespace metadata is accessible:

SELECT SPACE, NAME, ENCRYPTION
FROM information_schema.INNODB_TABLESPACES
WHERE ENCRYPTION = 'Y'
LIMIT 10;

5. Configure SSL/TLS for the Sensor Connection (Recommended)

If MySQL is configured to require SSL, or if the connection traverses a network boundary, configure the CBOM sensor to use TLS when connecting.

5.1 Confirm SSL Is Available on the MySQL Server
SHOW VARIABLES LIKE '%ssl%';

Confirm that have_ssl is YES and have_openssl is YES.

5.2 Require SSL for the CBOM Reader Account (Optional Hardening)

To enforce encrypted connections for the sensor account:

ALTER USER 'cbom_reader'@'%' REQUIRE SSL;
5.3 Obtain the CA Certificate

Copy the MySQL CA certificate from the server to the CBOM sensor host. The default location on the MySQL server is:

/var/lib/mysql/ca.pem

Place the certificate on the sensor host at a path accessible to the CBOM agent, for example:

/etc/cbom/certs/mysql-ca.pem

6. Configure CBOM Sensor

Create or update the sensor configuration file for the Discover_DB sensor. The configuration file is typically located at /etc/cbom/sensors/mysql-tde.yaml or within the CBOM agent's sensors/ directory.

sensor:
  name: Discover_DB
  enabled: true
  schedule: "0 */6 * * *"        # Run every 6 hours

target:
  type: mysql
  host: "mysql.internal.example.com"
  port: 3306
  database: "performance_schema"

credentials:
  username: "cbom_reader"
  password: "${CBOM_MYSQL_PASSWORD}"   # Injected from environment or secrets manager

tls:
  enabled: true
  ca_cert: "/etc/cbom/certs/mysql-ca.pem"
  verify_server_cert: true

discovery:
  keyring:
    enabled: true
    source_table: "performance_schema.keyring_keys"
  tablespaces:
    enabled: true
    source_table: "information_schema.INNODB_TABLESPACES"
    filter_encrypted_only: true
  plugins:
    enabled: true
    query: "SHOW PLUGINS"
    filter_type: "KEYRING"

output:
  format: "cbom-json"
  destination: "/var/cbom/output/mysql-tde/"
  include_metadata: true

logging:
  level: "info"
  path: "/var/log/cbom/mysql-tde-sensor.log"

Set the password environment variable on the CBOM agent host before starting the sensor:

export CBOM_MYSQL_PASSWORD='StrongPassword123!'

For production deployments, inject the password via a secrets manager (HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault) rather than a plain environment variable.

7. Validation

After saving the configuration file, run the CBOM sensor in dry-run mode to verify connectivity and permissions before enabling the scheduled collection.

7.1 Test Connectivity
cbom sensor run --name Discover_DB --config /etc/cbom/sensors/mysql-tde.yaml --dry-run

Expected output:

[INFO] Connecting to mysql.internal.example.com:3306...
[INFO] Authentication successful for user 'cbom_reader'
[INFO] Keyring plugin detected: keyring_file (ACTIVE)
[INFO] Discovered 12 keyring key entries
[INFO] Discovered 34 encrypted tablespaces
[INFO] Dry-run complete. No output written.
7.2 Run a Full Collection
cbom sensor run --name Discover_DB --config /etc/cbom/sensors/mysql-tde.yaml
7.3 Verify Output

Confirm output files were written to the configured destination:

ls -lh /var/cbom/output/mysql-tde/

Review the CBOM JSON output to confirm key identifiers and tablespace records are present:

cat /var/cbom/output/mysql-tde/cbom-latest.json | python3 -m json.tool | head -60
7.4 Confirm in the CBOM Dashboard

Log in to the CBOM console and navigate to Sensors > Discover_DB > MySQL. Confirm the sensor shows a recent successful run timestamp and that discovered assets are listed under the MySQL data source.

8. Common Errors and Resolution

Error 1: Access denied for user 'cbom_reader'@'...' (using password: YES)

Cause: The user account does not exist for the connecting host, the password is incorrect, or the host restriction on the account does not match the sensor's IP address.

Resolution:

  1. Verify the account exists: SELECT user, host FROM mysql.user WHERE user = 'cbom_reader';

  2. Confirm the sensor host IP matches the account's host column. If the account was created with a specific IP, ensure the sensor connects from that address.

  3. Re-create the account with '%' if host restriction is not required, or update the account host: RENAME USER 'cbom_reader'@'old_host' TO 'cbom_reader'@'new_host';

  4. Reset the password if needed: ALTER USER 'cbom_reader'@'%' IDENTIFIED BY 'NewPassword!';

Error 2: Table 'performance_schema.keyring_keys' doesn't exist

Cause: The keyring_keys table is only present in MySQL 8.0.16 and later, and only when a keyring plugin is loaded. If no keyring plugin is active, the table does not exist.

Resolution:

  1. Verify the MySQL version: SELECT VERSION(); — must be 8.0.16 or later.

  2. Confirm a keyring plugin is active: SHOW PLUGINS; — look for a row with Type = KEYRING and Status = ACTIVE.

  3. If no keyring plugin is loaded, configure one in my.cnf. Example for keyring_file:

[mysqld]
early-plugin-load = keyring_file.so
keyring_file_data = /var/lib/mysql-keyring/keyring
  1. Restart MySQL and re-run the sensor.

Error 3: SSL connection error: SSL is required but the server doesn't support it

Cause: The CBOM sensor configuration has tls.enabled: true but the MySQL server was not compiled with SSL support or SSL is disabled in the server configuration.

Resolution:

  1. Check SSL support on the server: SHOW VARIABLES LIKE 'have_ssl'; — must return YES.

  2. If SSL is disabled, enable it in my.cnf:

[mysqld]
ssl-ca   = /var/lib/mysql/ca.pem
ssl-cert = /var/lib/mysql/server-cert.pem
ssl-key  = /var/lib/mysql/server-key.pem
  1. Restart MySQL and confirm: SHOW VARIABLES LIKE '%ssl%';

  2. If the MySQL instance does not support SSL and operates on a trusted internal network, set tls.enabled: false in the sensor configuration as a temporary workaround. Document this exception and schedule remediation.

9. Security Recommendations

  • Use a dedicated read-only account. Never configure the CBOM sensor with a DBA or root account. The cbom_reader account should hold only the three grants described in Section 3.2 and nothing more.

  • Restrict the account login origin. Replace '%' with the specific IP address of the CBOM sensor host to prevent the credential from being usable from other systems in the event of exposure.

  • Store credentials in a secrets manager. Do not hard-code passwords in the sensor YAML file. Use environment variable injection from HashiCorp Vault, AWS Secrets Manager, or a comparable system, and rotate the password on a defined schedule.

  • Enforce SSL for the sensor connection. Apply ALTER USER 'cbom_reader'@'%' REQUIRE SSL; and configure the sensor with a valid CA certificate to prevent credential interception in transit.

  • Audit sensor account usage. Enable the MySQL audit log plugin and create a filter that captures all queries by cbom_reader. Review these logs periodically to detect unexpected access patterns or privilege escalation attempts.

10. Conclusion

This guide establishes a secure, least-privilege connection between the CBOM Discover_DB sensor and a MySQL 8.0+ instance using InnoDB data-at-rest encryption. By querying performance_schema.keyring_keys and information_schema.INNODB_TABLESPACES, the sensor builds a complete inventory of active encryption keys and encrypted tablespaces without accessing application data or extracting key material. Regular sensor runs ensure the CBOM cryptographic inventory remains current and supports ongoing compliance, audit, and cryptographic risk assessment workflows.

On this Page:
Support Privacy Policy Terms of Service

Copyright 2026 Encryption Consulting LLC. All rights reserved.