Skip to content
Menu

Data-source connection security

View .md

Beacon connects to your databases and APIs with credentials an administrator typed in. Those connections are a security boundary, so Beacon checks each one when it is saved and again when it is used. This page lists what is accepted, what is refused and which settings change the behaviour.

Three checks run on every connection:

  1. Transport. The connection must authenticate the server over TLS.
  2. Driver options. Options that read files on the Beacon host, load code, sign in as the Beacon host or leak values are refused.
  3. Hosts. When Beacon:DataSources:AllowedHosts is set, every host the connection names must be on the list.
flowchart LR
    A[Connection saved or used] --> B{Disabled?}
    B -- yes --> X[DataSourceDisabledException]
    B -- no --> C{Transport check}
    C -- fails --> R[Refused or Warning]
    C -- passes --> D{Option check}
    D -- fails --> R
    D -- passes --> E{AllowedHosts}
    E -- fails --> R
    E -- passes --> F[Connect through the outbound address guard]

A refusal is a DataSourceTransportException. Its message names the option and says what to change. It never contains a value from the connection.

Each connector has a transport inspector that parses the connection with the driver’s own builder.

EngineRequiredRefused option named in the message
PostgreSQLSSL Mode=VerifyFullSSL Mode
MySQLSslMode=VerifyFullSslMode
SQL Server, Azure SynapseEncrypt=Mandatory or Strict (or Encrypt left out), and no TrustServerCertificate=trueEncrypt, TrustServerCertificate
Snowflakeno insecureMode=true, certRevocationCheckMode left at ENABLED, scheme left at httpsinsecureMode, certRevocationCheckMode, scheme
API connectorBaseUrl and OpenApiSpecUrl are absolute https:// URLsBaseUrl, OpenApiSpecUrl
Databricks, BigQuery, CloudWatchalways pass (these clients use HTTPS only)none

A data source type with no registered inspector is never verified. It counts as unverified and follows the same new and stored rules below.

# PostgreSQL
Accepted: Host=db.example.com;Database=sales;Username=beacon_ro;Password=<secret>;SSL Mode=VerifyFull
Refused: Host=db.example.com;Database=sales;Username=beacon_ro;Password=<secret>;SSL Mode=Require
# MySQL
Accepted: Server=db.example.com;Database=sales;User=beacon_ro;Password=<secret>;SslMode=VerifyFull
Refused: Server=db.example.com;Database=sales;User=beacon_ro;Password=<secret>;SslMode=Required
# SQL Server and Synapse
Accepted: Server=db.example.com;Database=sales;User Id=beacon_ro;Password=<secret>;Encrypt=True;TrustServerCertificate=False
Refused: Server=db.example.com;Database=sales;User Id=beacon_ro;Password=<secret>;Encrypt=True;TrustServerCertificate=True
# Snowflake
Accepted: account=example-org;user=beacon_ro;password=<secret>;db=SALES
Refused: account=example-org;user=beacon_ro;password=<secret>;db=SALES;insecureMode=true

API connector connection data (JSON):

{
"BaseUrl": "https://api.example.com/v1",
"OpenApiSpecUrl": "https://api.example.com/v1/openapi.json",
"Auth": { "Type": "Bearer", "Token": "<token>" }
}

Changing BaseUrl to http://api.example.com/v1 is refused with Beacon requires a data-source connection that authenticates the server over TLS. Set BaseUrl to an absolute https:// URL.

Beacon requires a data-source connection that authenticates the server over TLS. {Remedy}.
Beacon does not accept the data-source connection option {Option}. {Remedy}.
Beacon:DataSources:AllowedHosts is set, and Beacon cannot tell which hosts this connection reaches. Name the server's host explicitly.
The connection reaches a host that Beacon:DataSources:AllowedHosts does not list. Connect to a listed host, or ask the operator to add it.

A connection string the driver cannot read is refused with the option name connection string and the remedy “Enter a connection string the engine’s driver can read”.

