Database Access with Oracle
Teleport can provide secure access to Oracle via the Teleport Database Service. This allows for fine-grained access control through the Teleport RBAC system.
The Teleport Database Service proxies traffic from database clients to self-hosted databases in your infrastructure. Teleport maintains a certificate authority (CA) for database clients. You configure your database to trust the Teleport database client CA, and the Teleport Database Service presents certificates signed by this CA when proxying user traffic. With this setup, there is no need to store long-lived credentials for self-hosted databases.
Meanwhile, the Teleport Database Service verifies self-hosted databases by checking their TLS certificates against either the Teleport database CA or a custom CA used with the database.
In this guide, you will:
- Configure your Oracle database for Teleport access.
- Add the database to your Teleport cluster.
- Connect to the database via Teleport.
How it works
The Teleport Database Service authenticates to your self-hosted Oracle database using mutual TLS. Oracle trusts the Teleport certificate authority for database clients, and presents a certificate signed by either the Teleport database CA or a custom CA. When a user initiates a database session, the Teleport Database Service presents a certificate signed by Teleport. The authenticated connection then proxies client traffic from the user.
- Teleport Enterprise
- Teleport Enterprise Cloud
Prerequisites
-
A running Teleport Enterprise cluster. If you want to get started with Teleport, sign up for a free trial or set up a demo environment.
-
The
tctlandtshclients.Installing
tctlandtshclients-
Determine the version of your Teleport cluster. The
tctlandtshclients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at/v1/webapi/findand use a JSON query tool to obtain your cluster version. Replace teleport.example.com:443 with the web address of your Teleport Proxy Service:TELEPORT_DOMAIN=teleport.example.com:443TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')" -
Follow the instructions for your platform to install
tctlandtshclients:- Mac
- Windows - Powershell
- Linux
Download the signed macOS .pkg installer for Teleport, which includes the
tctlandtshclients:curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkgIn Finder double-click the
pkgfile to begin installation.dangerUsing Homebrew to install Teleport is not supported. The Teleport package in Homebrew is not maintained by Teleport and we can't guarantee its reliability or security.
curl.exe -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-windows-amd64-bin.zipUnzip the archive and move the `tctl` and `tsh` clients to your %PATH%
NOTE: Do not place the `tctl` and `tsh` clients in the System32 directory, as this can cause issues when using WinSCP.
Use %SystemRoot% (C:\Windows) or %USERPROFILE% (C:\Users\<username>) instead.
All of the Teleport binaries in Linux installations include the
tctlandtshclients. For more options (including RPM/DEB packages and downloads for i386/ARM/ARM64) see our installation page.curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gztar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gzcd teleportsudo ./installTeleport binaries have been copied to /usr/local/bin
-
- Self-hosted Oracle server instance 18c or later.
- The
sqlclOracle client installed and added to your system'sPATHenvironment variable or any GUI client that supports JDBC Oracle thin client. - Optional: a certificate authority that issues certificates for your self-hosted database.
Step 1/6. Create a Teleport token and user
The Database Service requires a valid join token to join your Teleport cluster.
Run the following tctl command and save the token output in /tmp/token
on the server that will run the Database Service:
tctl tokens add --type=db --format=textabcd123-insecure-do-not-use-this
To modify an existing user to provide access to the Database Service, see Database Access Controls
Create a local Teleport user with the built-in access and requester roles:
tctl users add \ --roles=access,requester \ --db-users=\* \ --db-names=\* \ alice
| Flag | Description |
|---|---|
--roles | List of roles to assign to the user. The builtin access role allows them to connect to any database server registered with Teleport. |
--db-users | List of database usernames the user will be allowed to use when connecting to the databases. A wildcard allows any user. |
--db-names | List of logical databases (aka schemas) the user will be allowed to connect to within a database server. A wildcard allows any database. |
Database names are only enforced for PostgreSQL and MongoDB databases.
For more detailed information about database access controls and how to restrict access see RBAC documentation.
Step 2/6. Create a certificate/key pair and Teleport Oracle Wallet
Teleport uses mutual TLS authentication with self-hosted databases. These databases must be configured with Teleport's certificate authority to be able to verify client certificates. They also need a certificate/key pair that Teleport can verify.
To use issue certificates from your workstation with tctl, your Teleport user
must be allowed to impersonate the system role Db.
Include the following allow rule in in your Teleport user's role:
allow:
impersonate:
users: ["Db"]
roles: ["Db"]
Follow the instructions below to generate TLS credentials for your database.
Export Teleport's certificate authority and a generated certificate/key pair
for host db.example.com with a 3-month validity period.
tctl auth sign --format=oracle --host=db.example.com --out=server --ttl=2190h
In this example, db.example.com is the hostname where the Teleport Database
Service can reach the Oracle server.
We recommend using a shorter TTL, but keep mind that you'll need to update the database server certificate before it expires to not lose the ability to connect. Pick the TTL value that best fits your use-case.
If tctl finds the Orapki tool in your local environment, the tctl auth sign --format=oracle --host=db.example.com --out=server --ttl=2190h command will produce an Oracle Wallet and
instructions how to configure the Oracle TCPS listener with Teleport Oracle Wallet. Otherwise the tctl auth sign --format=oracle command will produce a p12 certificate and instructions on how to create an Oracle Wallet on your Oracle Database instance.
If your Oracle database presents TLS credentials signed by an existing certificate authority, take the following steps instead:
-
Export a Teleport CA certificate for Oracle to authenticate traffic from the Teleport Database Service. Run the following command on your workstation:
tctl auth export --type=db-client --auth-server=example.teleport.sh:443 > server.ca-client.crt -
Move
server.ca-client.crtto a directory in your Oracle server you will use for your Oracle wallet. -
Issue a key and certificate in PKCS12 format for the Oracle server and move the resulting P12 file to
server.p12in your Oracle wallet directory. -
Use the
orapkitool on your Oracle server to set up an Oracle wallet:Assign this to your password
PKCS12_PASS=""WALLET_DIR="/path/to/oracleWalletDir"orapki wallet create -wallet "$WALLET_DIR" -auto_login_onlyorapki wallet import_pkcs12 -wallet "$WALLET_DIR" -auto_login_only -pkcs12file server.p12 -pkcs12pwd ${PKCS12_PASS?}orapki wallet add -wallet "$WALLET_DIR" -trusted_cert -auto_login_only -cert server.ca-client.crt
If copying these files to your Oracle server, ensure the cert file permissions are readable by the oracle user.
Step 3/6. Configure Oracle Database
In order to enable the Teleport Oracle integration you will need to configure the TCPS Oracle listener and use the Teleport Oracle Wallet created in the previous step.
Align your listener.ora Oracle configuration file and add the following entries:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = 0.0.0.0)(PORT = 2484))
)
)
WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = /path/to/oracleWalletDir)))
SSL_CLIENT_AUTHENTICATION = TRUE
Additionally, you will need to extend your sqlnet.ora Oracle configuration:
WALLET_LOCATION = (SOURCE = (METHOD = FILE)(METHOD_DATA = (DIRECTORY = /path/to/oracleWalletDir)))
SSL_CLIENT_AUTHENTICATION = TRUE
SQLNET.AUTHENTICATION_SERVICES = (TCPS)
You will need to reload Oracle Listener lsnrctl reload after updating the listener.ora configuration file.
Additionally, your Oracle Database user accounts must be configured to require a valid client certificate. If you're creating a new user:
CREATE USER alice IDENTIFIED EXTERNALLY AS 'CN=alice';
GRANT CREATE SESSION TO alice;
Step 4/6. Configure and Start the Database Service
Install and configure Teleport where you will run the Teleport Database Service:
- Linux Server
- Kubernetes Cluster
To install a Teleport Agent on your Linux server:
The recommended installation method is the cluster install script. It will select the correct version, edition, and installation mode for your cluster.
-
Assign teleport.example.com:443 to your Teleport cluster hostname and port, but not the scheme (https://).
-
Run your cluster's install script:
curl "https://teleport.example.com:443/scripts/install.sh" | sudo bash
On the host where you will run the Teleport Database Service, start Teleport with the appropriate configuration.
Note that a single Teleport process can run multiple different services, for
example multiple Database Service agents as well as the SSH Service or Application
Service. The step below will overwrite an existing configuration file, so if
you're running multiple services add --output=stdout to print the config in
your terminal, and manually adjust /etc/teleport.yaml.
Run the following command to generate a configuration file at
/etc/teleport.yaml for the Database Service. Update
example.teleport.sh to use the host and port of the Teleport Proxy
Service:
sudo teleport db configure create \ -o file \ --token=/tmp/token \ --proxy=example.teleport.sh:443 \ --name=oracle \ --protocol=oracle \ --uri=oracle.example.com:2484 \ --labels=env=dev
To configure the Teleport Database Service to trust a custom CA:
-
Export a CA certificate for the custom CA and make it available at
/var/lib/teleport/db.caon the Teleport Database Service host. -
Run a variation of the command above that uses the
--ca-cert-fileflag. This configures the Teleport Database Service to use the CA certificate atdb.cato verify traffic from the database:sudo teleport db configure create \ -o file \ --token=/tmp/token \ --proxy=example.teleport.sh:443 \ --name=oracle \ --protocol=oracle \ --uri=oracle.example.com:2484 \ --ca-cert-file="/var/lib/teleport/db.ca" \ --labels=env=dev
If your database servers use certificates that are signed by a public CA such
as ComodoCA or DigiCert, you can use the trust-system-cert-pool option
without exporting the CA:
sudo teleport db configure create \ -o file \ --token=/tmp/token \ --proxy=example.teleport.sh:443 \ --name=oracle \ --protocol=oracle \ --uri=oracle.example.com:2484 \ --trust-system-cert-pool \ --labels=env=dev
Configure the Teleport Database Service to start automatically when the host boots up by creating a systemd service for it. The instructions depend on how you installed the Teleport Database Service.
- Package Manager
- TAR Archive
On the host where you will run the Teleport Database Service, enable and start Teleport:
sudo systemctl enable teleportsudo systemctl start teleport
On the host where you will run the Teleport Database Service, create a systemd service configuration for Teleport, enable the Teleport service, and start Teleport:
sudo teleport install systemd -o /etc/systemd/system/teleport.servicesudo systemctl enable teleportsudo systemctl start teleport
You can check the status of the Teleport Database Service with systemctl status teleport
and view its logs with journalctl -fu teleport.
Teleport provides Helm charts for installing the Teleport Database Service in Kubernetes Clusters.
Configure Helm to fetch Teleport charts from the Teleport Helm repository:
helm repo add teleport https://charts.releases.teleport.dev
Refresh the local Helm cache by fetching the latest charts:
helm repo update
Install a Teleport Agent into your Kubernetes Cluster with the Teleport Database Service configuration.
Create a file called values.yaml with the following content. Update example.teleport.sh to use the host and port of the Teleport Proxy
Service and JOIN_TOKEN to the join token you created earlier:
roles: db
proxyAddr: example.teleport.sh
# Set to false if using Teleport Community Edition
enterprise: true
authToken: "JOIN_TOKEN"
databases:
- name: oracle
uri: oracle.example.com:2484
protocol: oracle
static_labels:
env: dev
To configure the Teleport Database Service to trust a custom CA:
-
Export a CA certificate for the custom CA and make it available at
db.caon your workstation. -
Create a secret containing the database CA certificate in the same namespace as Teleport using the following command:
kubectl create secret generic db-ca --from-file=ca.pem=/path/to/db.ca -
Add the following to
values.yaml:roles: db proxyAddr: example.teleport.sh # Set to false if using Teleport Community Edition enterprise: true authToken: JOIN_TOKEN databases: - name: oracle uri: oracle.example.com:2484 protocol: oracle + tls: + ca_cert_file: "/etc/teleport-tls-db/db-ca/ca.pem" static_labels: env: dev + extraVolumes: + - name: db-ca + secret: + secretName: db-ca + extraVolumeMounts: + - name: db-ca + mountPath: /etc/teleport-tls-db/db-ca + readOnly: true -
Install the chart:
helm install teleport-kube-agent teleport/teleport-kube-agent \ --create-namespace \ --namespace teleport-agent \ --version 18.3.0 \ -f values.yaml -
Make sure that the Teleport Agent pod is running. You should see one
teleport-kube-agentpod with a single ready container:kubectl -n teleport-agent get podsNAME READY STATUS RESTARTS AGEteleport-kube-agent-0 1/1 Running 0 32s
A single Teleport process can run multiple services, for example multiple Database Service instances as well as other services such the SSH Service or Application Service.
Step 5/6. (Optional) Configure Teleport to pull audit logs from Oracle Audit Trail
Teleport can pull audit logs from Oracle Audit Trail. In order to enable this feature, you will need to configure Oracle Audit Trail and create a dedicated Teleport user that will be used to fetch audit events from Oracle Audit Trail.
Create an internal Oracle teleport user that will fetch
audit events from Oracle Audit Trail:
CREATE USER teleport IDENTIFIED EXTERNALLY AS 'CN=teleport';
GRANT CREATE SESSION TO teleport;
GRANT SELECT ON SYS.DBA_AUDIT_TRAIL TO teleport;
GRANT SELECT ON SYS.V_$SESSION TO teleport;
Enable the table in Oracle Audit Trail:
ALTER system SET audit_trail=db,extended scope=spfile;
Restart your Oracle instance to propagate audit trail changes.
Enable Oracle auditing for the alice user:
AUDIT ALL STATEMENTS by alice BY access;
You must enable auditing for each Teleport user that will be used to connect to Oracle. Additionally you can create a different audit policy for each user.
Edit the Database Service configuration you created earlier to pull audit logs from the Oracle Audit Trail:
db_service:
enabled: true
databases:
- name: "oracle"
protocol: "oracle"
uri: "oracle.example.com:2484"
oracle:
audit_user: "teleport"
Teleport doesn't clean up audit trail events from Oracle Audit Trail. Make sure to configure an Oracle Audit Trail cleanup policy to avoid running out of disk space.
Step 6/6. Connect
Once the Database Service has joined the cluster, log in to see the available databases:
tsh login --proxy=example.teleport.sh --user=alicetsh db lsName Description Allowed Users Labels Connect
------ -------------- ------------- ------- -------
oracle Oracle Example [*] env=dev
Connect to the database:
tsh db connect --db-user=alice --db-name=XE oracleSQLcl: Release 22.4 Production on Fri Mar 31 20:48:02 2023
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Express Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL>
To log out of the database and remove credentials:
Remove credentials for a particular database instance.
tsh db logout oracleRemove credentials for all database instances.
tsh db logout
(Optional) Configure additional hostnames
In some deployments the same logical database is reachable via multiple hostnames with different characteristics, for example:
- replicated databases
- hostnames that traverse different network paths
If this applies to your setup, list all hosts in order of preference to improve connection resiliency.
If a TCP dial error occurs for a host, the next host in the list is tried automatically. Non-network errors (e.g., certificate or authentication failures) are not retried and do not advance to the next host.
By default, hosts are attempted in the listed order. Retries cycle through the list and wrap to the start as needed (e.g., host1 → host2 → host3 → host1 → ...). To randomize the sequence per connection attempt, set shuffle_hostnames; the same cyclic pattern then applies to that randomized order.
retry_count controls the number of retries per host after the initial attempt on a network error. The default is 2, so there are 3 total attempts per host (1 initial + 2 retries) before moving to the next host in sequence.
This setup supports failover and basic load-balancing for new connections: enabling shuffle_hostnames spreads initial connection attempts across hosts (load-balancing), while retries automatically move to the next host if the current one is unreachable (failover).
- name: oracle
protocol: oracle
uri: host1:2484,host2:2484,host3:2484 # Multiple hosts; dials in sequence and wraps (host1 → host2 → host3 → host1 ...). Dialing sequence can be randomized with `shuffle_hostnames`.
static_labels:
env: dev
oracle:
# Randomize host order per connection attempt to spread load. Optional.
shuffle_hostnames: true
# Retries per host on network errors only; non-network errors stop (default: 2). Optional.
retry_count: 5
Troubleshooting
Connection hangs or is refused
A common issue when connecting to an Oracle database is a connection timeout or refusal. This typically indicates a networking problem where the Teleport Database Service cannot reach the Oracle database endpoint. Verify that network routing and access controls, such as firewalls and VPC security groups, allow traffic to flow from the Database Service host to the database endpoint.
You can validate connectivity using a native Oracle client, which helps confirm whether the issue is with Teleport or the underlying network configuration. For example, using Oracle SQLcl:
# Example: Oracle SQLcl
sql -L myuser/[email protected]:2484
Network connectivity issues are often detected by automated health checks.
To check the health status of all registered databases:
# All databases
tctl db ls --format=json | jq -r '.[] | [.metadata.name, .status.target_health]'
An unhealthy database will have output similar to the following:
...
"oracle",
{
"address": "11.22.33.44:2484",
"protocol": "TCP",
"status": "unhealthy",
"transition_timestamp": "2025-09-25T09:47:39.435973Z",
"transition_reason": "threshold_reached",
"transition_error": "dial tcp 11.22.33.44:2484: i/o timeout",
"message": "1 health check failed"
}
...
TLS negotiation fails
Properly configuring TLS on an Oracle database can be challenging. Different underlying issues can result in the same error message, such as the following from Teleport:
Original Error: *tls.permanentError remote error: tls: handshake failure
Or you might see the following in the Oracle logs:
ORA-00609: could not attach to incoming connection
ORA-28860: Fatal SSL error
To identify the root cause, follow the debugging steps in the sections below. The output of the following openssl command can help diagnose many common TLS issues. Capture the output and use it as you follow the debugging steps.
> openssl s_client -connect oracle.example.com:2484 -showcerts
Wrong server certificate
Teleport rejects connections to databases with untrusted server certificates. If you are using Teleport to issue certificates, ensure that the server certificate was issued by the Teleport Database CA. An invalid server certificate will prevent Teleport from establishing a secure connection.
You can view the Teleport Database CA certificate with the following command:
tctl auth export --type=db | openssl x509 -issuer -noout
...
issuer=O=teleport.example.com, CN=teleport.example.com, serialNumber=200129862304303044762346177566738813560
Compare the issuer in the server certificate with the issuer of the Teleport Database CA certificate. The openssl s_client command from the previous section will show you the server certificate:
# openssl s_client output:
...
Server certificate
subject=CN=oracle.example.com
issuer=O=teleport.example.com, CN=teleport.example.com, serialNumber=200129862304303044762346177566738813560
...
You can also inspect the Oracle wallet directly using the orapki utility to verify the server certificate.
# Prompt for wallet password
orapki wallet display -complete -wallet /path/to/wallet
The "User Certificates" section of the output should contain the server's certificate. Its Issuer should match the Subject of the Teleport Database CA.
User Certificates:
Subject: CN=oracle.example.com
Issuer: SERIALNUMBER=200129862304303044762346177566738813560,CN=teleport.example.com,O=teleport.example.com
Serial Number: ...
Wrong client certificate
If the Oracle server rejects client certificates presented by the Teleport Database Service, you should verify that the Oracle database trusts the Teleport Database User CA.
You can view the Teleport Database User CA with this command:
tctl auth export --type=db-client | openssl x509 -issuer -noout
issuer=O=teleport.example.com, CN=teleport.example.com, serialNumber=183359545647055551607366887578713393931
Compare the Teleport Database User CA with the list of CAs trusted by the Oracle database. The openssl s_client command from earlier will show the list of CAs the Oracle database trusts:
# openssl s_client output:
...
---
Acceptable client certificate CA names
O=teleport.example.com, CN=teleport.example.com, serialNumber=183359545647055551607366887578713393931
Ensure that the Teleport Database User CA certificate has been added to the correct wallet and that the Oracle server configuration references this wallet.
You can also inspect the Oracle wallet directly using the orapki utility to verify that the Teleport Database User CA is trusted.
# Prompt for wallet password
orapki wallet display -complete -wallet /path/to/wallet
The "Trusted Certificates" section of the output should contain the Teleport Database User CA. Its Issuer should match the issuer of the Teleport Database User CA.
Trusted Certificates:
Subject: SERIALNUMBER=183359545647055551607366887578713393931,CN=teleport.example.com,O=teleport.example.com
Issuer: SERIALNUMBER=183359545647055551607366887578713393931,CN=teleport.example.com,O=teleport.example.com
Serial Number: ...
Wrong TLS version
Teleport rejects connections that use TLS 1.0 or 1.1 due to known weaknesses. Ensure that the SSL_VERSION parameter in your Oracle configuration is set to 1.2 or higher to enable TLS 1.2 or a newer version.
No common cipher suites
Ensure that the SQLNET.CIPHER_SUITE parameter in your Oracle configuration contains modern TLS cipher suites that match the configured TLS version.
The following cipher suites are secure and widely supported across different Oracle versions.
For TLS 1.2:
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
For TLS 1.3:
TLS_AES_128_GCM_SHA256TLS_AES_256_GCM_SHA384
Must be logged on to the server error
The following error indicates that the login procedure has failed:
ORA-17430: Must be logged on to the server.
This is most commonly caused by the Oracle database enforcing native encryption or data-integrity checksums on a TCPS endpoint. Teleport uses TLS for transport security, and does not support native Oracle encryption.
To disable the redundant encryption requirement for the TCPS endpoint, add the following line to your sqlnet.ora file:
SQLNET.IGNORE_ANO_ENCRYPTION_FOR_TCPS=TRUE
Make sure to use an up-to-date version of the Oracle database. In older versions, this setting may not disable data-integrity checksums, which will lead to continued failures.
Invalid username
An incorrectly specified username will result in the following error:
ORA-01017: invalid username/password; logon denied
When using TLS-based authentication, Oracle maps the Common Name (CN) from the client certificate to an external user in the database. Verify the EXTERNAL_NAME for your user in the dba_users table. It should be in the format cn=<name>, where <name> matches the value of the --db-user flag used in the tsh db login command.
You can query the dba_users table to check the EXTERNAL_NAME of your users:
SQL> SELECT username, authentication_type, external_name
2 FROM dba_users
3 WHERE authentication_type = 'EXTERNAL'
4 ORDER BY 1;
USERNAME AUTHENTICATION_TYPE EXTERNAL_NAME
_____________ ______________________ ________________
ALICE EXTERNAL cn=alice
Next steps
- Learn how to restrict access to certain users and databases.
- View the High Availability (HA) guide.
- Take a look at the YAML configuration reference.
- See the full CLI reference.
- Learn more about
sqlnet.oraandlistener.oraconfiguration from the Parameters for the sqlnet.ora File and Oracle Net Listener Parameters in the listener.ora File Oracle documentation. - Oracle Audit Trail