Skip to main content
Baton-SQL is a configuration-only connector for SQL databases. Use it for internal user directories, custom applications, or legacy systems where you have database access but no API.

Supported databases

  • PostgreSQL
  • MySQL
  • Microsoft SQL Server
  • Oracle
  • SAP HANA
  • SQLite
  • Amazon Redshift
  • IBM DB2 (available on request — contact C1’s support team for a binary)

Resources

Configuration overview

Baton-SQL uses a YAML configuration file that defines:
  • Database connection details
  • Resource types to sync (users, groups, roles)
  • Entitlements that can be granted
  • Grants that map principals to entitlements
  • Provisioning rules for granting/revoking access

Database connection

You can configure the connection using structured fields or a DSN string.

Structured connection

DSN connection string

DSN examples by database:
IBM DB2 requires a separate binary bundled with IBM’s client driver and isn’t available from the standard download center. Contact C1’s support team to request a DB2-enabled binary. Customers connecting to DB2 are responsible for providing their own IBM Db2 Connect license where required.

Kerberos authentication for SQL Server

If your SQL Server accepts only Active Directory logins, authenticate with a Kerberos keytab instead of a SQL username and password. Set authenticator=krb5 and point the connector at a keytab and a krb5.conf:
The DSN carries a username and no password. The same connection in structured form:
Keep the database name in the query string. connect.database becomes the URL path, which SQL Server reads as an instance name: the connector then requests the service principal MSSQLSvc/<host>:<database> and the login fails. The connector reads the keytab and krb5.conf from its own filesystem, so both files must exist wherever the connector runs. Mount them into the container when you run it in Kubernetes. Supplying a password alongside the keytab selects password authentication and leaves the keytab unused. To use an existing credential cache instead of a keytab, set krb5-credcachefile.

Servers whose SPN doesn’t match the DSN host

The connector requests MSSQLSvc/<host>:<port>, built from the DSN. When the service principal is registered under a different name — an alias, an availability group listener, a cluster VIP — set serverspn to the registered principal:
Without it the KDC returns KDC_ERR_S_PRINCIPAL_UNKNOWN, naming the principal the connector asked for rather than the one that exists.
Kerberos authentication requires baton-sql v0.6.5 or later.

Listing resources

The list section defines how to query resources from your database:

Field mapping

Field mappings use CEL (Common Expression Language) to transform data. The dot syntax references columns from the query result:

Pagination

  • offset: Uses LIMIT and OFFSET in SQL queries
  • cursor: Fetches records after a certain key value

Entitlements

Entitlements define permissions that can be granted to resources.

Entitlement purpose

The purpose field tells C1 how to interpret an entitlement:

Static entitlements

Static entitlements are predefined in the configuration:

Dynamic entitlements

Dynamic entitlements are discovered from the database:

Grants

Grants define which principals have which entitlements:
The ?<group_id> syntax binds the current resource ID to the query parameter.

Conditional grant mapping

Use skip_if to conditionally skip grant mappings:

Provisioning

Provisioning defines how to grant and revoke access.

Grant and revoke

Account provisioning

Create new accounts through C1:

Password constraints

Use constraints under random_password to enforce character set rules on generated passwords. Each entry specifies a set of characters and the minimum number of those characters that must appear. When defined, these constraints replace any constraints provided by the platform.
The min_length, max_length, and disallowed_characters fields on random_password are deprecated. They are accepted for backwards compatibility but have no effect — password length is controlled by the platform, and character set rules should be defined using constraints instead.

Credential rotation

Rotate credentials for existing accounts:

Running the connector

One-shot mode (local testing)

The baton commands inspect the sync output. For more about the baton CLI, see Understand the tools.

Service mode with C1

Common flags: For deployment instructions, see Deploy a self-hosted connector.

Complete example

Find more examples in the baton-sql repository.