A second inspector, per engine, reads the options. Each refused option has one of two risks.

  • Unsafe options are always refused. Only Beacon:DataSources:Transport:AllowInsecure lifts them.
  • Host credential options make the connection sign in as the Beacon host or read the host’s files. They are refused unless Beacon:DataSources:AllowHostCredentials is true.
EngineAlways refusedRefused unless AllowHostCredentials
PostgreSQLOptions, Passfile, Include Error Detail, Log Parametersa Unix-socket Host (starts with / or @), GSS Encryption Mode=Require, a Require Auth that admits GSS or SSPI, SSL Certificate, SSL Key, SSL Password, an empty Password
MySQLAllowLoadLocalInfile, AllowLoadLocalInfileInPath, CommandInterceptors, ExceptionInterceptorsIntegratedSecurity, DefaultAuthenticationPlugin set to a Kerberos, Windows or OCI plugin, OciConfigFile, CertificateStoreLocation, a .pfx CertificateFile (the same as SslCa), CertificatePassword, SslCert, SslKey, a ConnectionProtocol other than TCP, an empty Password
SQL Server, SynapseAttachDBFilename, User Instance, interactive Authentication (ActiveDirectoryInteractive, device code)Integrated Security, any Authentication other than SqlPassword, ActiveDirectoryPassword or ActiveDirectoryServicePrincipal, Column Encryption Setting=Enabled, a Data Source starting with np:, lpc: or (localdb)
Snowflakeclient_config_file, disable_saml_url_check=true, authenticator externalbrowser or oauth_authorization_codeauthenticator workload_identity, private_key_file
BigQuerya credential that is not a service account key, or a key whose token_uri, universe_domain or other URLs are not Google’sno ServiceAccountJson at all (signs in with the host’s application default credentials)
Databricksa Host that is not a bare host name (no scheme, port, path, query or user part)none
CloudWatcha Region that is not an AWS region namea ProfileName, or no AccessKeyId and SecretAccessKey (uses the host’s profile or IAM role)
API connectornonenone

A CA file only verifies the server, so it needs no option. These are accepted without AllowHostCredentials: PostgreSQL Root Certificate, MySQL SslCa with a PEM file (not .pfx), and SQL Server ServerCertificate. A client certificate or key is different: it proves who the Beacon host is, so it is a host credential option.

The MySQL driver Beacon pins has no SSH tunnel options. Its builder refuses them, so a connection that sets them is unreadable and refused.

Beacon:DataSources:AllowedHosts is a list. Empty means unrestricted, which is the default.

EntryMatches
db.example.comexactly that host, ignoring case
203.0.113.10that IP address, compared in canonical form
*.example.comany host below example.com, not example.com itself

Rules:

  • Matching is by name. Beacon does not pin the resolved address.
  • A host that is not a bare ASCII name or IP address matches nothing. Write internationalised names in their xn-- form.
  • AllowInsecure never lifts this list.
  • While the list is set, a connection whose hosts Beacon cannot determine is refused. A MySQL DnsSrv lookup is one such case.
  • Snowflake counts the account host (underscores become hyphens unless allowunderscoresinhost), the proxy host when useproxy is on, an Okta authenticator host and the OAuth token, authorization and redirect hosts. BigQuery counts the key’s token_uri host. Databricks counts Host. SQL Server counts Data Source and Failover Partner.
  • A host-managed source gets the host check only, never the option check.

Startup fails on a bad entry:

Beacon:DataSources:AllowedHosts entries 1 are not host names: use a host name, an IP address or *.example.com, without a scheme, port or path.
CaseWhat happens
New or changed connection (create, update, test-connection)Refused with DataSourceTransportException.
Stored connection that fails a checkKeeps working. One Warning per data source per process.
Stored connection with Beacon:DataSources:Transport:EnforceOnExisting onRefused when it becomes a live connection. One Warning per data source per process.

