Skip to content

Sensitive-data scan targets

This guide shows you how to let QubeSight connect to your database servers with a read-only account, sample their tables and classify sensitive columns (personal, payment, health, financial and credential data). It covers the supported databases, the scan account, TLS, scheduling and sampling, what is read and stored, and the related assistant review and masking credentials.

Enterprise

Active scanning requires the capability active_sensitive_scan. Sensitive-data discovery from logs, which needs no database account, is available in both editions; see Sensitive Data. The assistant review of findings (sensitive_ai_review) and applying masks (data_masking) are also Enterprise; masking suggestions can be read in Community.

How a scan works

flowchart LR
    L[Audit logs] -->|every 6 h| T[Scan targets]
    T -->|read-only account| C[Catalog: databases, tables, columns]
    C --> N[Name rules]
    C --> S[Random sample per table]
    S --> V[Value rules: regex, lists, check digits]
    N --> F[Findings]
    V --> F
    F --> K[Sensitive-data catalog and groups]
  1. Targets from logs. Database servers seen in the audit logs (restored archives included) are added automatically as targets every 6 hours, with engine, address, port and, for Oracle, the service name. You can also add a server by hand.
  2. Catalog. QubeSight connects read-only and reads the databases, tables and columns the account can see. System databases are skipped.
  3. Sampling. For each table it reads a random sample (default 100 rows): small tables are shuffled, large tables use the engine's block sampling (PostgreSQL and SQL Server TABLESAMPLE, Oracle SAMPLE BLOCK, MongoDB $sample). If random sampling is not possible (views, MySQL large tables, missing privileges), the first rows are read. Wide tables are sampled in parts of 60 columns, up to 300 columns.
  4. Classification. Table and column names, and the sampled values, are checked against the classification rules in memory.
  5. Storage. Only the match count, the ratio and a masked shape (for example NNNN NNNN NNNN NNNN) are stored. Sampled values are never stored.
  6. Catalog and groups. Findings update the sensitive-data catalog and the sensitive-data groups used by alert rules and reports.

QubeSight runs only SELECT statements. PostgreSQL sessions are read-only (default_transaction_read_only), MySQL uses a read-only transaction, and SQL Server reads use NOLOCK with a lock timeout.

Supported databases

Engine Default port Notes
PostgreSQL 5432 Materialized views are scanned too.
MySQL / MariaDB 3306
Microsoft SQL Server 1433
Oracle 1521 Service name (required). For TLS (TCPS), select require or verify and enter the TCPS port.
MongoDB 27017 Schemaless: fields are derived from sampled documents; nested fields appear as a.b.
Couchbase 8093 (query service) Uses N1QL; each collection needs a primary index.

The connectors are built into QubeSight; no client libraries, ODBC or JDBC drivers need to be installed. Other engines seen in the logs (for example DB2 or Sybase) show as Unsupported and are monitored as log sources only.

Prerequisites

  • An Enterprise licence.
  • The Administrator role to add targets, enter credentials, start scans and change settings. Administrators, analysts, DBAs and auditors can read results.
  • Network access from the QubeSight nodes to each database port. Restrict the scan account to the QubeSight addresses if you can.
  • A dedicated, least-privilege, read-only scan account on each server. Do not use an administrator or application account.
  • For TLS verify: the server certificate must match the address, and an internal CA in PEM format if it is not publicly trusted.
  • The server encryption key (GUARDIUM_SECRET_KEY, set by the installer). Without it, the Active scan tab warns that passwords are encrypted with the default key.

Create the scan account

The How to create a scan account dialog on the Active scan tab gives a script for each engine. The required privileges are:

Engine Privileges
PostgreSQL A LOGIN role with default_transaction_read_only; CONNECT on each database, USAGE on schemas and SELECT ON ALL TABLES.
MySQL / MariaDB SELECT on *.*, or only on the schemas to scan.
SQL Server VIEW ANY DEFINITION and db_datareader in each database.
Oracle CREATE SESSION, SELECT_CATALOG_ROLE and SELECT on the schemas or tables to scan.
MongoDB readAnyDatabase and clusterMonitor (in admin).
Couchbase Query Select, Query System Catalog and Data Reader; a primary index on each collection.

Tables the account cannot read are skipped and the run ends as partially complete, with a warning in the target's history.

Add credentials to a target

  1. Go to Assurance Center → Sensitive Data → Discovery and open Active scan.
  2. The Scan targets list shows servers found in the logs (auto) and added by hand (manual). A banner lists servers waiting for a scan account. Use Rediscover from logs to refresh the list now, or Add server to add one (the address must be a host name or IP only).
  3. Click a target row and open Connection & credentials.
  4. Enter Username and Password of the scan account. For a MongoDB server whose authorization is disabled, you can instead switch on No authentication (server authorization disabled).
  5. Click Test connection. Errors are classified (authentication, network, TLS, permission, timeout, configuration) with a hint.
  6. Click Save and scan. The first scan starts immediately.

The password is stored encrypted, is never shown again and is not written to the audit log. If you change the address or port of a target, the stored password is removed and must be entered again. Change account replaces it; Remove credentials stops scanning that server.

Scan target detail, Connection & credentials tab: server, TLS mode, the scan account entered and the result Connection successful with the server version and the databases found.

TLS for scan connections

Choose Connection encryption (TLS) on the target's Settings tab.

Mode Behaviour
verify — TLS + certificate validation (recommended) Default for new and discovered targets. The certificate is validated against CA certificate (PEM, optional) (or the system trust store) and the address.
require TLS required, certificate not validated. Listed as unprotected (open to MITM).
prefer TLS if available, certificate not validated; with a password it behaves like require and never falls back to plain text. On Oracle, prefer is a plain connection.
disable No encryption.

