Automated Pull from Database in Tenable One Open Connector

The following is not supported in Tenable FedRAMP Moderate environments. For more information, see the Tenable FedRAMP Product Offering.

You can use the Tenable One Open Connector to pull asset and finding data directly from a relational database into Tenable Exposure Management. You provide the connection details and a SQL query, and the connector runs that query on every scheduled sync.

This method removes the export step that file-based ingestion requires. You do not export your database records to a file, and you do not stage a file in cloud storage. As a result, enrichment data that lives only in your database reaches your risk scoring without a custom data pipeline. Examples include asset ownership, application mapping, and business criticality.

Note: To pull a file from cloud storage or upload a file manually instead of running a SQL query, see Automated Pull from Cloud Storage in Tenable One Open Connector and Static File Upload in Tenable One Open Connector.

You can connect the Tenable One Open Connector to the following database providers:

You select the database provider in the Data pulling configuration section, and then type that provider's connection details, authentication details, and SQL query.

Note: The query execution, validation, mapping, and synchronization logic are the same for all providers. Only the connection and authentication fields differ.

Prerequisites

Before you begin, make sure you have the following:

Requirement Details
Tenable Exposure Management access A user account with the Connector Manager or Administrator role.
Database access A database user with read access to every table or view that your query targets, including any in another schema or dataset. The permissions of this user are the only limit on what your query can return. The connector reads data only. It does not write, update, or delete records in your database.
SQL query A query that returns a single flat table. For more information, see SQL Query Requirements.
Asset type decision Determine which asset type matches your data. You cannot change the asset type after you set up the connector. To ingest more than one asset type, create a separate connector for each one.
Microsoft SQL Server version Microsoft SQL Server 2012 or later. Tenable tested the connector with SQL Server 2012 and later, Azure SQL Database, and Azure SQL Managed Instance.
Microsoft SQL Server encryption A server that accepts encrypted connections over TLS 1.2 or later. Azure SQL enforces TLS 1.2 by default. On-premises SQL Server 2016 and later support TLS 1.2. An older on-premises instance can require a TLS update. If the server refuses encryption, the sync fails.
Microsoft SQL Server network access Tenable Exposure Management connects to your server from the Tenable cloud. Your server must accept connections from the Tenable egress IP addresses.
MySQL version Tenable tested the connector with MySQL 8.0, MySQL 8.4, and Percona Server for MySQL. MariaDB, MySQL 5.7 and earlier, PlanetScale, Vitess, TiDB, and SingleStore are not supported.
MySQL authentication A user that authenticates with the default caching_sha2_password plugin. MySQL 8.4 disables the older mysql_native_password plugin by default, so a user that relies on it fails to authenticate.
MySQL encryption A server that accepts encrypted connections over Transport Layer Security (TLS) 1.2 or later. If the server refuses encryption, the sync fails.
MySQL network access Tenable Exposure Management connects to your server from the Tenable cloud. Your server must accept connections from the Tenable egress IP addresses.

SQL Query Requirements

The connector executes the query you provide and ingests the result as a flat table. JOIN clauses, WHERE clauses, and subqueries are supported.

The connector places no restriction on which objects your query reads. The permissions of the account that you configure are the only limit, so your query can join tables across schemas or datasets when that account can read them.

Important: The connector does not validate or build queries. It executes the query you provide, read-only, on every scheduled sync.

The result must be a single flat table. Tenable Exposure Management does not support multi-level nested structures, and rejects a result that contains any of the following column types:

Database Provider Unsupported Column Types
BigQuery (GCP) Nested types (RECORD and STRUCT), array types (REPEATED), and the native JSON type.
Oracle Object types, collection types (nested table and VARRAY), REF CURSOR, and the native JSON type.
Microsoft SQL Server Columns that return a nested or structured value, such as the native json type. The connector converts xml, geography, and geometry columns to text, so you can select them.
MySQL The native JSON type and any other column that returns a nested or structured value.

Note: Scalar column types, such as VARCHAR, NUMBER, DATE, and CLOB, are supported. A JSON value stored in a plain text column is scalar, so the connector accepts it.

Tip: To flatten an unsupported column, cast it to a text value or select its individual attributes as separate columns in your query.

Microsoft SQL Server Query Requirements