The Warnings name the data source id and the option, never a value:

Data source 7 connects without authenticating the server over TLS (SSL Mode). It keeps working until its connection is replaced; Beacon:DataSources:Transport:EnforceOnExisting refuses it

Stored connections are checked in IDataSourceConnectionResolver (GetConnectionString, GetConnectionData, and GetWriteConnectionString for the migration writer). Nothing else decrypts a stored connection to connect.

KeyTypeDefaultRangeWhat it does
Beacon:DataSources:Transport:EnforceOnExistingboolfalsetrue or falseRefuse stored connections that fail the transport or option check.
Beacon:DataSources:Transport:AllowInsecureboolfalsetrue or falseLift the transport check, the always-refused options and the loopback block. For development hosts only. Logs a startup Warning outside Development.
Beacon:DataSources:AllowHostCredentialsboolfalsetrue or falseAllow options that sign in as the Beacon host.
Beacon:DataSources:AllowedHostsstring listemptyhost, IP or *.domainHosts a connection may name. Empty means any.
Beacon:DataSources:Outbound:AllowPrivateNetworksbooltruetrue or falseLet the API connector and Databricks clients reach private addresses.
Beacon:DataSources:Outbound:AllowLoopbackboolfalsetrue or falseLet them reach loopback. AllowInsecure also lifts this.
Beacon:Notifications:Nat64Prefixesstring listemptyIPv6 /96 with no host bits setExtra NAT64 prefixes. The address inside is judged as its IPv4 address.

Environment variable form:

Terminal window
Beacon__DataSources__Transport__EnforceOnExisting=true
Beacon__DataSources__AllowedHosts__0=db.example.com
Beacon__DataSources__AllowedHosts__1=*.warehouse.example.com

JSON form:

{
"Beacon": {
"DataSources": {
"AllowHostCredentials": false,
"AllowedHosts": [ "db.example.com", "*.warehouse.example.com" ],
"Transport": { "EnforceOnExisting": true },
"Outbound": { "AllowPrivateNetworks": true, "AllowLoopback": false }
}
}
}
KeyDevelopmentProductionRegulated profile
Transport:EnforceOnExistingfalsetruemust be true
Transport:AllowInsecuretrue only on a laptopfalsemust not be true
AllowHostCredentialsfalsefalsemust not be true
AllowedHostsemptylist every hostmust be non-empty

The API connector and Databricks use named HTTP clients (ApiConnectorHttpClient.Name and BeaconHttpClients.Databricks). Their connect callback (OutboundAddressGuard) resolves the host, drops every address the rules refuse, and connects only to an address it checked. A DNS answer that changes between the check and the connect cannot redirect the call.

Address classResult
Link-local and cloud metadata, unspecified, multicast, reservedAlways refused, also in IPv6 forms (mapped, translated, compatible, NAT64, 6to4)
LoopbackRefused unless Outbound:AllowLoopback or Transport:AllowInsecure
Private networks (10/8, 172.16/12, 192.168/16, 100.64/10, fc00::/7)Allowed unless Outbound:AllowPrivateNetworks is false
NAT64 under 64:ff9b::/96 and your Nat64PrefixesJudged by the IPv4 address inside

