{"token_count": 5809}

# Certificate Authority Overrides

Certificate Authority Overrides is available only with Teleport Enterprise.

Certificate Authority Overrides let a cluster administrator override a self-signed Teleport CA certificate with a certificate signed by an external certificate authority. In practice, that Teleport CA becomes a subordinate CA in an external trust chain.

In this guide, you will complete a Certificate Authority Override in your Teleport cluster.

You can override the following CAs:

- [`awsra`](#awsra): client certificates that Teleport exchanges for AWS credentials through the AWS IAM Roles Anywhere integration.
- [`db_client`](#db_client): client certificates Teleport presents to databases.
- [`saml_idp`](#saml_idp): assertions signed by the Teleport SAML IdP.
- [`spiffe-tls`](#spiffe-tls): Workload Identity (SPIFFE) X509-SVIDs.
- [`windows`](#windows): RDP certificates Teleport issues for Windows desktop sessions.

To learn why some Teleport CAs can't be overridden, see [Unsupported CAs](#unsupported-cas).

Overrides have a few limitations:

- `tctl get cas/<ca>` and `tctl auth export` only show the self-signed CA certificates. Use `tctl get ca_overrides` to get override data.
- `tctl auth rotate` does not account for active overrides. Administrators must track active overrides and manually create new overrides at the appropriate steps during rotation.

---

SPIFFE-TLS REQUIRES TELEPORT 19.0.0 OR NEWER

Do not create a `spiffe-tls` override until every Auth Service instance runs Teleport v19.0.0 or newer. Older instances issue SVIDs without it, so issuance becomes inconsistent across the cluster. If you use the deprecated [`workload_identity_x509_issuer_override`](https://goteleport.com/docs/ver/20.x/reference/machine-workload-identity/workload-identity/issuer-override.md) resource, see [Migrate from workload\_identity\_x509\_issuer\_override](#migrate-from-workload_identity_x509_issuer_override).

---

## How it works

Teleport maintains several CAs, each with its own self-signed certificates and private keys. A CA override replaces a self-signed CA certificate with an externally signed one.

Teleport continues to manage the CA private keys. Override certificates must target existing CA public keys, so Teleport must generate the CSRs for the overrides.

When Teleport finds an enabled override for a CA certificate, it signs newly issued credentials with the existing private key and uses the override certificate as the issuing CA certificate.

To create a CA override, you must first generate a CSR from Teleport, sign the CSR using an external CA, and then create the `cert_authority_override` resource.

The `cert_authority_override` resource targets a CA with the following fields:

- `sub_kind`: the CA type to override, such as `db_client`, `spiffe-tls`, or `windows`.
- `metadata.name`: the Teleport cluster name.

## Prerequisites

- A running Teleport Enterprise (v18.9.0 or higher) cluster accessible at a hostname with a valid TLS certificate. If you want to get started with Teleport, [sign up](https://goteleport.com/signup) for a free trial or [set up a demo environment](https://goteleport.com/docs/ver/20.x/get-started/deploy-community.md).

- The `tctl` and `tsh` clients.

  Installing `tctl` and `tsh` clients

  1. Determine the version of your Teleport cluster. The `tctl` and `tsh` clients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at `/v1/webapi/find` and use a JSON query tool to obtain your cluster version. Replace teleport.example.com:443 with the web address of your Teleport Proxy Service:

     **Mac/Linux**

     ```
     $ TELEPORT_DOMAIN=teleport.example.com:443
     $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')"
     ```

     **Windows - Powershell**

     ```
     $ $TELEPORT_DOMAIN = "teleport.example.com:443"
     $ $TELEPORT_VERSION = (Invoke-RestMethod -Uri "https://${TELEPORT_DOMAIN}/v1/webapi/find").server_version
     ```

  2. Follow the instructions for your platform to install `tctl` and `tsh` clients:

     **Mac**

     Download the signed macOS .pkg installer for Teleport, which includes the `tctl` and `tsh` clients:

     ```
     $ curl -O https://cdn.teleport.dev/teleport-${TELEPORT_VERSION?}.pkg
     ```

     In Finder double-click the `pkg` file to begin installation.

     ---

     DANGER

     Using 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.

     ---

     **Windows - Powershell**

     ```
     $ curl.exe -O https://cdn.teleport.dev/teleport-v$TELEPORT_VERSION-windows-amd64-bin.zip
     Unzip 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.
     ```

     **Linux**

     All of the Teleport binaries in Linux installations include the `tctl` and `tsh` clients. For more options (including RPM/DEB packages and downloads for i386/ARM/ARM64) see our [installation page](https://goteleport.com/docs/ver/20.x/installation/single-machine.md).

     ```
     $ curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ tar -xzf teleport-v${TELEPORT_VERSION?}-linux-amd64-bin.tar.gz
     $ cd teleport
     $ sudo ./install
     Teleport binaries have been copied to /usr/local/bin
     ```

  Connecting with TLS routing disabled

  This guide's commands assume your Teleport cluster uses TLS routing (`proxy_listener_mode: multiplex`), where the `tctl` and `tsh` clients reach every Teleport service through the Proxy Service's web address on port `443`. If you're not sure whether this applies to your cluster, check with whoever manages it.

  If your cluster uses separate listener ports instead, adjust ports as follows:

  - **`tsh` commands** (e.g., `tsh login --proxy=...`): continue using the Proxy Service web address on port `3080` (or `443` if behind a load balancer). Do not change these to port `3025`.

  - **Direct `tctl` or Auth Service API commands**: use port `3025` for the Auth Service gRPC listener:

    ```
    $ tctl status --auth-server=teleport.example.com:3025
    ```

* A Teleport user with a role that has access to the `cert_authority_override` resource. The preset `editor` role does not have this access. To grant it, add the following rule to your role:

  ```
  kind: role
  version: v8
  metadata:
    name: ca-override-admin
  spec:
    allow:
      rules:
        - resources:
            - cert_authority_override
          verbs:
            - create
            - delete
            - list
            - read
            - update

  ```

  Assign the ca-override-admin role to the user who will manage CA overrides.

* All Auth Service instances and related services, such as Windows Desktop Service, Database Service, and Proxy Service instances, must be upgraded to the same CA override-aware Teleport version.

* For safety, back up your cluster state before starting and retain downstream trust in the self-signed CA certificates until the upgrade is fully verified.

## Step 1/6. Prepare the override certificate CSR

The `windows` CA is used as an example. Replace with your target CA, as appropriate.

Prepare the CSR using `tctl`:

```
$ tctl auth create-override-csr --type=windows
-----BEGIN CERTIFICATE REQUEST-----
(...)
-----END CERTIFICATE REQUEST-----
```

If you have multiple active or additional keys, such as in HSM deployments or during CA rotation, this command prints multiple PEMs. You may use the `--out` flag to print each CSR to its own file.

You may customize the certificate subject:

```
$ tctl auth create-override-csr --type=windows --subject='OU=My Organization Unit,CN=My Windows CA'
```

---

TIP

In clusters with multiple Auth Service instances and a separate HSM key per instance, make sure all Auth Service instances are online and healthy before issuing the `create-override-csr` command. Teleport will automatically collect CSRs from all online Auth Service instances.

---

## Step 2/6. Issue override certificates using your external CA

Using the CSRs from step 1, issue the override certificates with your external CA.

The certificates must meet the following requirements:

- KeyUsage: `keyCertSign` and `cRLSign`.
- BasicConstraintsValid: `true`.
- IsCA: `true`.
- Subject: The Teleport cluster name must be present in either the `O` field (first element) or in the OID `1.3.9999.4.1`. CSRs from step 1 always have a valid subject.

## Step 3/6. Create the disabled certificate overrides

Using the certificates acquired in step 2, create a disabled certificate override for each certificate:

```
$ tctl auth create-override --disabled --type=windows cert.pem
```

### Multi-Auth Service clusters with per-instance HSM keys

In clusters with multiple Auth Service instances and a separate HSM key per instance, each Auth Service instance may only be able to access its own private keys. In this scenario, make sure all Auth Service instances are online and healthy, then create your overrides in the disabled state. The Auth Service instances automatically sign CRLs in the background for their respective keys.

```
Create the override. Repeat for each certificate override.
$ tctl auth create-override --disabled --type=windows cert.pem

Verify that CRLs are present.
$ tctl get ca_overrides/windows
```

## Step 4/6. Configure downstream trust

Using the certificates acquired in step 2, configure downstream trust before proceeding. We recommend retaining trust in the self-signed Teleport CA for a grace period, until you have verified normal cluster use.

See below for CA-specific instructions.

### awsra

The `awsra` CA signs the short-lived client certificates that Teleport exchanges for AWS credentials through the [AWS IAM Roles Anywhere integration](https://goteleport.com/docs/ver/20.x/enroll-resources/application-access/cloud-apis/aws-console-roles-anywhere.md). When the override is enabled, these client certificates are issued under, and presented with, the override certificate.

AWS Roles Anywhere requires end-entity and trust anchor certificates to use SHA-256 or stronger, so issue your override certificate in step 2 from an external CA that meets this requirement. See the AWS documentation on the [trust model](https://docs.aws.amazon.com/rolesanywhere/latest/userguide/trust-model.html) for details.

Teleport does not send intermediate or root CAs during the credential exchange, so the AWS trust anchor must trust the override certificates directly. Use the override certificates from step 2, not `tctl auth export --type=awsra`, which only ever shows the self-signed Teleport CA. In clusters with a separate HSM key per Auth Service instance, include the override certificate for each key.

The [guided setup flow](https://goteleport.com/docs/ver/20.x/enroll-resources/application-access/cloud-apis/aws-console-roles-anywhere.md#use-the-guided-flow-recommended) handles this automatically and always advertises the active override certificate.

If you are configuring the trust anchor manually, wait until you are ready to complete step 5. Replacing the trust anchor's certificates while the override is still disabled breaks credential exchange and profile sync immediately, rather than when the override is enabled. Perform one of the following immediately before enabling the override in step 5:

- Update the existing trust anchor's certificate bundle in place with `aws rolesanywhere update-trust-anchor`. The trust anchor ARN does not change, so `spec.aws_ra.trust_anchor_arn` does not need updating.
- Create a new trust anchor from the certificate, then point the integration at it by setting `spec.aws_ra.trust_anchor_arn`. If the integration's sync role was created by the guided setup flow, its trust policy only allows the original trust anchor's ARN to assume it; update the trust policy to also allow the new ARN, or use the previous option instead.

After completing both the trust anchor update and step 5, check `status.aws_ra.last_profile_sync` on the integration to confirm profile sync recovered.

Disabling or removing the override has the same hazard in reverse. Teleport reverts to self-signed-CA certificates immediately, so update the trust anchor back to the self-signed CA certificate (`tctl auth export --type=awsra`) at the same time, or profile sync will break again.

### db\_client

Most databases only need to trust the external root CA and intermediate CAs. It's not necessary to trust the override CA certificate directly. Those include, but are not limited to, MariaDB, MySQL, PostgreSQL, Redis and Oracle.

We recommend checking your database documentation and verifying access after applying the CA override in a controlled environment.

### db\_client - Microsoft SQL Server with PKINIT authentication

Configuring [MSSQL Server with PKINIT authentication](https://goteleport.com/docs/ver/20.x/enroll-resources/database-access/enrollment/self-hosted/sql-server-ad-pkinit.md) requires that you:

1. Import the CA chain's trusted root and intermediates, as required by the domain, including the override CA certificate.

2. Publish the override CA certificate to NTAuth.

3. Publish the override CA CRLs.

   The CA override must exist before this step. Each certificate override must generate a CRL; verify that async CRL generation has completed via `tctl get ca_overrides/db_client`.

   Run the command below and follow its instructions.

   ```
   $ tctl auth crl --type=db_client --out=./out
   Writing 2 files with prefix "./out"
   ./out-db_client-5b7ec7f7.crl
   ./out-db_client-override-5b7ec7f7.crl

   To publish CRLs, run the following in Windows:
     certutil -dspublish ./out-db_client-5b7ec7f7.crl TeleportDB "example.com"
     certutil -dspublish ./out-db_client-override-5b7ec7f7.crl TeleportDB "O_B4TK2353F87SEBD6J60P4N4IC8SVE5OH_example.com"
   ```

   ---

   REPUBLISH DATABASE CRLS AFTER UPGRADING TO TELEPORT V19.1.0

   Unlike the CRLs that the Windows Desktop Service publishes for desktop access, database CRLs are never republished automatically. After you upgrade to Teleport v19.1.0 and newer from an earlier version, run `tctl auth crl` and the publish commands again.

   Earlier versions publish override CRLs under names without the `O_` prefix. Override certificates look up the `O_`-prefixed CRL first and fall back to the unprefixed name. Existing deployments keep working through the fallback, but a future release removes it.

   Run `tctl auth crl` with a `tctl` that matches your Auth Service version. Starting in v19.1.0, `tctl` prints `O_`-prefixed names, which certificates issued by an earlier Auth Service do not reference.

   ---

4. Describe the complete trust chain, for each certificate override, in the `cert_authority_override` resource (leaf to root). This allows `kinit` to pass its self-validation step.

   For example:

   ```
   kind: cert_authority_override
   sub_kind: db_client
   version: v1
   metadata:
     name: example.com
   spec:
     certificate_overrides:
     - certificate: |-
         -----BEGIN CERTIFICATE-----
         (override certificate)
         -----END CERTIFICATE-----
       chain:
       - |-
         -----BEGIN CERTIFICATE-----
         (intermediate 2)
         -----END CERTIFICATE-----
       - |-
         -----BEGIN CERTIFICATE-----
         (intermediate 1)
         -----END CERTIFICATE-----
       - |-
         -----BEGIN CERTIFICATE-----
         (root)
         -----END CERTIFICATE-----
       disabled: true

   ```

   You may supply the chain using the dedicated `tctl auth` CA override commands or via `tctl edit`.

   ```
   tctl auth create-override --type=db-client \
     --disabled \
     cert.pem \
     int2.pem \
     int1.pem \
     root.pem

   tctl auth update-override --type=db-client \
     --public-key='public-key' \
     --set-chain=int2.pem \
     --set-chain=int1.pem \
     --set-chain=root.pem

   tctl edit ca_overrides/db_client
   ```

### saml\_idp

When the override is enabled, Teleport signs SAML assertions with the override certificate and advertises it in both the metadata XML and the Web UI.

Cutover behavior depends on how your service provider (SP) manages IdP certificates:

- Multi-certificate SPs: Before enabling the override, add the override certificate from step 2 alongside the existing Teleport certificate, the same way you provided the IdP certificate when [configuring the service provider](https://goteleport.com/docs/ver/20.x/identity-governance/idps/saml-guide.md#step-24-configure-the-service-provider).
- Single-certificate SPs: After enabling the override in step 5, update the SP with the override certificate. Logins to these SPs may fail until the certificate is updated.
- Metadata URL SPs: After enabling the override in step 5, refresh the SP's metadata or wait for the SP to poll the metadata URL. Logins to these SPs may fail until the metadata is refreshed.

Teleport does not distribute intermediate or root CAs. If your SP validates the full certificate chain, obtain the chain out of band from your external CA. We recommend checking your SP documentation and verifying logins in a controlled environment after enabling the override.

### spiffe-tls

The SPIFFE trust bundle, whether exported with `tctl auth export --type=tls-spiffe` or served to workloads by `tbot`, contains only the self-signed Teleport SPIFFE CA. Relying parties that validate X509-SVIDs against your external hierarchy must obtain its root and intermediate certificates out of band, including the spiffe-tls CA override certificate itself.

`spiffe-tls` overrides apply only to X509-SVIDs. JWT-SVID issuance is unaffected.

### windows

Your configuration depends on whether you use [AD](https://goteleport.com/docs/ver/20.x/enroll-resources/desktop-access/active-directory.md#step-36-configure-a-gpo-to-allow-teleport-connections) or [local](https://goteleport.com/docs/ver/20.x/enroll-resources/desktop-access/getting-started.md#step-14-prepare-windows) setups.

For AD, import the CA chain's trusted roots and intermediates as required by the domain, and publish the override CA certificate directly to NTAuth.

Run the following command on a domain-joined Windows host to verify that the NTAuth store includes the override CA certificate.

```
$ certutil -viewstore -enterprise NTAuth
```

Additionally, verify the override CA chain:

```
$ certutil -verify -urlfetch .\override.cer
```

For local setups, import the CA chain to the Local Computer "Trusted Root CAs" and "Intermediate CAs" stores, as appropriate. An externally signed override CA certificate is usually an intermediate CA.

Verify the override CA chain:

```
$ certutil -verify -urlfetch .\override.cer
```

## Step 5/6. Enable the certificate overrides

After configuring downstream trust, execute the command below for each certificate override to enable it:

```
$ tctl auth update-override --type=windows --public-key=public-key --set-disabled=false
```

You can find the public key of the target override using the `tctl auth pub-key-hash` command or by reading it from the `cert_authority_override` resource.

Using `tctl auth pub-key-hash`:

```
$ tctl auth pub-key-hash --cert=cert.pem
```

Using `tctl get`:

```
$ tctl get ca_overrides/windows
```

Alternatively, you may edit directly using:

```
$ tctl edit ca_overrides/windows
```

## Step 6/6. Exercise the CA override

Exercise the override by attempting a connection with the appropriate protocol (RDP for `windows`, `tsh db connect` for `db_client`, etc).

Using the `windows` CA as an example, start a new desktop session from your Teleport Proxy. If downstream trust is configured correctly, the session should start successfully.

To confirm that the override is in use, inspect the "Windows Desktop Session Started" event for the new session. You should see the "ca\_override" stanza with `"active": true` and a corresponding `public_key_hash`. ("Database Session Started" and related per-CA issuance events are modified similarly.)

Session Started sample event

```
{
  "ca_override": {
    "active": true,
    "public_key_hash": "f4522365888fdddcf3c854e79e5928447fe1a2388353efb2f0d30db8ba7c81bc"
  },
  "cluster_name": "mycluster",
  "code": "TDP00I",
  "desktop_name": "example-desktop",
  "ei": 1,
  "event": "windows.desktop.session.start",
  "success": true
}

```

## Migrate from workload\_identity\_x509\_issuer\_override

Teleport does not migrate the deprecated [`workload_identity_x509_issuer_override`](https://goteleport.com/docs/ver/20.x/reference/machine-workload-identity/workload-identity/issuer-override.md) resource automatically. Before replacing it with a `spiffe-tls` override, make sure that:

- Every Auth Service instance runs Teleport v19.0.0 or newer.
- Your role has the `read` and `delete` verbs on `workload_identity_x509_issuer_override`, in addition to the `cert_authority_override` access described in [Prerequisites](#prerequisites).
- In clusters with a separate HSM key per Auth Service instance, `tctl` is connected directly to the instance that holds the key. Otherwise you must create the override with `--disabled`, wait for its CRL to appear in `tctl get ca_overrides/spiffe-tls`, and enable it with `tctl auth update-override`, which lengthens the gap in step 2 below. See [Multi-Auth Service clusters with per-instance HSM keys](#multi-auth-service-clusters-with-per-instance-hsm-keys).

1. Save the legacy resource and convert each `issuer` and `chain` certificate from base64-encoded DER to PEM. Skip the conversion if you still have the PEM files from your external CA.

   ```
   $ tctl get workload_identity_x509_issuer_override/default > legacy_override.yaml
   Repeat for issuer and chain.
   $ echo '<base64 certificate>' | base64 -d | openssl x509 -inform der -out cert.pem
   ```

2. Delete the legacy resource. Until the next step completes, X509-SVIDs are issued from the self-signed Teleport SPIFFE CA, so keep the gap short.

   ```
   $ tctl rm workload_identity_x509_issuer_override/default
   ```

3. Create the override from the converted `issuer` certificate, followed by the converted `chain` certificates, if any, in leaf to root order. Omit the first `chain` certificate if it duplicates the `issuer`. Downstream trust is already configured because the legacy override was in effect, so create it enabled. Repeat for each entry in legacy\_override.yaml `spec.overrides`.

   ```
   $ tctl auth create-override --type=spiffe-tls cert.pem intermediate.pem
   ```

Confirm with `tctl get ca_overrides/spiffe-tls`, then exercise the override as described in [Step 6/6](#step-66-exercise-the-ca-override).

## Unsupported CAs

The following Teleport CAs can't be overridden.

| CA                                         | Status          | Reason                                                                                                                                                                                                          |
| ------------------------------------------ | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `app_client`                               | Planned         | This CA issues app access client certificates. Support for overriding it is planned for a future release.                                                                                                       |
| `db`, `host`, `user`                       | Not planned     | Teleport's own services validate certificates from these CAs. Overriding one would require distributing the new certificate to the Auth Service, Proxy Service, and other relevant services across the cluster. |
| `bound_keypair`, `jwt`, `oidc_idp`, `okta` | Never supported | These CAs sign JSON Web Tokens and never issue certificates, so there is no certificate for an override to replace.                                                                                             |
| `openssh`                                  | Never supported | This CA signs SSH certificates rather than X.509 certificates, so there is no certificate for an override to replace. OpenSSH servers trust its signing key directly instead of through a certificate chain.    |
