Configure RBAC with Teleport
On this page
The Teleport integration provides secure and certificate-based access to SingleStore via the Teleport Database Service.
How the Teleport Integration Works
Teleport uses a proxy service that routes traffic from database clients to the SingleStore database using mutual TLS (mTLS).
The Teleport Database Service verifies the identity of the SingleStore databases by checking their TLS certificates against either the Teleport database CA or a custom CA configured for the database.
Teleport authenticates using mutual TLS (mTLS).
Prerequisites
-
An active Teleport cluster.
Verify connectivity to the Teleport cluster. To test connectivity: -
Run
tsh loginto sign in.For example: tsh login --proxy=<Teleport_cluster_endpoint> --user=<Teleport_username> -
Run
tctl status.Typically, if this command runs successfully, other tctlcommands will run as expected.
-
-
An active SingleStore deployment with "Upload a CA Bundle" feature enabled.
-
A host to run the Teleport Database Service.
-
Install the
mariadbormysqlcommand-line client.
Configure the Teleport Connection
Perform the following tasks to configure the connection between Teleport and SingleStore:
-
Create a Teleport database token.
-
Export Teleport CA.
-
Configure SingleStore.
-
Create a local Teleport User.
-
Configure and start Teleport Database Service.
-
Connect to SingleStore.
Once the connection is successfully configured, use Teleport to manage access to the SingleStore databases.
Create a Teleport Database Token
The Teleport Database Service requires a token to connect to the Teleport cluster.
tctl tokens add --type=db --format=text
Copy and store the generated token in /tmp/token on the server that will run the Teleport Database Service.
Export Teleport CA
To enable SingleStore to accept and validate client certificates issued by Teleport, export the Teleport CA and configure SingleStore to use it for client certificate verification.
Run the following command to export the Teleport CA bundle to a file, say teleport-db-client.
tctl auth export --type=db-client > teleport-db-client.pem
Configure SingleStore
Upload the Teleport CA Bundle
Upload the exported Teleport CA bundle to SingleStore to enable client verification for MTLS/X509.
-
Log in to the Cloud Portal and select your deployment.
-
On the Security tab, select Upload CA Bundle.
-
Upload the teleport-db-client.
pem file exported earlier.
Upon successful upload, the CA Bundle uploaded message is displayed.
Create/Update a Database User
Teleport uses a certificate to authenticate database users.
-
To create a new SingleStore database user:
CREATE USER 'jane'@'%' REQUIRE SUBJECT '/CN=jane';Provide the necessary privileges to the new database user.
For example: GRANT ALL PRIVILEGES ON dbTest.* TO 'jane'; -
Update an existing user:
ALTER USER 'jane'@'%' REQUIRE SUBJECT '/CN=jane';-- Remove the password for the userSET PASSWORD FOR 'jane'@'%' = PASSWORD("");
Create a Local Teleport User
Use the tctl users add command to create a local Teleport user.
tctl users add \--roles=access \--db-users="*" \--db-names="*" \jane
This command creates a local Teleport user named jane with the built-in access role and access to all the databases and database user names.
Configure and Start Teleport Database Service
Install and configure Teleport on the Linux server where Teleport Database Service will run.
Install on a Linux Server
-
To install a Teleport Agent on a Linux server, run the Teleport cluster's install script.
The script selects the correct version, edition, and installation mode for the cluster. For example: curl "https://<Teleport_cluster_hostname>:<port>/scripts/install.sh" | sudo bashUpdate the Teleport cluster hostname and port before running the command.
-
Generate a configuration file at
/etc/teleport.for the Teleport Database Service.yaml -
Download the SingleStore CA from https://portal.
singlestore. com/static/ca/singlestore_ bundle. pem. -
Run the following command to generate the configuration file.
Specify the SingleStore CA file in the --ca-cert-fileoption.Note
A single Teleport process can run multiple services.
The following command overwrites any existing configuration file. If you're running multiple services, add --output=stdoutto print the configuration in the terminal, and then manually adjust/etc/teleport..yaml sudo teleport db configure create \-o file \--token=/tmp/token \--proxy=example.teleport.sh:443 \--name=example-singlestore \--protocol=mysql \--uri=<singlestore_endpoint>:3306 \--ca-cert-file="/path/to/singlestore_bundle.pem" \--labels=env=devwhere,
-
--proxy: Host and port of the Teleport Proxy Service. -
--uri: Endpoint of the SingleStore deployment.Refer to SingleStore Helios Endpoints to determine the endpoint (
host:port) of your deployment.
-
-
-
Configure the Teleport Database Service to automatically start when the system starts.
-
If Teleport is installed using a package manager, run the following commands:
sudo systemctl enable teleportsudo systemctl start teleport -
If Teleport is installed using a tar archive, run the following command:
sudo teleport install systemd -o /etc/systemd/system/teleport.servicesudo systemctl enable teleportsudo systemctl start teleport
Run the
systemctl status teleportcommand to view the status of the Teleport Database Service. -
Connect to SingleStore
Once the Teleport Database Service is added to the cluster, run the following commands to log in to Teleport and view the databases accessible to the current user.
tsh login --proxy=teleport.example.com --user=janetsh db ls
Name Description Labels
------------------- ------------------- -------
example-singlestore Example SingleStore env=devTo connect to a database, run the tsh db connect command.
tsh db connect --db-user=jane --db-name=<database> example-singlestore
This command retrieves the credentials for a database and connects to it.
Note
The mysql or mariadb command-line client must be available in the system PATH to establish a connection.mariadb is the default command-line client for SingleStore.
To log out of a database and remove the credentials, run the following command:
# Remove credentials for a specific database instance.tsh db logout <database-name># Remove credentials for all database instances.tsh db logout
Last modified: December 11, 2025