A Microsoft SQL Server query must also meet the following requirements:

  • The query must be a single SELECT statement in Transact-SQL (T-SQL). Tenable Exposure Management rejects any other statement type and any batch of more than one statement. The connector removes a trailing semicolon automatically.
  • T-SQL does not support the LIMIT keyword. To limit the number of rows, use TOP, or OFFSET and FETCH.
  • Every column name in the result must be unique. A SELECT * query that joins two tables with a shared column name fails with a "Duplicate column name" error. To resolve the error, give each duplicate column an alias.
  • A single field value cannot exceed 300 KiB (307,200 bytes). A larger value fails the sync.
  • The connector sets no time limit on the query. Your SQL Server query timeout and Resource Governor limits still apply. If SQL Server stops the query, the sync logs show a connection error.
  • If a sync fails, the next sync runs the full query again from the start.

Note: If your query starts with a common table expression (CTE), the preview does not apply the 10-row limit. The preview returns the full result instead.

Tenable Exposure Management converts Microsoft SQL Server column values as follows:

SQL Server Data Type Value in Tenable Exposure Management
NULL An empty value
datetime, datetime2, and smalldatetime An ISO 8601 date and time, without a time zone offset
datetimeoffset An ISO 8601 date and time, with the time zone offset
date An ISO 8601 date
time HH:MM:SS, with fractional seconds when present
bit 0 or 1
decimal, numeric, money, and smallmoney A decimal number
uniqueidentifier A UUID string
binary and varbinary A hexadecimal string
geography and geometry Well-Known Text (WKT) or a hexadecimal string
xml A text string

Note: The connection and the transferred data use UTF-8 encoding for all text.

Important: Tenable Exposure Management treats the text values NULL, null, None, and N/A as null values. If your data contains these values as real data, transform them in your query.

MySQL Query Requirements

A MySQL query must also meet the following requirements:

  • The query must be a single SELECT statement. Tenable Exposure Management rejects any other statement type and any batch of more than one statement. The connector removes a trailing semicolon automatically.
  • Every column name in the result must be unique. A SELECT * query that joins two tables with a shared column name fails with a "Duplicate column name" error. To resolve the error, give each duplicate column an alias, as in the example that follows this list.
  • A single field value cannot exceed 300 KiB (307,200 bytes). A larger value fails the sync. Binary columns double in size because the connector converts them to hexadecimal text. To shorten a long text or binary column, wrap it in LEFT(column, n).
  • MySQL truncates a GROUP_CONCAT result at the group_concat_max_len server setting, which defaults to 1024 bytes. MySQL does not warn you when it truncates a value. If your query uses GROUP_CONCAT, raise this setting on the server with SET GLOBAL, or avoid the function.
  • The connector sets no time limit on the query. However, it sets the session net_write_timeout to 600 seconds. If the query runs longer than that without returning rows, the server ends the connection and the sync fails with a "lost connection" error.
  • Window functions, such as ROW_NUMBER, require MySQL 8.0 or later. On an older server, the query fails with a SQL syntax error.
  • The connector reads all text as UTF-8 (utf8mb4). MySQL converts columns in other character sets automatically. If a column stores bytes that do not match its declared character set, the sync can fail. Convert that column in your query.
  • If a sync fails, the next sync runs the full query again from the start.

The following example shows how to alias a duplicate column:

-- Fails: both tables have an id column
SELECT * FROM assets a JOIN findings f ON a.id = f.asset_id;

-- Works: alias the duplicate column
SELECT a.*, f.id AS finding_id FROM assets a JOIN findings f ON a.id = f.asset_id;

Tip: Every sync runs your full query again against the host that you configure. Tenable recommends that you point the connector at a read replica when one is available.

Tenable Exposure Management converts MySQL column values as follows:

MySQL Data Type Value in Tenable Exposure Management
NULL An empty value
DATETIME An ISO 8601 date and time, as stored, without a time zone marker
TIMESTAMP An ISO 8601 date and time in UTC, with a Z suffix
DATE An ISO 8601 date
TIME A signed HH:MM:SS value, with fractional seconds when present
YEAR An integer
BIT and BOOLEAN 0 or 1
Zero dates, such as 0000-00-00 A null value
GEOMETRY A hexadecimal Well-Known Binary (WKB) string, without the spatial reference ID (SRID) prefix
BLOB and other binary types A hexadecimal string, twice the original size
JSON Not supported. The query fails.