Only verify protects the scan account against a man-in-the-middle on the network.

Target settings

On the target's Settings tab:

Field Description
Name, Server address, Port Port hint shows the default and the ports seen in logs.
Service field Label depends on the engine: Service name (required) for Oracle, Maintenance database (optional) for PostgreSQL, Initial database (optional) for SQL Server, Authentication database (default admin) for MongoDB.
Only these databases Empty means all. Comma-separated; * wildcards allowed.
Excluded databases For example test_*, tmp.
Content scan, sample rows, interval Per-target overrides; 0 uses the global setting.
Include this target in scheduled scans Turns scheduled scanning on or off for this server.

Fields you change by hand are not overwritten by automatic discovery. Automatically discovered targets cannot be deleted; use Ignore (and Stop ignoring). Targets added by hand can be deleted with their findings.

Global scan settings and scheduling

Open Scan settings on the Active scan tab.

Setting Default Range
Scheduled automatic scanning is on on —
Value sampling (content scan) on (off means names and metadata only) —
Scan interval (hours) 24 1–720
Sample rows per table 100 10–1000
Max tables sampled per database 0 (no limit) 0 or 10–100,000
Concurrent scans 2 1–8
Discovery interval (hours) 6 1–168

Scan now on a target accepts Sample rows for that run only (10–10,000). Cancel scan stops a running scan; the next scheduled scan is moved one interval ahead. After a failure, retries back off (15 minutes, doubling, never beyond the interval). The built-in alert rule for scan failures fires after 3 consecutive failures and resolves on the next successful scan.

Classification rules

Rules live under Assurance Center → Sensitive Data → Classification rules, where you can disable built-in rules, add your own and try a rule with Try the rule before saving. Rule types:

  • Table name and column name word lists (payment card, national ID, tax number, IBAN, password, e-mail, phone, address, name, birth date, health, finance and more).
  • Value rules: RE2 regular expressions with optional check-digit validation (for example Luhn for cards, the Turkish national ID check, IBAN mod 97, SNOMED and LOINC checks), and value lists (for example blood groups or first and last names).
  • A value rule matches a column when at least 20 % of non-empty sampled values and at least 3 values match, unless the rule sets other thresholds.
  • Context: in a table linked to a person in a health record, dates, locations, record numbers, payments and clinical codes are classed as health data (shown as context).

Findings appear with Location, Column and Evidence (value, column name or context). See Sensitive Data and Groups.

Assistant review of findings

Assurance Center → Sensitive Data → Assistant review lets a language model check each finding and give a confidence: Correct (90 % or more), Needs review (31–89 %) or Likely wrong (30 % or less). It is off by default; an administrator enables it with Enable and configure.

Setting Default
Model that assesses Local model (Gemma 3 4B); or Active large model (see LLM providers), with fallback to the local model
Sample data sent to the local model Real values + table rows (recommended): a few values per column and up to 5 rows of 12 columns; data never leaves the server
Sample data sent to the large model Value shapes (recommended); Real values are sent only if the provider's data policy is Open; table rows are never sent to a large model
Samples per column 5
Findings per prompt (local model) 8
Prompts per minute at most 20

Samples are read live with the target's scan account and are never stored. On the local model a prompt of 8 findings takes about 2 minutes. Marking a finding as False positive adds a rule exception, as on the Sensitive data tab.

Masking credentials

Findings of actively scanned targets become masking suggestions under Assurance Center → Sensitive Data → Masking. Masks use the database's own feature: SQL Server Dynamic Data Masking, Oracle Data Redaction, PostgreSQL Anonymizer, or a masked view for MySQL and MongoDB. Couchbase is not supported.

The scan account stays read-only. To let QubeSight apply masks directly, enter a separate Masking credential with write privileges on that target (the dialog offers a Least-privilege script). Without it, the target is in DDL export only mode: Download DDL gives the apply and rollback commands as a .sql file for your DBA. Apply and rollback ask for your own password again and are audited.

Verify

  1. The target's state changes to Scanning, then Scanned, with the number of databases, tables and sensitive columns.
  2. The History tab lists each run with Started, Duration, Trigger and Notes / warnings.
  3. The Databases tab shows each database's source (read from the server, seen in logs only, system, excluded or missing) and its tables, columns and sampled tables.
  4. The Sensitive data found (N) button at the top of the Discovery tab opens Sensitive Data → Sensitive data, which lists the findings with their evidence and masked shapes.

Troubleshooting

Symptom What to check
Credentials required Enter a scan account on Connection & credentials.
Authentication failed User name, password, and for MongoDB the Authentication database (default admin).
TLS failed in verify mode Paste the CA in CA certificate (PEM, optional); the certificate must match the address. If the certificate has no IP entry, use the host name as the address.
The server does not support TLS Choose another mode only if the network is trusted; the target is then marked unprotected.
Oracle cannot connect Enter the Service name (required); for TLS use require or verify with the TCPS port.
Couchbase finds no fields Create a primary index on each collection.
Run ends partially complete The account cannot read some tables; see History.
The account cannot see any database Grant CONNECT / database access to the scan account.
Wrong port discovered from logs Correct it on Settings and enter the password again.

Limitations

  • No TLS server-name override: in verify mode, the certificate must match the address you enter.
  • Only the objects the scan account can see are scanned.
  • When random sampling is not possible, the first rows are read and may not represent the whole table.
  • At most 300 columns per table are sampled.
  • MongoDB and Couchbase fields are inferred from sampled documents; rarely used fields can be missed.
  • Running scans add read load to the database; use Concurrent scans, Sample rows per table and the interval to limit it.