HTTP/3 is off. Through a system proxy the destination is checked before sending. A refusal is a DataSourceTransportException that names the rule, never the address or URL.

  • No redirects, no cookies, no request logging.
  • A query cannot set routing, method-override, framing or credential headers: Host, Forwarded, Via, X-Real-IP, X-Client-IP, True-Client-IP, CF-Connecting-IP, X-Cluster-Client-IP, Fastly-Client-IP, X-Original-URL, X-Rewrite-URL, X-Original-Host, X-Host, X-HTTP-Method, X-HTTP-Method-Override, X-Method-Override, Content-Length, Transfer-Encoding, TE, Trailer, Connection, Keep-Alive, Upgrade, Expect, Authorization, Cookie, and any X-Forwarded-* or Proxy-*.
  • Header names must be HTTP tokens. Header values must not hold control characters.
  • Paths must not hold . or .. segments (also percent-encoded, or behind a ; path parameter), control characters, # or ?. The resolved URL must stay under the base URL’s path.
  • The data source’s own credentials (a token, API key value or password of 8 or more characters, in plain, URL-encoded and JSON-escaped forms) are replaced with *** in responses before tabularising.
  • A new connection with Auth.ApiKeyLocation set to Query is refused: Send the API key in a header (Auth.ApiKeyLocation Header): a key in the query string travels in every request URL, which servers and proxies log, and an API that echoes its URL returns it. A stored one logs one Warning per source per process.

PUT /beacon/api/data-sources/{id} replaces a connection in place. It needs the DataSourceAdmin permission (an Admin has it). The stored connection is never returned. A null or empty connectionString keeps the stored one.

PUT /beacon/api/data-sources/7
Content-Type: application/json
{
"name": "Sales (read-only)",
"databaseEngineType": "PostgreSQL",
"connectionString": "Host=db.example.com;Database=sales;Username=beacon_ro;Password=<new secret>;SSL Mode=VerifyFull",
"confirmTargetChange": false
}

Same engine, host, port and database: the answer is 204 No Content. The old driver pool is emptied.

If the new connection points at another engine, host, port or database, or Beacon cannot read the target, the answer is 409 Conflict until the body sets confirmTargetChange to true:

The new connection points at another server, port, database or engine. Confirm the target change to save it: the column values sampled from the old target are removed.

A confirmed change removes the sampled column values of the old target and enqueues a metadata re-scan. The old tables stay visible until it finishes. An engine change needs the connection entered again. Host-managed sources are refused.

PUT /beacon/api/data-sources/7/enabled
Content-Type: application/json
{ "enabled": false }

The answer is 204 No Content, at once, without a second approval. A disabled source makes no connection. Every resolver path refuses it first, before decrypting or checking transport, with DataSourceDisabledException:

This data source is disabled: Beacon makes no connection with it until a DataSourceAdmin enables it again.

Queries, previews, subscription runs, data-quality checks, MCP tools, AI paths and metadata scans on it fail. A subscription run is recorded as failed with the comment Failed: a data source this query reads is disabled. The stored catalog is not served and cached metadata is evicted. Host-managed sources cannot be disabled.

When ApprovalWorkflow.CoversDataSourceConnections is on, a new data source is saved held, and a change to any non-secret setting waits for a second person. A change to the secrets alone is still an immediate rotation. See Approvals for the four-eyes rules and how a held source is released.

Every action is staged in the security audit trail with ids, counts, flags and codes only. See Audit trail.

ActionWhen
data_sources.data_source_createdA source is created.
data_sources.data_source_updatedA source is edited and the connection did not change. Names the changed fields and whether the target changed.
data_sources.credentials_rotatedThe connection changed.
data_sources.data_source_deletedA source is deleted.
data_sources.data_source_disabledA source is disabled.
data_sources.data_source_enabledA source is enabled again.
SymptomCause and fix
... authenticates the server over TLS. Set SSL Mode to VerifyFullSet the mode named in the message, and make sure the server certificate chains to a CA the Beacon host trusts. Add a CA file option if it does not.
Beacon does not accept the data-source connection option XRemove the option, or for a host credential option ask the operator to set AllowHostCredentials.
The hosts cannot be toldName the server host directly instead of a DNS SRV lookup.
Warning per stored source after upgradeReplace the connection, or turn off EnforceOnExisting until you do.
409 on updateThe target changed. Send confirmTargetChange: true if that is intended.
API source refused for ApiKeyLocation.QuerySend the key in a header.
Outbound refusal naming a ruleThe address is link-local, loopback or private. Change the host or the Outbound settings.