Important: Tenable Exposure Management treats the text values NULL, null, None, and N/A in a MySQL result as null values. If your data contains these values as real data, transform them in your query.

Query Preview and Validation

Tenable Exposure Management validates your query in two stages:

  • Preview: When you click Continue, Tenable Exposure Management runs your query with a 10-row limit and displays the returned columns and up to 10 sample rows. You map your fields against those columns. A row limit does not change which columns the query returns, so the preview columns match the columns of the full result.

  • Sync start: At the start of every sync, Tenable Exposure Management runs the same 10-row query and confirms that the result is not empty and that it contains every mandatory and unique column in your mapping. If either check fails, the sync fails before the connector fetches your data.

Note: The 2 GB file size limit that applies to file-based sources does not apply to a database result set.

Configure Automated Pull from Database

Set Asset Retention and Complete the Configuration

A database source runs a full sync every time. Tenable Exposure Management replaces the connector data with the result of your query on each synchronization.

Note: A database source has no Data Update Mode selection. You do not choose between Full Fetch and Incremental Fetch, and the Additive Only, Strict Inventory, and Dynamic Remediation reconciliation modes do not apply.

To complete the data configuration:

  1. In the Asset Retention section, type the number of days after which Tenable Exposure Management removes assets. The default is 460 days.

    Tip: To learn more, see How does Asset Retention work in the Tenable One Open Connector?.

  2. In the Test connectivity section, click Test connectivity. Tenable Exposure Management opens a connection to your database and validates the credentials. You must pass this test before you can create the connector.

    Note: The connectivity test does not run your query, and a successful test does not guarantee a successful sync. The connector can still fail later during syncing or processing.

    Important: If you change the connection details, the authentication details, or the SQL query, test the connectivity and preview the result again. You must do this before you can save the connector. If you change only the connector name, the description, or the schedule, you can save and sync without testing again.

  3. In the Connector scheduling section, configure the time and day(s) on which you want connector syncs to occur.

    Tip: For more information, see Connector Scheduling.
  4. Click Continue.

    Tenable Exposure Management runs your query with a 10-row limit and displays the returned columns and up to 10 sample rows.

  5. From the Asset type drop-down, select the category that matches your data, for example, Devices.

    Important: You cannot change the asset type after you save the connector. To ingest a different asset type, create a new connector instance.

    Note: To ingest identity data from Active Directory (AD) or Microsoft Entra ID, select Account, Group, or Role. For the attributes that you can map for each type, see Identity Asset Type Mapping.

  6. Click Continue.

    Note: This selection defines the mapping attributes available in the next step.

    The mapping page appears.

  7. Define how the connector interprets and aligns your query result with the Tenable Exposure Management standardized data model:

    1. Review the auto-suggested mappings, and adjust them as needed. You must map the mandatory fields, such as Asset Name or Finding Name, to continue.

      Note: The mandatory asset fields depend on the asset type. Every finding requires the Score and Finding Name fields. For the full list, see Updated Mandatory Fields.

    2. (Optional) Use the + button to add new mappings.

      TIP: To learn about the expected behavior and logic rules for how Tenable Exposure Management maps your source columns, see Tenable One Open Connector Mapping .
    3. Click Save and continue.

      The Data Aggregation and Uniqueness page appears.

  8. On the Data Aggregation and Uniqueness page, fill in the answers for the required questions to define how Tenable Exposure Management identifies unique assets, weaknesses, and findings.

    Note: Tenable One Open Connector lets you define custom uniqueness criteria. You can tailor the Data Aggregation and Uniqueness settings to make sure Tenable Exposure Management correctly identifies your specific assets and findings as new records or updates.

    Tenable Exposure Management also asks which Tenable Exposure Category best describes your data, and suggests a category based on the asset type you selected. If you select Other, Tenable Exposure Management cannot calculate an Asset Exposure Score (AES) for those assets.

    For the Account, Group, and Role asset types, Tenable Exposure Management suggests the Identity category.

    Tip: These settings control uniqueness inside this connector. To understand how your database rows deduplicate against assets that other sources already discovered, see How Your Database Data Merges with Existing Assets.

  9. Click Save.

    The main setup page appears.

  10. Click Create & Sync.

    Tenable Exposure Management runs your full query, ingests the result, and reflects the changes after processing completes.

  11. (Optional) On the main connector setup page, view the Connector Logs to review any changes. For more information, see Tenable One Open Connector Logs.

Remap Columns

With the Remap Columns option, you can revise the field mappings or the uniqueness criteria for your existing database data source.

To remap columns:

  1. On the Connectors page, click the Tenable One Open Connector instance you want to edit.
  2. At the bottom right of the screen, click Remap Columns.

    The Map Attributes page appears.

  3. Remap the query result columns to the Tenable Exposure Management attributes as needed.
  4. Click Next.

    The Data Aggregation and Uniqueness page appears.

  5. On the Data Aggregation and Uniqueness page, identify and apply any required changes to your unique identifiers.
  6. Click Update & Sync.

Note: If you change your SQL query, Tenable Exposure Management previews the new result and revalidates your mapping against the returned columns. Map any column that your previous mapping no longer matches.

Tenable One Open Connector Data in Tenable Exposure Management

Locate Connector Assets in Tenable Exposure Management

As the connector discovers assets, Tenable Exposure Management ingests those devices for reporting.

To view assets by connector:

  1. In Tenable Exposure Management, navigate to the Assets page.

  2. In the Filters section, under Custom, click the connector name for which you want to view assets.

    The asset list updates to show only assets from the selected connector.

  3. Click any asset to view Asset Details.

Locate Connector Weaknesses in Tenable Exposure Management

As the connector discovers weaknesses, Tenable Exposure Management ingests those weaknesses for reporting.

To view weaknesses by connector: 

  1. In Tenable Exposure Management, navigate to the Weaknesses page.

  2. In the Filters section, under Custom, click the connector name for which you want to view weaknesses.

    The weaknesses list updates to show only weaknesses from the selected connector.

  3. Click any weakness to view Weakness Details.

Locate Connector Findings in Tenable Exposure Management

As the connector discovers individual findings, Tenable Exposure Management ingests those findings for reporting.

To view findings by connector:

  1. In Tenable Exposure Management, navigate to the Findings page.

  2. In the Filters section, under Custom, click the connector name for which you want to view findings.

    The findings list updates to show only findings from the selected connector.

  3. Click any finding to view Finding Details.

How Your Database Data Merges with Existing Assets

The connector ingests your query result as asset and finding data. It does not enrich an existing asset in place. Instead, when the asset it ingests matches one that another source already discovered, Tenable Exposure Management presents the data from both sources under a single deduplicated asset in your inventory.

Two separate mechanisms control this, and each one operates at a different level:

  • Data Aggregation and Uniqueness: You configure these settings during setup. They tell Tenable Exposure Management which columns identify a unique asset, weakness, and finding inside this connector. Multiple query rows that describe the same asset then consolidate into one record.

  • Third-party asset deduplication: Tenable Exposure Management applies this automatically across sources. It matches each incoming asset against the assets that your other connectors and Tenable sensors already discovered. When the criteria match, the records deduplicate into one multi-source asset, and your inventory shows the data from every contributing source under it. When the criteria do not match, the asset appears on its own.

Note: You cannot configure the third-party deduplication criteria. Tenable Exposure Management applies a fixed set of matching field combinations for each asset class.

For your database rows to deduplicate against assets that already exist, include and map the columns that the deduplication criteria use for your asset class. For a device, map a value such as an external identifier, a MAC address, or a consistent hostname, fully qualified domain name (FQDN), and IP address. A query that returns only ownership or business context, with no identifier that the criteria recognize, produces separate assets rather than data attached to your existing inventory.

Tip: For the criteria for each asset class, the property merge order, and the known limitations, see Asset Deduplication in Tenable Exposure Management and the Asset Deduplication FAQ.

Expected Post-Sync Behavior

After a successful synchronization, Tenable Exposure Management performs the following actions:

  • Data replacement: Replaces all existing asset records and findings for the connector instance with the content of the new query result. Tenable Exposure Management archives assets and marks findings as Fixed if they are missing from the latest result.

  • Uniqueness and mapping changes: Applies updated uniqueness criteria or field mappings from the next sync onward. Tenable Exposure Management does not retroactively modify data already ingested with previous uniqueness logic.

  • Data cleanup: Disregards previous values for any non-mandatory fields removed from the latest mapping.

Synchronization Logic

The Tenable One Open Connector applies the following logic during automated database syncs:

  • Query execution: Every sync runs your query again. Tenable Exposure Management compares no files and skips no syncs, so a database connector never reports "No new file detected".

  • Result processing: Tenable Exposure Management stores each query result as a CSV file internally, and then processes that file through the same mapping and normalization pipeline as a file-based source.

  • Result validation: An empty result fails the sync. A result that omits a mandatory or unique mapped column also fails the sync.

  • Finding status: Tenable Exposure Management moves findings not included in the new result to the Fixed state.

  • Credentials or query modification: If you change the credentials or the query, you must test the connectivity and preview the result before you can save and sync the connector.

  • On-demand sync: To run a sync outside the schedule, open the connector and click Sync now.

Connectivity and Sync Errors

If a sync or connectivity test fails, review the error messages to troubleshoot configuration issues.

Scenario Message
Authentication failure "Failed test 1 out of 2: the credentials are not correct."
Missing mandatory columns "File is missing mandatory columns and the data cannot be synced."
Empty result detected "Sync Failed: No Records Found."
Nested or structured column in the result The sync fails because the query result is not a single flat table.
Microsoft SQL Server: access denied during the connectivity test "Access to the SQL Server was denied. Verify the username and password, and that the account is allowed to connect from Tenable's IP addresses."
Microsoft SQL Server: other connectivity test failure "Failed to connect to the SQL Server. Verify the host, port and database name, and that the server accepts TLS connections from Tenable's IP addresses."
Microsoft SQL Server: unencrypted connection "The connection to the SQL Server is not encrypted. Enable TLS on the server and try again."
Microsoft SQL Server: query fails or returns data that cannot be ingested "The query failed or returned data that cannot be ingested. Check your SQL and ensure every column returns a scalar value."
Microsoft SQL Server: access denied while running the query "Access was denied while running the query. Verify the credentials and that the account can read every table in the query. Open Connector runs queries read-only, so statements that write data are always rejected."
Microsoft SQL Server: query cannot complete for another reason "The query could not be completed."
Microsoft SQL Server: duplicate column names in the result An error that contains "Duplicate column name".
Microsoft SQL Server: field value larger than 300 KiB "field larger than field limit (307200)"
MySQL: access denied during the connectivity test "Access to the MySQL server was denied. Verify the username and password, and that the account is allowed to connect from Tenable's IP addresses."
MySQL: other connectivity test failure "Failed to connect to the MySQL server. Verify the host, port and database name, and that the server accepts TLS connections from Tenable's IP addresses."
MySQL: unencrypted connection "The connection to the MySQL server is not encrypted. Enable TLS on the server (check 'SHOW SESSION STATUS LIKE "Ssl_cipher"' and the server's ssl_cert / ssl_key settings) and try again."
MySQL: server blocks the host after too many failed connection attempts "The MySQL server has blocked this host after too many failed connection attempts. Run 'TRUNCATE TABLE performance_schema.host_cache' on the database server (or 'FLUSH HOSTS' on MySQL 8.2 and earlier), or raise its max_connect_errors, then try again."
MySQL: query fails or returns data that cannot be ingested "The query failed or returned data that cannot be ingested. Check your SQL and ensure every column returns a scalar value."
MySQL: access denied while running the query "Access was denied while running the query. Verify the credentials and that the account can read every table in the query. Open Connector runs queries read-only, so statements that write data are always rejected."
MySQL: query cannot complete for another reason "The query could not be completed."
MySQL: nested or structured column in the result "Query result contains nested or structured data and cannot be ingested. Open Connector requires a flat table - every column must contain a scalar value (text, number, or date). Remove or flatten any nested fields, JSON columns, or arrays in your SQL query and try again."
MySQL: duplicate column names in the result "Duplicate column name '<column>'"
MySQL: field value larger than 300 KiB "field larger than field limit (307200)"
MySQL: query runs longer than 600 seconds without returning rows An error that contains "lost connection". This error usually means that the server ended a slow query, not that the network failed.

Note: For Microsoft SQL Server, Tenable Exposure Management retries transient connection failures automatically. It does not retry authentication, permission, or SQL errors.

Note: For MySQL, Tenable Exposure Management retries transient connection failures automatically. It does not retry authentication, permission, or SQL errors.

Related topics: