# StrongDM Docs

StrongDM is a Zero Trust Privileged Access Management (PAM) platform that extends the capabilities of traditional privileged access management to support all modern infrastructure.

StrongDM manages access to databases, servers, Kubernetes clusters, clouds, and web applications and combines authentication, authorization, networking, and observability into a single platform, providing secure and auditable access for the precise amount of time that access is needed.

To learn more about StrongDM:

* [What Is StrongDM?](/concepts/what-is-strongdm)
* [How StrongDM Works](/concepts/how-strongdm-works)

To try out StrongDM, take a look at our [Quick Start Guide](/admin/deployment/quickstart).

Or, browse the documentation section that matches your needs!

<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th align="center"></th><th></th><th data-hidden></th></tr></thead><tbody><tr><td align="center"><h3><a href="/spaces/F7eka9SH5TT8nJm2ZfWj">Admin Guide</a></h3></td><td>Learn about administering StrongDM: Deploying your organization, configuring proxies, adding resources, managing secrets, authenticating or provisioning users, and auditing user actions.</td><td>rRo8USKUHyaFFQldmwDD</td></tr><tr><td align="center"><h3><a href="/spaces/HaY8OFbXUreWEF61MhKm">User Guide</a></h3></td><td>Learn about using StrongDM for access: Installing the Desktop App and the Command Line Interface (CLI) tool, requesting access to resources, and connecting to those resources.</td><td>kOoqKMWC0txi6TleE50B</td></tr><tr><td align="center"><h3><a href="/spaces/4XOJmXFslCMVCzIG2rKp">References</a></h3></td><td>The StrongDM reference content provides a quick lookup for CLI command help text, information about the API and SDKs, and other reference material to assist while using or administering StrongDM.</td><td></td></tr><tr><td align="center"><h3><a href="/spaces/AjI9hEwBnBlqCdLDLbE1">Changelog</a></h3></td><td>Learn about the changes that have been made to StrongDM through release notes and through summarized monthly recaps that cover changes made during the last calendar month.</td><td></td></tr></tbody></table>


# Admin Guide

The subjects described in the Admin Guide section relate to the administration of your StrongDM organization, which is enabled by permission levels assigned to a user.

{% hint style="info" %}
The **Admin UI** is StrongDM's administrative interface. `` `login.strongdm.com` ``.

If you visit the login page when you are signed out and you also have an account in more than one of StrongDM's regional control planes, you'll see a selector to choose the region you wish to use.
{% endhint %}

When users without any administrative privileges sign in to the StrongDM Admin UI, they can only view links to download the StrongDM Desktop application and the CLI or read documentation.

* [Access](/admin/access) - The Access section contains information on how to grant access to principals such as users, tokens, or service accounts. It also covers entitlements, roles, permission levels, access and approval workflows, and policies.
* [Audit](/admin/audit) - The Audit section covers the various log options that allow auditing of StrongDM admin activities and user interactions against resources. It also provides information on the reports available in the Admin UI, and on the StrongDM threat detection offering.
* [Clients](/admin/clients) - The Clients section covers the administration of client systems, including the Docker client, managing loopback IP ranges, managing fleet installations, providing specific versions of the client for download, and verifying client binaries.
* [Deployment](/admin/deployment) - The Deployment section is where you'll find the Admin Quick Start Guide, and the Terraform Quick Starts. Here there is also information about various deployment considerations, such as environment variables, an overview of integrations that are available, and on parent/child organization structure. There are also several specific deployment scenario guides.
* [Networking](/admin/networking) - The Networking section covers the networking components of your StrongDM organization. Primarily, this entails the selection of the type of node you want to use (Proxy Clusters vs Gateways and Relays) as well as the setup and management of those nodes.
* [Principals](/admin/principals) - The Principals section contains information about the management of StrongDM user accounts, admin tokens, service accounts, identity aliases, and authentication. There are specific guides for integrations with various SSO, MFA, and provisioning provider services.
* [Resources](/admin/resources) - The Resources section provides general information on the discovery and onboarding of resources to StrongDM, as well as guides for manual setup and management for resources of every supported resource type.
* [StrongDM Vault](/admin/secrets) - The Secrets Management section deals with topics such as certificate authority and secret management tool integrations, as well as StrongDM's integrated offerings in those areas.

### Browser Support

The StrongDM Admin UI supports the latest versions of Chrome, Edge, Firefox, Opera, and Safari.

Some mobile browsers, particularly Safari for iOS and Chrome and Firefox for Android, are also supported. In general, StrongDM strives to accommodate browsers with more than 0.2% of the browser market share, with the exception of Internet Explorer and Opera Mini.


# Deployment

In this section you can find information to assist with the deployment and management of your StrongDM organization.

* [Quick Start Guide](/admin/deployment/quickstart) - The Admin quick start is a good place to start if you want a quick look at setting up StrongDM end to end in a test scenario - a user with a role, a gateway, and a resource, with a test of proxied access.
* [Terraform](/admin/deployment/terraform) - The Terraform quick starts provide a similar starting point for investigating deployments using the [StrongDM Terraform Provider](https://registry.terraform.io/providers/strongdm/sdm/latest/docs).
* [Deployment Scenarios](/admin/deployment/scenarios) - Here, you will find a variety of specific examples of deployment scenarios, such as self-registering relays, gateways deployed with specific technologies, temporary access granted with chat bots or PagerDuty schedules, and other use case examples with guides.
* [Integrations](/admin/deployment/integrations) - The integrations page contains an overview of the integrations that StrongDM provides, and links out to guides for setting up those integrations.
* [Environment Variables](/admin/deployment/environment-variables) - The environment variables page is a handy guide containing information about the environment variables that may need to be set up where you run StrongDM software, such as on clients, gateways, relays, or proxy clusters.
* [Parent/Child Organizations](/admin/deployment/parent-child) - For some complex deployments, the "Parent/Child" organization structure may make sense. Learn more about it here.


# Quick Start Guide

### Overview

This guide is designed to help administrators with initial configuration of their StrongDM network. You will learn how to set up a gateway and resource in the Admin UI, set appropriate permissions and roles in order to access the resource, install and use the StrongDM client to connect to it, and review activity history in the logs. This quick start allows you to try using StrongDM before setting up access for your entire organization.

{% hint style="info" %}
If you'd like to use Terraform to set up a test installation of StrongDM on AWS, read our [Terraform Quick Start](/admin/deployment/terraform/aws) documentation.
{% endhint %}

### Prerequisites

Before you begin, the following requirements should be met:

* **Server (to host the gateway)**: You can repurpose an existing bastion or jump host for testing purposes. For production-ready deployments, we recommend a server reserved exclusively for use as a gateway.
* **Specifications**: The [StrongDM gateway](/admin/networking/gateways-and-relays) can be installed on any Linux distribution. We recommend servers with 2 CPUs and 4 GB of memory.
* **Network Settings**: To get live quickly, the server hosting the gateway needs to be able to connect to the resource that you set up. This may require modifying the security group on the server or database itself. You also need SSH access to the server.

### Create a Gateway

{% hint style="info" %}
If you are comfortable with Terraform, and choose to set up a gateway in AWS, you can [automate gateway setup](https://github.com/strongdm/terraform-aws-sdm-gateway)!
{% endhint %}

Gateways are the entry points to your StrongDM network. When users authenticate via the StrongDM client, the client contacts a gateway. The gateway verifies the user’s permission level, roles, and access grants before routing their traffic and establishing a connection to the target resource. Each network needs at least one gateway for StrongDM to function.

Gateways are hosted on servers that live outside of StrongDM. The following steps show you how to define and connect to the host of a new gateway, using the Admin UI and your command line.

{% tabs %}
{% tab title="US" %}

1. Log in to the Admin UI at <https://app.strongdm.com>.
2. From the navigation menu, click **Network** and then click **Gateways**. 2. On the **Gateways** page, click **Add gateway**.

   ![](/files/SMLEq3R0GOPwbm7PdQ44)
3. For **Name**, enter a unique, memorable name. Use only letters, numbers, and hyphens
4. For **Advertised Host**, define the advertised host for the server (for example, `sdm-gw0.yourcompany.com`, `111.222.333.444`, or `ec2-nn-nnn-nnn-nnn.us-east-2.compute.amazonaws.com`). It must be an IP or hostname accessible to your StrongDM client(s).
5. For **Advertised Port**, enter the port that you left open for the gateway to interact with StrongDM clients (by default, `5000`). If you need to use another port, choose any port above 1024, as StrongDM runs as a non-privileged daemon.
6. Click **Create gateway** to save your name, host, and port.
7. A token is generated that is **shown only once**. Carefully copy the token and save it for later use.
8. Establish an SSH connection to the server that will host the gateway.
9. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.strongdm.com/releases/cli/linux
   ```
10. Unzip it.

    ```bash
    unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
    ```
11. Run the installer. When prompted for the token created earlier, paste it and hit enter. Note that the token does not echo back to you.

    ```bash
    sudo ./sdm install --node
    ```
12. Return to the Admin UI. On the **Gateways** page, the gateway just created should have a status of **online** and a heartbeat.
    {% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

1. Log in to the Admin UI at <https://app.uk.strongdm.com>.
2. From the navigation menu, click **Network** and then click **Gateways**. 2. On the **Gateways** page, click **Add gateway**.

   ![](/files/SMLEq3R0GOPwbm7PdQ44)
3. For **Name**, enter a unique, memorable name. Use only letters, numbers, and hyphens
4. For **Advertised Host**, define the advertised host for the server (for example, `sdm-gw0.yourcompany.com`, `111.222.333.444`, or `ec2-nn-nnn-nnn-nnn.us-east-2.compute.amazonaws.com`). It must be an IP or hostname accessible to your StrongDM client(s).
5. For **Advertised Port**, enter the port that you left open for the gateway to interact with StrongDM clients (by default, `5000`). If you need to use another port, choose any port above 1024, as StrongDM runs as a non-privileged daemon.
6. Click **Create gateway** to save your name, host, and port.
7. A token is generated that is **shown only once**. Carefully copy the token and save it for later use.
8. Establish an SSH connection to the server that will host the gateway.
9. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.uk.strongdm.com/releases/cli/linux
   ```
10. Unzip it.

    ```bash
    unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
    ```
11. Run the installer. When prompted for the token created earlier, paste it and hit enter. Note that the token does not echo back to you.

    ```bash
    sudo ./sdm install --app-domain app.uk.strongdm.com --node
    ```
12. Return to the Admin UI. On the **Gateways** page, the gateway just created should have a status of **online** and a heartbeat.
    {% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

1. Log in to the Admin UI at <https://app.eu.strongdm.com>.
2. From the navigation menu, click **Network** and then click **Gateways**. 2. On the **Gateways** page, click **Add gateway**.

   ![](/files/SMLEq3R0GOPwbm7PdQ44)
3. For **Name**, enter a unique, memorable name. Use only letters, numbers, and hyphens
4. For **Advertised Host**, define the advertised host for the server (for example, `sdm-gw0.yourcompany.com`, `111.222.333.444`, or `ec2-nn-nnn-nnn-nnn.us-east-2.compute.amazonaws.com`). It must be an IP or hostname accessible to your StrongDM client(s).
5. For **Advertised Port**, enter the port that you left open for the gateway to interact with StrongDM clients (by default, `5000`). If you need to use another port, choose any port above 1024, as StrongDM runs as a non-privileged daemon.
6. Click **Create gateway** to save your name, host, and port.
7. A token is generated that is **shown only once**. Carefully copy the token and save it for later use.
8. Establish an SSH connection to the server that will host the gateway.
9. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.eu.strongdm.com/releases/cli/linux
   ```
10. Unzip it.

    ```bash
    unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
    ```
11. Run the installer. When prompted for the token created earlier, paste it and hit enter. Note that the token does not echo back to you.

    ```bash
    sudo ./sdm install --app-domain app.eu.strongdm.com --node
    ```
12. Return to the Admin UI. On the **Gateways** page, the gateway just created should have a status of **online** and a heartbeat.
    {% endtab %}
    {% endtabs %}

#### Gateway setup troubleshooting

* If you typically set up servers with [SELinux](https://en.wikipedia.org/wiki/Security-Enhanced_Linux) on, make sure it is [turned off](/admin/networking/selinux) while installing the StrongDM binary.
* The installer must be run by a user that exists in the `/etc/passwd` file.
* If the gateway does not appear to be online, it's possible the webpage is cached. Please perform a hard refresh of your browser. If the gateway is still not online, verify that the StrongDM daemon is running by typing `ps aux|grep sdm` on the server and looking for a line that says `sdm relay`.

### Add a Resource

A resource is any type of infrastructure—datasources, servers, clusters, clouds, and websites—that is added and configured for your organization. StrongDM users use the client to view and connect to the resources that they have permission to access.

You need to add at least one resource to your organization because if you don't, users won't be able to do anything in StrongDM other than log in. You can add any supported resource type; however, for the purposes of this procedure, we are adding a datasource.

1. In the Admin UI, select **Resources** > **Managed Resources** from the navigation menu and choose a resource type to add to your organization. In this example, we select **Datasources** to add a database.
2. On the **Datasources** page, click **Add Resource**.

   ![](/files/t2PYdeDHV49iUHalPGPI)
3. Enter a **Display Name** for the resource. This name appears throughout StrongDM for those who are granted access.
4. Select the **Resource Type** from the dropdown.
5. Enter the **Hostname**. This address must be resolvable from the perspective of the gateway. One way to verify this is to use SSH to log in to the gateway and use netcat: `nc -zv <YOUR_HOSTNAME> <YOUR_PORT>` (for example, `nc -zv testdb-01.fancy.org 3306` or `nc -zv 111.222.333.444 3306`).
6. StrongDM prepopulates the **Port** field with a database default. You may change the port now on the resource configuration form, or later in [Port Overrides](/admin/resources/port-overrides) settings if your database is set to listen on a different port.
7. Enter the username, password, and default database name to complete the connection. Complete any other required fields.
8. Click the **Create** button to save your new resource's settings.

The Admin UI then updates and the added resource shows a positive, green health status momentarily. If the resource is not healthy, click its name to view the resource's **Diagnostics** tab and check for errors. The Admin UI indicates if there is a network or credentialing error.

### Assign Roles to Users

{% tabs %}
{% tab title="US" %}
Before users can connect to a resource, they must be assigned a role that grants them access to the particular resource. This section describes the basic steps to assign a role to a user.

1. Go to the [Roles](https://app.strongdm.com/app/access/roles) page in the Admin UI. If you already have a role created, you can update the role's access rules to allow users with that role to access your new resource. If you don't have an existing role and need a role specifically for testing purposes, you can easily create a role and assign this particular resource to it with a static rule.
2. Go to the [Users](https://app.strongdm.com/app/access/users) page in the Admin UI. Click your username. Then click **Roles** and select the newly created role to assign yourself to it and get access.
   {% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

Before users can connect to a resource, they must be assigned a role that grants them access to the particular resource. This section describes the basic steps to assign a role to a user.

1. Go to the [Roles](https://app.uk.strongdm.com/app/access/roles) page in the Admin UI. If you already have a role created, you can update the role's access rules to allow users with that role to access your new resource. If you don't have an existing role and need a role specifically for testing purposes, you can easily create a role and assign this particular resource to it with a static rule.
2. Go to the [Users](https://app.uk.strongdm.com/app/access/users) page in the Admin UI. Click your username. Then click **Roles** and select the newly created role to assign yourself to it and get access.
   {% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

Before users can connect to a resource, they must be assigned a role that grants them access to the particular resource. This section describes the basic steps to assign a role to a user.

1. Go to the [Roles](https://app.eu.strongdm.com/app/access/roles) page in the Admin UI. If you already have a role created, you can update the role's access rules to allow users with that role to access your new resource. If you don't have an existing role and need a role specifically for testing purposes, you can easily create a role and assign this particular resource to it with a static rule.
2. Go to the [Users](https://app.eu.strongdm.com/app/access/users) page in the Admin UI. Click your username. Then click **Roles** and select the newly created role to assign yourself to it and get access.
   {% endtab %}
   {% endtabs %}

### Set up Policies

If your organization has policies enabled via either the Enterprise plan or a StrongDM trial, a key decision to make early on in the configuration of your organization is whether you wish to use policies to control fine-grained access to resources. If your organization is currently in a trial but not going to use the Enterprise plan or if your organization does not intend to use policies, you should disable them by going in the Admin UI to **Policies** and toggling them off by disabling the **Enable Policy** toggle in the upper-right corner of the screen.

If policies are enabled, policies forbid connections to, and specific actions on, all resources by default. Thus, policies need to be configured to allow particular principals (users, roles, service accounts) to take particular actions on particular resources, and often with contextual limitations. Those limitations can include geographic location, device trust score, and others. If you intend to use policies in your organization, you should create a policy to allow your test user access to your test resource.

#### Create a policy to allow access

If you intend to use policies for access control, you should set one up now. Create a policy similar to the following, for the purposes of this quick start:

```cedar
permit (
  principal in StrongDM::Role::"<ROLE_ID>"
  action,
  resource == StrongDM::Resource::"<RESOURCE_ID>"
);
```

In this example, when you write the `principal` line into the editor, if you do not know the role ID of the role, if you begin typing the name of the role here, the editor attempts to provide choices of your currently defined roles and fills the role ID for you. The same applies to the resource ID; when you begin typing the name of a resource, the editor suggests resources, and when one is chosen, fill its resource ID for you.

Now, your user should be able to connect to the resource!

### Install the Client and Connect to a Resource

Users use the StrongDM client (which consists of the StrongDM Desktop application and/or the CLI) to connect to the resources that are available to them. The client is available for download from the Admin UI for Linux, macOS, and Windows. For macOS and Windows, you can download the desktop app and CLI packaged together, or you can download the CLI standalone.

This section describes how to use the desktop app and CLI to connect to the resource that you added in a previous step.

1. Go to the Admin UI's **Download & Install** page.
2. Download and install StrongDM for [macOS Installation Guide](/users/client/macos), [Windows Installation Guide](/users/client/windows), or [Linux Installation Guide](/users/client/linux). Follow the instructions in the installation guide for your particular operating system.
3. Open the desktop app and log in to StrongDM. The resource that you added should appear in the list of available resources.
4. Click the lightning bolt beside the resource name to connect. The lightning bolt turns green and you can see that you are connected. Being connected means that the local client is listening on that port.
5. Open your preferred SQL client (in this example, TablePlus), and create a new connection. Enter `127.0.0.1` (for some clients, this needs to be `localhost`) and the port that was assigned within the local client (in this example, `5472`). For most clients, the username and password may be left blank. Please read the [Connect to Resources](/users/connect) and [Connect to Datasources](/users/connect/connect-databases) guides for specific SQL connection requirements.

   ![](/files/FyZKWXYXyTP7iWvpbvFj)
6. Click connect, and start querying!
7. Next, verify that the CLI is set up in your system by opening your command line and typing `sdm --version`. If it is set up properly, the response returns versioning information similar to `sdm version 38.84.0 (8e913eb01d42fc1141bda2b0d0e967b70a89d5e6 #1045)`. If the output is not like this, you should revisit the installation guide for whichever operating system your local machine uses for details on installation and setup.
8. Try executing some commands. You may wish to explore the `sdm admin` commands first, as many of the administrative features of the Admin UI can be used in the CLI as well. You can, for example, view the resource that you already added by using `sdm admin resources list`, or change its settings by using `sdm admin resources update <RESOURCE_NAME>`.

{% hint style="info" %}
All StrongDM CLI commands begin with `sdm`. To view a list of possible commands, enter `sdm --help` or `sdm -h`. Visit the [CLI Reference](/references/cli) documentation for the same help text returned by appending the `--help` or `-h` flag to commands, along with information about commonly used CLI commands and how to filter them.
{% endhint %}

### Review Logs

All actions, queries, sessions, and errors that occur when any user uses StrongDM are logged by StrongDM. In the Admin UI, you can see a record of what you just did by going to the **Logs** section and selecting the log type you wish you review (for example, Activities or Queries).

To change where and how logs are stored, go to **Settings** > **Security** and select the **Log Encryption & Storage** tab.

### Recommended Reading

This quick start guide provides the basic setup information to begin using StrongDM. For even more detailed information about StrongDM deployment, usage, and configuration, please see the rest of the StrongDM documentation.

We recommend starting with the [Admin](/admin) documentation, which explains how to use and configure the administrative features found in the Admin UI and CLI.

In particular, as an admin, you may wish to explore topics in the following order:

* [Gateway and relay setup](/admin/networking/gateways-and-relays)
* [Deployment](/admin/deployment)
* [Resource setup](/admin/resources)
* [User management](/admin/principals)
* [Identity provider configuration for SSO](/admin/principals/sso)
* [Identity provider configuration for Provisioning](/admin/principals/provisioning)
* [Auditing](/admin/audit)
* [Logging](/admin/audit/logs)
* [CLI Reference](/references/cli)
* [API Reference](/references/api)

For installation guides and resource connection information for users using the desktop app and/or CLI, please see the [StrongDM Client](/users/client) section.


# Terraform

Instead of manually creating StrongDM resources, you can use Terraform to quickly deploy common infrastructure configurations. StrongDM is a registered provider in the Terraform Registry. For usage examples and additional information, see our [Terraform provider](https://registry.terraform.io/providers/strongdm/sdm/latest/docs) documentation.

If you are trying to quickly spin up a Terraform-powered StrongDM environment in Amazon Web Services (AWS) or Microsoft Azure, you can refer to the quick start guides in this section. These guides include robust examples to run StrongDM's Terraform provider in conjunction with various cloud platforms.


# Quick Start StrongDM With Terraform and AWS

### Overview

This Terraform module gets you up and running with StrongDM quickly by automating the creation of a variety of users, resources, and gateways. Keep reading to get hands-on experience and test StrongDM's capabilities when integrating with Amazon Web Services (AWS).

### Prerequisites

To successfully run the AWS Terraform module, you need the following:

* A StrongDM administrator account. If you do not have one, [sign up](https://www.strongdm.com/signup-contact/) for a trial.
* An [API key](/references/api/api-keys), which you can generate in the StrongDM Admin UI. Your StrongDM API key needs all permissions granted to it in order to generate the users and resources for these Terraform scripts.
* [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) v0.14.0 or higher installed on your computer.
* An AWS account and an AWS API key with permissions to provision all intended AWS resources. To control these settings, go to your [AWS Dashboard](https://console.aws.amazon.com/ec2/v2/home) and click **Key Pairs**.

{% hint style="warning" %}
These scripts create infrastructure resources in your AWS account, incurring AWS costs. Once you are done testing, remove these resources to prevent unnecessary AWS costs. You can remove resources manually or with `terraform destroy`. StrongDM provides these scripts as is, and does not accept liability for any alterations to AWS assets or any AWS costs incurred.
{% endhint %}

### Run the Terraform Module

Our [public GitHub repository](https://github.com/strongdm/terraform-sdm-onboarding) stores code examples for your Terraform onboarding quick start with AWS. To work with the examples in our repository, follow these directions.

1. Clone the repository:

   ```shell
   git clone https://github.com/strongdm/terraform-sdm-onboarding.git
   ```
2. Switch to the directory containing the cloned project:

   ```shell
   cd terraform-sdm-onboarding
   ```
3. Initialize the working directory containing the Terraform configuration files:

   ```shell
   terraform init
   ```
4. Execute the actions proposed in the Terraform plan:

   ```shell
   terraform apply
   ```
5. The script asks you for the following values. If you prefer not to enter these values each time you run the module, you can store them in the `variables.tf` file found in the root of the project.

   * Your AWS access key ID and secret
   * Your AWS region
   * Your StrongDM API key ID and secret
   * Your StrongDM administrator email

   Once you add these values, the script runs until it is complete. Note any errors. If there are no errors, you should see new resources, such as gateways, databases, or servers, in the StrongDM Admin UI. Additionally, your AWS Management Console displays any new EC2 instances added when you ran the module.
6. If necessary, remove the resources created with your Terraform plan:

   ```shell
   terraform destroy
   ```

### Customize the Terraform Module

You can optionally modify the `onboarding.tf` file to meet your needs, including altering the resource prefix, or spinning up additional resources that are commented out in the script.

To give you an idea of the script's total run time, the file provides estimates to indicate the time it may take to spin up each resource after Terraform triggers it. Additionally, there are a few other items to consider in relation to the `onboarding.tf` file:

* You can add resource tags at the bottom of the file.
* You may choose not to provision any of the resources listed by commenting them out in the script or by altering their value to `false`. In order to successfully test, you need to keep at least one resource and one StrongDM gateway.

### Conclusion

Feel free to create additional resources and to test as much as needed. Once you are finished testing, remember to run `terraform destroy` from your project directory. With this command, Terraform deprovisions the AWS assets it created and it also removes the StrongDM assets from the Admin UI. This cleans up after your testing and ensures that test assets do not accumulate unwanted costs while sitting unused.


# Quick Start StrongDM With Terraform and Azure

### Overview

This Terraform module gets you up and running with StrongDM quickly by automating the creation of a variety of users, resources, and gateways. Keep reading to get hands-on experience and test StrongDM's capabilities when integrating with Microsoft Azure.

### Prerequisites

To successfully run the Azure Terraform module, you need the following:

* A StrongDM administrator account. If you do not have one, [sign up](https://www.strongdm.com/signup-contact/) for a trial.
* A [StrongDM API key](/references/api/api-keys), which you can generate in the StrongDM Admin UI. Your StrongDM API key needs all permissions granted to it in order to generate the users and resources for these Terraform scripts.
* [Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) v0.15.0 or higher installed on your computer.
* An Azure account and the ability to log in to the local Azure CLI.

These scripts create infrastructure resources in your Azure account, incurring Azure costs. Once you are done testing, remove these resources to prevent unnecessary Azure costs. You can remove resources manually or with `terraform destroy`. StrongDM provides these scripts as is, and does not accept liability for any alterations to Azure assets or any Azure costs incurred.

### Run the Terraform Module

Our [public GitHub repository](https://github.com/strongdm/SDM-Azure-Terraform-Onboarding) stores code examples for your Terraform onboarding quick start with . To work with the examples in our repository, follow these directions.

1. Clone the repository:

   ```shell
   git clone https://github.com/strongdm/SDM-Azure-Terraform-Onboarding.git
   		
   ```
2. Switch to the directory containing the cloned project:

   ```shell
   cd SDM-Azure-Terraform-Onboarding
   		
   ```
3. Initialize the working directory containing the Terraform configuration files:

   ```shell
   terraform init
   		
   ```
4. Execute the actions proposed in the Terraform plan:

   ```shell
   terraform apply
   		
   ```
5. The script asks you for the following values. If you prefer not to enter these values each time you run the module, you can store them in the `variables.tf` file found in the root of the project.

   * Your preferred Azure region
   * Your StrongDM API key ID and secret
   * Your StrongDM administrator email

   Once you add these values, the script runs until it is complete. Note any errors. If there are no errors, you should see new resources, such as gateways, databases, or servers, in the StrongDM Admin UI. Additionally, you should be able to look at your Azure portal to see the new instances.
6. If necessary, remove the resources created with your Terraform plan:

   ```shell
   terraform destroy
   		
   ```

### Customize the Terraform Module

You can optionally modify the `onboarding.tf` file to meet your needs, including altering the resource prefix, or spinning up additional resources that are commented out in the script.

To give you an idea of the script's total runtime, the file provides estimates to indicate the time it may take to spin up each resource after Terraform triggers it. Additionally, there are a few other items to consider in relation to the `onboarding.tf` file:

* You can add resource tags at the bottom of the file.
* You may choose not to provision any of the resources listed by commenting them out in the script or by altering their value to `false`. In order to successfully test, you need to keep at least one resource and one StrongDM gateway.

### Conclusion

Feel free to create additional resources and to test as much as needed.

Once you are finished testing, remember to run `terraform destroy` from your project directory. With this command, Terraform deprovisions the assets it created and it also removes the StrongDM assets from the Admin UI. This cleans up after your testing and ensures that test assets do not accumulate unwanted costs while sitting unused.


# Deployment Scenarios

{% content-ref url="/pages/OTYyzJ4Y3DqWSC1QxWU1" %}
[Ansible with SDM](/admin/deployment/scenarios/ansible)
{% endcontent-ref %}

{% content-ref url="/pages/wMexaoIT7MOpfgnTwClr" %}
[AWS Registration and Cleanup](/admin/deployment/scenarios/aws-user-data)
{% endcontent-ref %}

{% content-ref url="/pages/ZiNSaMIWacmaCf7V7njT" %}
[Create a Self-Registering Relay with Chef](/admin/deployment/scenarios/chef)
{% endcontent-ref %}

{% content-ref url="/pages/4tcQkHMF9HB7LTje9r7r" %}
[Deploy Gateways Via AWS Organizations With CloudFormation StackSets](/admin/deployment/scenarios/cloudformation-stacksets)
{% endcontent-ref %}

{% content-ref url="/pages/BI7SyUHyzhkq7aBetsD1" %}
[Deploy HA Gateways with CloudFormation](/admin/deployment/scenarios/cloudformation)
{% endcontent-ref %}

{% content-ref url="/pages/biv5cR6hGj0EuyHcqCZy" %}
[Grant Temporary Access with a Hubot Chatbot](/admin/deployment/scenarios/hubot-chatbot)
{% endcontent-ref %}

{% content-ref url="/pages/AnHqXtaQsgDGY8OYojEg" %}
[Use Chef Knife with SDM](/admin/deployment/scenarios/knife)
{% endcontent-ref %}

{% content-ref url="/pages/XGy1OZ8dpWVaHYT53Vy5" %}
[Automate Temporary Access with PagerDuty Schedules](/admin/deployment/scenarios/pagerduty)
{% endcontent-ref %}


# Ansible with SDM

1. Install the SDM ssh aliases by adding the output of `sdm ssh alias` to your `.bashrc` file or running directly on the command line.
2. Create an Ansible inventory file with the following format:

   ```ini
   [group_name]
   sdm_server_name ansible_port=sdm_ssh_port ansible_host=127.0.0.1
   ```

   For example, if you have the following SSH servers configured...

   ... then your inventory file should look like this.

   ```ini
   [sdm]
   bastion01 ansible_port=60672 ansible_host=127.0.0.1
   bastion02 ansible_port=61300 ansible_host=127.0.0.1
   deployment04 ansible_port=60834 ansible_host=127.0.0.1
   ```
3. Connect to the servers you want to access using sdm: either click on each one in the UI and ensure the green lightning bolt icon is visible next to each, or run `sdm connect sdm_server_name` for each (or `sdm connect --all`).
4. Run Ansible using that inventory file.

   ```bash
   $ ansible -i ansibleinventory sdm -a "echo hello"
   deployment04 | SUCCESS | rc=0 >>
   hello

   bastion01 | SUCCESS | rc=0 >>
   hello

   bastion02 | SUCCESS | rc=0 >>
   hello
   ```


# AWS Registration and Cleanup

In AWS environments, EC2 instances are often created and destroyed via automated processes.

By following this recipe, these instances may be automatically registered and de-registered in StrongDM.

### EC2 User Data Script

EC2 User Data scripts can perform EC2 instance initialization tasks.

In the script below, the `sdm` binary is used to self-register via the `sdm admin ssh add` command.

The `-p` argument to the `add` command will result in an SSH public key to be printed. The key is then appended to `$TARGET_USER/.ssh/authorized_keys`.

{% hint style="info" %}
Both the `sdm admin ssh add` and `sdm admin servers add` commands (without a `type` set) default (are aliased to) the type `ssh`, as in `sdm admin servers add ssh`. If you include any `type` as the last parameter, it will supersede that default.
{% endhint %}

`SDM_ADMIN_TOKEN` should be generated with only the **Datasources & Servers > List, Update, Create** and **Roles > List** permissions via the Admin Token section of the admin UI.

This script is designed for Ubuntu AMIs; change update commands and `TARGET_USER` as needed for your environment.

```bash
 #!/bin/bash

 export SDM_ADMIN_TOKEN=XXX
 export TARGET_USER=ubuntu

 apt update
 apt install -y unzip
 curl -o sdm.zip -L https://app.strongdm.com/releases/cli/linux
 unzip sdm.zip
 ./sdm admin ssh add \
   -p `curl http://169.254.169.254/latest/meta-data/instance-id` \
   $TARGET_USER@`curl http://169.254.169.254/latest/meta-data/public-hostname` \
   | tee -a "/home/$TARGET_USER/.ssh/authorized_keys"
 ./sdm admin roles grant `curl http://169.254.169.254/latest/meta-data/instance-id`       Engineers
 rm sdm.zip
```

### Cleanup Script

The following script can automatically remove terminated EC2 instances from the list of available StrongDM servers.

`SDM_ADMIN_TOKEN` should be generated with only the **Datasources & Servers > List, Delete** permissions via the Admin Token section of the admin UI.

```bash
#!/bin/bash

# ec2-gc-demo sandbox environment garbage collection demo key
export AWS_ACCESS_KEY_ID=XXX
export AWS_SECRET_ACCESS_KEY=XXX
export SDM_ADMIN_TOKEN=XXX

# garbage collect any servers by instance ID
aws ec2 describe-instances --region us-west-2 --output json \
  --query 'Reservations[*].Instances[*].[InstanceId]' \
  --filters "Name=instance-state-name,Values=[terminated,shutting-down]" \
  | jq 'add' | jq 'flatten | .[]' \
  | while read -r instid; do eval sdm admin servers delete $instid; done
```


# Create a Self-Registering Relay with Chef

While our [Nodes Guide](/admin/networking/gateways-and-relays) walks you through setting up an individual relay, you might want to have a self-managed set of relays/gateways that will spin up and down without you needing to generate a token for each one. This Chef recipe will walk you through generating a reusable [admin token](/admin/principals/admin-tokens), which you can reuse, that brings up its own relay or gateway token to register itself to your StrongDM organization.

### Generating the Token

You can generate an admin token that has only one function: creating relay/gateway tokens. Do this in the Admin UI under *Settings / Admin Tokens*. Select **Create** under **Relays** then click the **Create** button. Copy the token that is printed to screen as you will need it later, and you cannot get it back.

{% hint style="info" %}
For more detailed information on creating admin tokens, check out the [admin token guide](/admin/principals/admin-tokens).
{% endhint %}

### Create the Recipe

The recipe requires a folder structure like this:

```ascii
strong-dm
├── recipes
│   └── default.rb
└── templates
    └── default
        └── init.sh.erb
```

There are two files in there, which we'll look at in turn.

#### default.rb

```rb
template '/usr/local/bin/sdm-init.sh' do
  source 'init.sh.erb'
  variables(
    myip: node['ec2']['local_ipv4'],
    admin_token: Chef::EncryptedDataBagItem.load('strongdm', 'admin-token')['content']
  )
  mode '0500'
  owner 'ubuntu'
  notifies :run, 'execute[sdm-init]', :immediately
  action :create_if_missing
end

execute 'sdm-init' do
  command '/usr/local/bin/sdm-init.sh'
  action :nothing
end
```

Note here that you'll need to have the admin token generated above located in a Chef encrypted data bag.

#### init.sh.erb

```bash
#!/bin/sh
sudo -i
cd /tmp
mkdir sdm
cd sdm
curl -J -O -L https://app.strongdm.com/releases/cli/linux
unzip *.zip

export SDM_ADMIN_TOKEN=<%= @admin_token %>
export SDM_RELAY_TOKEN=`./sdm relay create-gateway <%= @myip %>:5000 0.0.0.0:5000`
rm /root/.sdm/*
unset SDM_ADMIN_TOKEN
export SUDO_USER=ubuntu
export SUDO_UID=1000
export USERNAME=root
export USER=root
export HOME=/root
export LOGNAME=root
export SUDO_GID=1000
./sdm install --node
```

{% hint style="info" %}
This script creates a gateway. To make a relay instead, change the `SDM_RELAY_TOKEN` line to `./sdm relay create`.
{% endhint %}

Of note here:

* Set the correct unprivileged user under `SUDO_USER` and `SUDO_UID`
* Set the correct port for the gateway to listen on under `SDM_RELAY_TOKEN`.
* You can optionally name the relay/gateway by adding the `--name <name>` flag to the `sdm relay` command.
* If your organization uses a control plane located in a region other than the default, add a `--region yourdomain` flag to the install commands, such as:

  ```sh
  ./sdm install --region app.uk.strongdm.com --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
  ```

### Verify Your New Node

Log into the Admin UI. In that section, the relay or gateway you created should appear with the **online** status and a heartbeat.


# Deploy Gateways Via AWS Organizations With CloudFormation StackSets

### Overview

This guide describes how to deploy StrongDM gateways across multiple AWS accounts within an AWS organization using CloudFormation StackSets.

### Prerequisites

* StrongDM Administrator account
* StrongDM [admin token](/admin/principals/admin-tokens) with the ability to list and create gateways
* AWS organization set up with multiple member accounts
* AWS Identity and Access Management (IAM) role with permissions to create and manage StackSets
* Basic knowledge of [AWS CloudFormation and StackSets](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html)

### Procedure

#### Prepare CloudFormation templates

You may leverage this YAML template as the basis for one that would function in your AWS environment:

```yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: StrongDM self-registering gateway with VPC creation
Parameters:
  # StrongDM variables
  SDMListenPort:
    Type: Number
    Default: 5000
    MinValue: 1024
    MaxValue: 65535
    Description: The TCP port that will be exposed to the internet
  SDMAdminToken:
    AllowedPattern: (.+)
    Type: String
    Description: Paste your StrongDM admin token to create the gateway
  LatestAmiId:
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
  CommonVpcCIDR:
    Type: String
    MinLength: 9
    MaxLength: 18
    AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
    ConstraintDescription: Must be a valid CIDR range in the form x.x.x.x/x
    Default: 10.112.0.0/16
  PublicACIDR:
    Type: String
    MinLength: 9
    MaxLength: 18
    AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
    ConstraintDescription: Must be a valid CIDR range in the form x.x.x.x/x
    Default: 10.112.0.0/22
  PublicBCIDR:
    Type: String
    MinLength: 9
    MaxLength: 18
    AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
    ConstraintDescription: Must be a valid CIDR range in the form x.x.x.x/x
    Default: 10.112.4.0/22
  PrivateACIDR:
    Type: String
    MinLength: 9
    MaxLength: 18
    AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
    ConstraintDescription: Must be a valid CIDR range in the form x.x.x.x/x
    Default: 10.112.12.0/22
  PrivateBCIDR:
    Type: String
    MinLength: 9
    MaxLength: 18
    AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
    ConstraintDescription: Must be a valid CIDR range in the form x.x.x.x/x
    Default: 10.112.16.0/22
# Organization structure for parameters
Metadata:
  AWS::CloudFormation::Interface:
    ParameterGroups:
      -
        Label:
          default: "StrongDM Configuration"
        Parameters:
          - SDMAdminToken
          - SDMListenPort
Resources:
  VPC:
    Type: "AWS::EC2::VPC"
    Properties:
      EnableDnsSupport: true
      EnableDnsHostnames: true
      CidrBlock: !Ref CommonVpcCIDR
      Tags:
        - Key: Name
          Value: ACBL VPC
  IGW:
    Type: "AWS::EC2::InternetGateway"
  GatewayAttach:
    Type: "AWS::EC2::VPCGatewayAttachment"
    Properties:
      InternetGatewayId: !Ref IGW
      VpcId: !Ref VPC
  SubnetPublicSharedA:
    Type: "AWS::EC2::Subnet"
    Properties:
      AvailabilityZone: !Select [0, !GetAZs ]
      CidrBlock: !Ref PublicACIDR
      MapPublicIpOnLaunch: true
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: !Sub "Public A - ${PublicACIDR}"
  SubnetPublicSharedB:
    Type: "AWS::EC2::Subnet"
    Properties:
      AvailabilityZone: !Select [1, !GetAZs ]
      CidrBlock: !Ref PublicBCIDR
      MapPublicIpOnLaunch: true
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: !Sub "Public B - ${PublicBCIDR}"
  SubnetPrivateSharedA:
    Type: "AWS::EC2::Subnet"
    Properties:
      AvailabilityZone: !Select [0, !GetAZs ]
      CidrBlock: !Ref PrivateACIDR
      MapPublicIpOnLaunch: false
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: !Sub "Private A - ${PrivateACIDR}"
  SubnetPrivateSharedB:
    Type: "AWS::EC2::Subnet"
    Properties:
      AvailabilityZone: !Select [1, !GetAZs ]
      CidrBlock: !Ref PrivateBCIDR
      MapPublicIpOnLaunch: false
      VpcId: !Ref VPC
      Tags:
        - Key: Name
          Value: !Sub "Private B - ${PrivateBCIDR}"
  SubnetRouteTableAssociatePublicA:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      RouteTableId: !Ref RouteTablePublic
      SubnetId: !Ref SubnetPublicSharedA
  SubnetRouteTableAssociatePublicB:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      RouteTableId: !Ref RouteTablePublic
      SubnetId: !Ref SubnetPublicSharedB
  SubnetRouteTableAssociatePrivateA:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      RouteTableId: !Ref RouteTablePrivate
      SubnetId: !Ref SubnetPrivateSharedA
  SubnetRouteTableAssociatePrivateB:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      RouteTableId: !Ref RouteTablePrivate
      SubnetId: !Ref SubnetPrivateSharedB
  RouteDefaultPublic:
    Type: "AWS::EC2::Route"
    DependsOn: GatewayAttach
    Properties:
      DestinationCidrBlock: 0.0.0.0/0
      GatewayId: !Ref IGW
      RouteTableId: !Ref RouteTablePublic
  RouteDefaultPrivate:
    Type: "AWS::EC2::Route"
    Properties:
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId: !Ref NatGateway
      RouteTableId: !Ref RouteTablePrivate
  RouteTablePublic:
    Type: "AWS::EC2::RouteTable"
    Properties:
      VpcId: !Ref VPC
  RouteTablePrivate:
    Type: "AWS::EC2::RouteTable"
    Properties:
      VpcId: !Ref VPC
  EIPNatGW:
    DependsOn: GatewayAttach
    Type: "AWS::EC2::EIP"
    Properties:
      Domain: vpc
  NatGateway:
    DependsOn: GatewayAttach
    Type: "AWS::EC2::NatGateway"
    Properties:
      AllocationId: !GetAtt EIPNatGW.AllocationId
      SubnetId: !Ref SubnetPublicSharedB
  EC2SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "Expose StrongDM listening port"
      VpcId: !Ref VPC
      SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: !Ref SDMListenPort
        ToPort: !Ref SDMListenPort
        CidrIp: 0.0.0.0/0
  SDMGWONE:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t3.medium
      Tags: 
        - Key: "Name"
          Value: "StrongDM Gateway One"
      NetworkInterfaces:
        - DeviceIndex: '0'
          SubnetId: !Ref SubnetPublicSharedA
          AssociatePublicIpAddress: 'true'
          DeleteOnTermination: 'true'
          GroupSet: [!Ref EC2SecurityGroup]
      ImageId: !Ref LatestAmiId
      UserData:
        Fn::Base64:
          !Sub |
            #!/bin/bash -xe
            # set environment variables
            mkdir -p /home/ec2-user/.sdm
            touch /home/ec2-user/.sdm/sdm.log
            export TARGET_USER=ec2-user
            export SDM_LISTEN_PORT=${SDMListenPort}
            export SDM_GATEWAY_NAME=AWS-CloudFormation-$(date +%s)
            export SDM_HOSTNAME="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
            export SDM_HOME="/home/ec2-user/.sdm"
            # downloads sdm binary
            yum update -y && yum install -y unzip curl
            curl -J -O -L https://app.strongdm.com/releases/cli/linux && unzip sdmcli* && rm sdmcli*
            # Generate a gateway token
            export SDM_RELAY_TOKEN="$(./sdm --admin-token=${SDMAdminToken} relay create-gateway --name $SDM_GATEWAY_NAME $SDM_HOSTNAME:$SDM_LISTEN_PORT 0.0.0.0:$SDM_LISTEN_PORT)"
            chown -R ec2-user:ec2-user /home/ec2-user/.sdm
            # Install SDM
            ./sdm install --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
  SDMGWTWO:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t3.medium
      Tags: 
        - Key: "Name"
          Value: "StrongDM Gateway TWO"
      NetworkInterfaces:
        - DeviceIndex: '0'
          SubnetId: !Ref SubnetPublicSharedB
          AssociatePublicIpAddress: 'true'
          DeleteOnTermination: 'true'
          GroupSet: [!Ref EC2SecurityGroup]
      ImageId: !Ref LatestAmiId
      UserData:
        Fn::Base64:
          !Sub |
            #!/bin/bash -xe
            # set environment variables
            mkdir -p /home/ec2-user/.sdm
            touch /home/ec2-user/.sdm/sdm.log
            export TARGET_USER=ec2-user
            export SDM_LISTEN_PORT=${SDMListenPort}
            export SDM_GATEWAY_NAME=AWS-CloudFormation-$(date +%s)
            export SDM_HOSTNAME="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
            export SDM_HOME="/home/ec2-user/.sdm"
            # downloads sdm binary
            yum update -y && yum install -y unzip curl
            curl -J -O -L https://app.strongdm.com/releases/cli/linux && unzip sdmcli* && rm sdmcli*
            # Generate a gateway token
            export SDM_RELAY_TOKEN="$(./sdm --admin-token=${SDMAdminToken} relay create-gateway --name $SDM_GATEWAY_NAME $SDM_HOSTNAME:$SDM_LISTEN_PORT 0.0.0.0:$SDM_LISTEN_PORT)"
            chown -R ec2-user:ec2-user /home/ec2-user/.sdm
            # Install SDM
            ./sdm install --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
Outputs:
  VpcId:
    Description: ID of the created VPC
    Value: !Ref VPC
  SecurityGroupId:
    Description: Security Group ID for StrongDM gateway
    Value: !GetAtt [ EC2SecurityGroup, GroupId ]
```

The above YAML template creates the following infrastructure components in each target account and region specified during StackSet deployment:

* New VPC
* Two public subnets
* Two private subnets
* Publicly accessible StrongDM gateway in each of the public subnets
* Associated route tables, security groups, NAT gateways, and IGWs for the above

Every organization’s environment and architecture is unique, and the template should be modified to suit each organization as necessary.

{% hint style="info" %}
If your organization uses a control plane located in a region other than the default, add a `--region yourdomain` flag to the install commands, such as:

```sh
./sdm install --region app.uk.strongdm.com --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
```

{% endhint %}

#### Gather necessary parameters and input to deploy

Gather necessary information to deploy, such as the StrongDM admin token. If using the included template, you will need the following as input parameters:

* StrongDM [admin token](/admin/principals/admin-tokens)
* Port gateways listen on (default is `5000`)
* Private CIDR range for the new VPC (default is `10.112.0.0/16`)
* [StrongDM Gateway AMI](/admin/networking/gateways-and-relays/sdm-ami) (default is the latest provided by StrongDM)
* Private CIDR range for both private subnets

#### Prepare IAM permissions

Create an IAM role with permissions required for deploying resources defined in your CloudFormation templates. This role should have sufficient permissions to create EC2 instances, IAM roles, security groups, network components, and so forth, across all member accounts within the AWS organization. Assuming into child accounts via an administrator role may be an option if starting from the master root account as documented on [Amazon](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html).

#### Create StackSets

1. Navigate to AWS CloudFormation service in the AWS Management Console.
2. Select **StackSets** from the menu.
3. Click on **Create StackSet** and choose the CloudFormation template prepared in [Prepare CloudFormation templates](#prepare-cloudformation-templates).
4. Specify the IAM role created in [Prepare IAM Permissions](#prepare-iam-permissions) as the execution role for StackSets.
5. Configure parameters that are required in the template.
6. Choose the AWS organization as the deployment target.

#### Configure deployment options

Specify deployment options, such as region availability, deployment schedule, and rollback options as per your requirements.

#### Deploy StackSets

Review the configuration settings and initiate the deployment of StackSets. Monitor the deployment progress in the StackSets dashboard.

#### Validate deployment

Once the deployment is complete, validate that StrongDM gateways are provisioned across all member accounts and target regions as configured/desired within the AWS organization.

Ensure that the gateways are functioning correctly, are shown as healthy in StrongDM, and are accessible as expected.


# Deploy HA Gateways with CloudFormation

The following guide shows an example of how to quickly create a pair of StrongDM gateways using AWS's CloudFormation. The only requirement is a StrongDM [admin token](/admin/principals/admin-tokens) with the ability to list and create gateways. When creating the admin token, check the Relays - List and Relays - Create permissions.

### Procedure

1. Navigate to your AWS console.
2. Search for and open the CloudFormation service.
3. Click **Create stack**.
4. Choose **Upload a template file**.
5. Upload the below YAML file.
6. Follow on-screen instructions.

### Parameters

When launched, this stack will prompt you for the following parameters:

1. **PublicSubnet1**: Designates the subnet in which to launch the EC2 instance. **This subnet needs to be public**.
2. **PublicSubnet2**: Designates the subnet in which to launch a second EC2 instance for high availability. **This subnet needs to be public**.
3. **VPC**: Select the VPC that the subnet above belongs to. This VPC needs [DNS hostnames](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html) enabled for the gateway to properly register.
4. **SDMListenPort**: This port number will be used for clients to connect to the this gateway.
5. **SDMAdminToken**: Input a StrongDM admin token that has the *Relays / Create* permission.

### Resources

This template will create the following resources

1. EC2 Instance Gateway One
   * Instance type `t3.medium`
   * Operating system `Amazon Linux 2`
2. EC2 Instance Gateway Two
   * Instance type `t3.medium`
   * Operating system `Amazon Linux 2`
3. Security group
   * This security group allows connections from StrongDM clients into your VPC
   * The `SDMlistenPort` specified during creation time will be open from anywhere

### Outputs

This template exports the EC2 security group so that it may be used as an input rule for your databases and servers in other templates.

### CloudFormation Template

```yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: StrongDM self-registering gateway
Parameters:
  # Network information
  PublicSubnet1:
    Description: Subnet to use as an access point into your AWS network. Must contain a route open to the internet.
    Type: AWS::EC2::Subnet::Id
  PublicSubnet2:
    Description: Subnet to use as an access point into your AWS network. Must contain a route open to the internet.
    Type: AWS::EC2::Subnet::Id
  VPC:
    Description: The VPC that contains the public subnet listed above
    Type: AWS::EC2::VPC::Id
  # StrongDM variables
  SDMListenPort:
    Type: Number
    Default: 5000
    MinValue: 1024
    MaxValue: 65535
    Description: The TCP port that will be exposed to the internet
  SDMAdminToken:
    AllowedPattern: (.+)
    Type: String
    Description: Paste your StrongDM admin token to create the gateway
  # Get latest Amazon Linux AMI
  LatestAmiId:
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
# Organization structure for parameters
Metadata:
  AWS::CloudFormation::Interface:
    ParameterGroups:
      -
        Label:
          default: "AWS Configuration"
        Parameters:
          - PublicSubnet1
          - PublicSubnet2
          - VPC
      -
        Label:
          default: "StrongDM Configuration"
        Parameters:
          - SDMAdminToken
          - SDMListenPort
      -
        Label:
          default: "This will grab the latest Amazon Linux 2 AMI ID"
        Parameters:
          - LatestAmiId
# Resources to be created
Resources:
  SDMGWONE:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t3.medium
      Tags: 
        - Key: "Name"
          Value: "StrongDM Gateway One"
      NetworkInterfaces:
        - DeviceIndex: '0'
          SubnetId: !Ref 'PublicSubnet1'
          AssociatePublicIpAddress: 'true'
          DeleteOnTermination: 'true'
          GroupSet: [!GetAtt [ EC2SecurityGroup, GroupId ]]
      ImageId: !Ref LatestAmiId
      UserData:
        Fn::Base64:
          !Sub |
            #!/bin/bash -xe
            # set environment variables
            mkdir -p /home/ec2-user/.sdm
            touch /home/ec2-user/.sdm/sdm.log
            export TARGET_USER=ec2-user
            export SDM_LISTEN_PORT=${SDMListenPort}
            export SDM_GATEWAY_NAME=AWS-CloudFormation-One-$(date +%s)
            export SDM_HOSTNAME="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
            export SDM_HOME="/home/ec2-user/.sdm"
            # downloads sdm binary
            yum update -y && yum install -y unzip curl
            curl -J -O -L https://app.strongdm.com/releases/cli/linux && unzip sdmcli* && rm sdmcli*
            # Generate a gateway token
            export SDM_RELAY_TOKEN="$(./sdm --admin-token=${SDMAdminToken} relay create-gateway --name $SDM_GATEWAY_NAME $SDM_HOSTNAME:$SDM_LISTEN_PORT 0.0.0.0:$SDM_LISTEN_PORT)"
            chown -R ec2-user:ec2-user /home/ec2-user/.sdm
            # Install SDM
            ./sdm install --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
  SDMGWTWO:
    Type: AWS::EC2::Instance
    Properties:
      InstanceType: t3.medium
      Tags: 
        - Key: "Name"
          Value: "StrongDM Gateway Two"
      NetworkInterfaces:
        - DeviceIndex: '0'
          SubnetId: !Ref 'PublicSubnet2'
          AssociatePublicIpAddress: 'true'
          DeleteOnTermination: 'true'
          GroupSet: [!GetAtt [ EC2SecurityGroup, GroupId ]]
      ImageId: !Ref LatestAmiId
      UserData:
        Fn::Base64:
          !Sub |
            #!/bin/bash -xe
            # set environment variables
            mkdir -p /home/ec2-user/.sdm
            touch /home/ec2-user/.sdm/sdm.log
            export TARGET_USER=ec2-user
            export SDM_LISTEN_PORT=${SDMListenPort}
            export SDM_GATEWAY_NAME=AWS-CloudFormation-Two-$(date +%s)
            export SDM_HOSTNAME="$(curl http://169.254.169.254/latest/meta-data/public-hostname)"
            export SDM_HOME="/home/ec2-user/.sdm"
            # downloads sdm binary
            yum update -y && yum install -y unzip curl
            curl -J -O -L https://app.strongdm.com/releases/cli/linux && unzip sdmcli* && rm sdmcli*
            # Generate a gateway token
            export SDM_RELAY_TOKEN="$(./sdm --admin-token=${SDMAdminToken} relay create-gateway --name $SDM_GATEWAY_NAME $SDM_HOSTNAME:$SDM_LISTEN_PORT 0.0.0.0:$SDM_LISTEN_PORT)"
            chown -R ec2-user:ec2-user /home/ec2-user/.sdm
            # Install SDM
            ./sdm install --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
  EC2SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: "Expose StrongDM listening port"
      GroupName: !Sub "${AWS::StackName}"
      VpcId: !Ref 'VPC'
      Tags: 
        - Key: "Name"
          Value: !Sub "${AWS::StackName}"
      SecurityGroupIngress:
      - IpProtocol: tcp
        FromPort: !Ref 'SDMListenPort'
        ToPort: !Ref 'SDMListenPort'
        CidrIp: 0.0.0.0/0
Outputs:
  SDMGatewaySecurityGroupID:
    Description: Security Group ID for StrongDM gateway
    Value: !GetAtt [ EC2SecurityGroup, GroupId ]
    Export:
      Name: !Join [ ':', [ !Ref 'AWS::StackName', 'SecurityGroupID' ] ]
```

{% hint style="info" %}
If your organization uses a control plane located in a region other than the default, add a `--region yourdomain` flag to the install commands, such as:

```sh
./sdm install --region app.uk.strongdm.com --node --token=$SDM_RELAY_TOKEN --user $TARGET_USER
```

{% endhint %}


# Grant Temporary Access with a Hubot Chatbot

If you are using a Hubot chatbot to automate common activities, you can integrate with the `sdm` Linux binary to handle common administrative tasks. This guide shows how to add a Hubot command to grant temporary access to datasources and servers. In this guide, we use the Heroku deployment method; modify as needed if you're using a different deployment type.

### Setup

1. Set up a Hubot chatbot according to the directions on the [Hubot site](https://hubot.github.com/docs/deploying/heroku).
2. Once the setup is done, copy the \[Linux binary[Linux Installation Guide](/users/client/linux) into the `bin/` directory in your Hubot tree.
3. Create an [admin token](/admin/principals/admin-tokens) in the Admin UI with the following permissions:
   * datasource:grant
   * datasource:list
   * user:assign
   * user:list
4. Add two environment variables to your Hubot:

   ```bash
   heroku config:set SDM_HOME=/app
   heroku config:set SDM_ADMIN_TOKEN=<admin token here>
   ```
5. Add an SDM script to `scripts/`. Here is a barebones example that will grant access to datasources for one hour.

   ```javascript
   module.exports = (robot) ->
   robot.hear /access to (.*)/i, (res) ->
   target = res.match[1]
   email = res.envelope.user.email_address
   res.reply "Granting #{email} access to '#{target}' for 1 hour"
   spawn('sdm', ['admin','users','grant-temporary','-d','1h',target,email])
   ```
6. Deploy the changes with `git push heroku master`
7. Test by telling the bot `Grant me access to datasource`. It should respond with `Granting <email> access to 'datasource' for 1 hour`

### Enhancements

There are a number of ways to improve your Hubot's StrongDM integration. Here are a few examples:

1. Ensure the datasource/server requested actually exists by having the bot run `sdm admin datasources list -j` which will output a JSON-formatted list of datasources, and `sdm admin servers list -j` for SSH/RDP.
2. Add additional sanitization and error checking.
3. Ensure (through your own systems) that the requester is authorized to perform temporary grants of this nature.


# Use Chef Knife with SDM

When using the `knife ssh` command, Knife reaches out to the Chef server with a query string, Chef responds back with a list of hosts that match that query string, and Knife then runs commands via SSH on all returned hosts. This document describes how to set up StrongDM SSH functionality to work with the `knife ssh` command.

{% hint style="info" %}
This guide assumes all relevant servers have already been configured to work with Chef and are using an SSH client that supports the Include directive (OpenSSH 7.3+).
{% endhint %}

1. Configure all Chef-configured SSH hosts in StrongDM under the *Servers* page. Grant appropriate role-based access to these servers to the StrongDM users that will be using Knife.
2. At the command line of a system running the StrongDM client, run `sdm ssh config`. This will do two things:
   1. Generate an SSH config file in `$HOME/.sdm/ssh_config` containing entries for each SSH server the user has rights to
   2. Add a line to the top of `$HOME/.ssh/config` to reference the generated file

{% hint style="info" %}
The `sdm ssh config` command will generate an `ssh_config` file based on *how the SSH server is configured within StrongDM*. Keep in mind that Knife resolves IP addresses on the client side, so in order for StrongDM to properly intercept those SSH calls, it must be aware of the hostname of the SSH server *as seen by the Knife client*. In practice, this means setting up the SSH servers in the StrongDM UI with the hostname that Knife resolves and uses.
{% endhint %}

1. Connect to the servers you want to access using `sdm`: either click on each one in the UI and ensure the green lightning bolt icon is visible next to each, or run `sdm connect sdm_server_name` for each (or optionally, `sdm connect --all`).
2. To test, run a Knife command that will reference one specific host that is now in your custom `ssh_config`. If you have not explicitly connected to that host, you should get a `Connection refused` error.

*Not connected via `sdm`*

```bash
$ sdm status
     SSH SERVER                   STATUS            PORT      TYPE
     chefnode1                    not connected     61927     ssh
$ knife ssh 'name:node1-ubuntu' 'echo hello'
WARNING: Failed to connect to ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com -- Errno::ECONNREFUSED: Connection refused - connect(2) for [::1]:61927
```

*Connected via `sdm`*

```bash
$ sdm connect chefnode1
connect successful
$ sdm status
     SSH SERVER                   STATUS            PORT      TYPE
     chefnode1                    connected         61927     ssh
$ knife ssh 'name:node1-ubuntu' 'echo hello'
ec2-xx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com hello
```


# Automate Temporary Access with PagerDuty Schedules

{% hint style="warning" %}
This is a guide for manually setting up a script to integrate an on-call schedule in PagerDuty with StrongDM. However, a first-party integration with PagerDuty is now available and is the recommended option for most use cases.\
\
See the [PagerDuty Integration](/admin/deployment/integrations/pagerduty) section for details.
{% endhint %}

If you use PagerDuty, then you already have on-call schedules mapped out for critical roles. But when someone is on-call, they may need more resource access than they would at other times. This is where StrongDM temporary grants come in. You can integrate your PagerDuty on-call schedule with StrongDM to automatically grant StrongDM users access to additional resources during their on-call shifts. This Python example shows a simple way of managing the process.

### Requirements

To get this script working in your environment, you'll need the following:

* A StrongDM [API key](/references/api/api-keys) with **Resources** > **List**, **Grants** > **Read**, and **Grants** > **Write** permissions.
* A StrongDM resource name
* A [PagerDuty API token](https://developer.pagerduty.com/docs/authentication) with read-only rights
* The schedule ID of a PagerDuty schedule you wish to use as the basis of the temporary grants (If your schedule is `https://example.pagerduty.com/schedules/A123BCD` the last portion of the path, `A123BCD` , is the ID.

### Setup

{% hint style="info" %}
In order for this automation to work, your users will need to be identified by the same email addresses in PagerDuty and in StrongDM.
{% endhint %}

The script has two major portions:

1. First, look up who is on call for a specific schedule over a certain time period
2. Second, parse these assignments with the StrongDM SDK to grant temporary access to a datasource or server.

Two API calls are necessary to PagerDuty:

1. Get the list of who is on call will give a list of users and user IDs, but not email addresses.
2. Conduct specific user lookups to get us the email addresses of the person(s) who are on call.

To set up your PagerDuty automation, add this script to your crontab to run on a regular schedule. Modify the `UNTIL` calculation to match the interval you are running it at. For instance, if you're running it weekly, that line would look like this:

```python
UNTIL = (datetime.timedelta(days=7) + datetime.datetime.utcnow()).isoformat() + 'Z'
```

#### The Python Script

```python
#!/usr/bin/env python

import requests,json,datetime,subprocess,strongdm,re
from datetime import timezone

# PagerDuty API key
API_KEY = 'PD_API_KEY'

# StrongDM API keys: requires datasource list,grant and user list,assign
access_key = "SDM_ACCESS_KEY"
secret_key = "SDM_SECREY_KEY"

# name of StrongDM Datasource to which you are granting access
DATASOURCE = 'DATASOURCE_NAME'

# Set your time zone
TIME_ZONE = 'UTC'
# Get this ID from the PagerDuty admin UI, or via their 'schedules' API endpoint
SCHEDULE_IDS = ['PD_SCHEDULE_ID']
# for the PD API requests. Modify UNTIL with the proper time offset
UNTIL = (datetime.timedelta(days=1) + datetime.datetime.utcnow()).isoformat() + 'Z'

def get_oncalls():
  url = 'https://api.pagerduty.com/oncalls'
  headers = {
    'Accept': 'application/vnd.pagerduty+json;version=2',
    'Authorization': 'Token token={token}'.format(token=API_KEY)
  }
  payload = {
    'time_zone': TIME_ZONE,
    'schedule_ids[]': SCHEDULE_IDS,
    'until': UNTIL,
  }
  
  r = requests.get(url, headers=headers, params=payload)
  struct = r.json()
  output = []

  for record in struct["oncalls"]:
  # get user's email address
    r = requests.get(record["user"]["self"], headers=headers)
    output.append({"email" : r.json()["user"]["email"],
            "from" : record["start"],
            "to" : record["end"]})
  return output

def grant_access(access_list):

  client = strongdm.Client(access_key, secret_key)

  # Get Datasource(s)
  resources = list(client.resources.list('name:"{}"'.format(DATASOURCE)))
  resourceID = resources[0].id

  # Cycle through the output from PagerDuty
  for item in access_list:
    # Use the email address to get the user.id from SDM
    print('Current PD user is: ' + item["email"])
    users = list(client.accounts.list('email:{}'.format(item["email"])))
    if len(users) > 0:
      print('SDM user found!')
      myUserID = users[0].id
      # Convert the date strings from PD into a datetime object
      s = datetime.datetime.strptime(item["from"], '%Y-%m-%dT%H:%M:%SZ')
      e = datetime.datetime.strptime(item["to"], '%Y-%m-%dT%H:%M:%SZ')
      # Make both objects 'aware' (with TZ) as required by the StrongDM SDK
      start = s.replace(tzinfo=timezone.utc)
      end = e.replace(tzinfo=timezone.utc)
      # Create the grant object
      myGrant = strongdm.AccountGrant(resource_id='{}'.format(resourceID),account_id='{}'.format(myUserID), 
        start_from=start, valid_until=end)
      # Perform the grant
      try:
        respGrant = client.account_grants.create(myGrant)
      except Exception as ex:
        print("\nSkipping user " + item["email"] + " on account of error: " + str(ex))
      else:
        print("\nGrant succeeded for user " + item["email"] + " to resource " + DATASOURCE + " from {} to {}".format(start,end))
    print('---\n')

def main():
  access = get_oncalls()
  grant_access(access)

main()
```


# Environment Variables

The StrongDM command line recognizes environment variables to control and modify its functionality. This document details the available environment variables and their function.

Environment variables can be set on a StrongDM systemd service by adding to the environment file:

* For service accounts, it is usually located at `/etc/sysconfig/sdm`.
* For gateways and relays, it is usually located at `/etc/sysconfig/sdm-proxy`.
* For bridge and proxy workers, it is usually located at `/etc/sysconfig/sdm-worker`.

| Name                 | Format                                                                | Function                                                                                                                                                                                                            |
| -------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| HTTP\_PROXY          | `111.222.333.444:5555`                                                | (Or http\_proxy) The HTTP proxy URL to user in corporate environments where all outbound traffic must pass through a corporate proxy; respected for client traffic to the StrongDM control plane or proxy clusters  |
| HTTPS\_PROXY         | `111.222.333.444:5555`                                                | (Or https\_proxy) The HTTPS proxy URL to user in corporate environments where all outbound traffic must pass through a corporate proxy; respected for client traffic to the StrongDM control plane or proxy cluster |
| NO\_PROXY            | `111.222.333.444:5555,111.222.344:5555`                               | (Or no\_proxy) A comma-separated list of URLs that should not use a corporate proxy when being accessed                                                                                                             |
| SDM\_ADMIN\_TOKEN    | `<JWT_TOKEN>`                                                         | An admin token or service account token to use for `sdm` authentication; if set, this token is used by StrongDM and there is no need to log in via the CLI or desktop app                                           |
| SDM\_APP\_DOMAIN     | `app.strongdm.com`                                                    | Address of the control plane.                                                                                                                                                                                       |
| SDM\_APP\_PORT       | `:1234`                                                               | Specified port for custom proxy, including the colon; defaults to `:443` if not set explicitly                                                                                                                      |
| SDM\_EMAIL           | `SDM_EMAIL=email-address-value@example.com`                           | If set, the specified email address is used automatically when using the `sdm login` command in the CLI                                                                                                             |
| SDM\_FALLBACK\_DNS   | `<DNS_ADDRESS>:<PORT>`                                                | DNS address to use as a fallback if a call to `app.strongdm.com` fails; defaults to `1.1.1.1:53` and can be set to `0` to disable fallback                                                                          |
| SDM\_HOME            | `/path/to/home`                                                       | The location where `sdm` places its logs and keys; defaults to `~/.sdm`; must be writable by the user running `sdm`                                                                                                 |
| SDM\_HTTP\_PROXY     | `http://example.example.com:8080`                                     | The HTTP proxy URL to use in corporate environments where specifically StrongDM outbound traffic must pass through a corporate proxy; respected for client traffic to the StrongDM control plane or proxy clusters  |
| SDM\_HTTPS\_PROXY    | `https://example.example.com:8080`                                    | The HTTPS proxy URL to use in corporate environments where specifically StrongDM traffic must pass through a corporate proxy; respected for client traffic to the StrongDM control plane or proxy clusters          |
| SDM\_VERBOSE         | `true`\|`false`                                                       | If set, log verbosity is set to high for troubleshooting purposes                                                                                                                                                   |
| SDM\_DISABLE\_UPDATE | `true`\|`false`                                                       | If set to `true`, disables auto-updates.                                                                                                                                                                            |
| SDM\_DOCKERIZED      | <p><code>true</code><br><code>false</code><br><code>stderr</code></p> | If `true`, logs go to `STDOUT` rather than `sdm.log` for Docker or Kubernetes deployments or for troubleshooting purposes; if `stderr`, logs go to `STDERR`                                                         |
|                      |                                                                       |                                                                                                                                                                                                                     |

### Variables Only for Gateways, Relays, and Proxy Clusters

The following variables are only for use with gateways, relays, proxy workers, and bridge workers.

| Name                            | Format                                                                                                                                                                       | Function                                                                                                                                                                                                            |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AZURE\_SUBSCRIPTION\_ID         | `2e498348-6938-5da8-91a3-5e22f480e7de`                                                                                                                                       | Your node's Azure Subscription ID (See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id) for more details), used for connecting the node to your cloud |
| AZURE\_TENANT\_ID               | `2e498348-6938-5da8-91a3-5e22f480e7de`                                                                                                                                       | Your node's Tenant ID (See the [Microsoft documentation](https://learn.microsoft.com/en-us/azure/azure-portal/get-subscription-tenant-id) for more details), used for connecting the node to your cloud             |
| SDM\_HOSTNAME\_CURL\_ADDRESS    | URI                                                                                                                                                                          | If set within the StrongDM Gateway AMI in the userdata field at instance launch, the gateway reaches out to the specified address to determine its public hostname instead of the default AWS address               |
| SDM\_MAINTENANCE\_WINDOW\_START | `integer`                                                                                                                                                                    | If set, schedules the hour of the day (0 to 23 UTC) when gateways and relays can terminate connections and restart (default: 7)                                                                                     |
| SDM\_METRICS\_LISTEN\_ADDRESS   | `:port`                                                                                                                                                                      | If set in the gateway or relay's environment on port 9999, enables the gateway or relay to listen for metrics on the specified port                                                                                 |
| SDM\_ORCHESTRATOR\_PROBES       | `:port`                                                                                                                                                                      | If set, enables the `http://<GATEWAY OR RELAY IP>:port/liveness` URL to check whether the gateway or relay is in good health                                                                                        |
| SDM\_RELAY\_LOG\_ENCRYPTION     | <p><code>plaintext</code><br><code>pubkey:///pubkeyfullpath/file.pem</code></p>                                                                                              | Overrides relay log encryption settings configured in the Admin UI                                                                                                                                                  |
| SDM\_RELAY\_LOG\_FORMAT         | <p><code>csv</code><br><code>json</code></p>                                                                                                                                 | Overrides relay log format settings configured in the Admin UI                                                                                                                                                      |
| SDM\_RELAY\_LOG\_STORAGE        | <p><code>stdout</code><br><code>file</code><br><code>none</code><br><code>tcp\://host:port</code><br><code>socket:///fullpath/</code><br><code>syslog://host:port</code></p> | Overrides relay log storage settings configured in the Admin UI                                                                                                                                                     |
|                                 |                                                                                                                                                                              |                                                                                                                                                                                                                     |

### Variables Only for Gateways and Relays

| Name              | Format        | Function                                                                                                                                    |
| ----------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| SDM\_RELAY\_TOKEN | `<JWT_TOKEN>` | A gateway or relay token to use when invoking the `sdm` binary; normally not needed as this is entered when installing the gateway or relay |

### Variables Only for Proxy Clusters

| Name                             | Format                        | Function                                                                                                                                                 |
| -------------------------------- | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SDM\_PROXY\_CLUSTER\_ACCESS\_KEY | `pk-xxxxx`                    | ID of the proxy cluster key used to authenticate to the control plane                                                                                    |
| SDM\_PROXY\_CLUSTER\_SECRET\_KEY | `(base64)`                    | Secret portion of the proxy cluster key used to authenticate to the control plane                                                                        |
| SDM\_BRIDGE                      | `local` or `example.com:port` | When set to `local`, instructs the worker to run as a bridge worker; when set to an address, instructs the worker to connect to a bridge at that address |


# Integrations

StrongDM integrates with a variety of service providers. Documentation is provided about each integration. Select one of the following links to learn how to configure that integrated service.

StrongDM has a variety of integrations with each of these clouds, including for cloud management, specific resource types, secrets management tools, and user SSO and provisioning.

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Amazon Web Services (AWS)</td><td><a href="/files/v4mrUCXHHMMPWyoaauYL">/files/v4mrUCXHHMMPWyoaauYL</a></td><td><a href="/pages/UUPIKAfYVmUBeMET9SCN">/pages/UUPIKAfYVmUBeMET9SCN</a></td></tr><tr><td>Google Cloud Provider (GCP)</td><td><a href="/files/N3dwdTfx6yrCCxGcyEYE">/files/N3dwdTfx6yrCCxGcyEYE</a></td><td><a href="/pages/DsHGXx583UBuXcKuwaJ5">/pages/DsHGXx583UBuXcKuwaJ5</a></td></tr><tr><td>Microsoft Azure + Entra ID</td><td><a href="/files/TLZbV5KLI2sraWMBUBYX">/files/TLZbV5KLI2sraWMBUBYX</a></td><td><a href="/pages/RT5cL7YdLQOFlgcFOfbO">/pages/RT5cL7YdLQOFlgcFOfbO</a></td></tr><tr><td>Okta</td><td><a href="/files/qful5wdtC78gHxgfRxWZ">/files/qful5wdtC78gHxgfRxWZ</a></td><td></td></tr></tbody></table>

### Certificate Authorities

* [Active Directory Certificate Services (RDP)](/admin/access/certificate-authorities/adcs-ca)
* [AWS (RDP)](/admin/access/certificate-authorities/aws-ca-rdp)
* [GCP (RDP)](/admin/access/certificate-authorities/gcp-ca)
* [Hashicorp Vault (RDP)](/admin/access/certificate-authorities/vault-ca-rdp)
* [Hashicorp Vault (SSH)](/admin/access/certificate-authorities/vault-ca-ssh)
* [Keyfactor EJBCA (RDP)](/admin/access/certificate-authorities/ejbca-ca-rdp)
* [Keyfactor EJBCA (SSH)](/admin/access/certificate-authorities/ejbca-ca-ssh)

### Logging

* [CloudWatch](/admin/audit/logs/scenarios/export-to-cloudwatch)
* [Filebeat](/admin/audit/logs/scenarios/export-to-filebeat)
* [Graylog](/admin/audit/logs/scenarios/export-to-graylog)
* [Rsyslog](/admin/audit/logs/scenarios/export-via-rsyslog)
* [S3](/admin/audit/logs/scenarios/export-to-s3)
* [S3 (Log Stream)](/admin/audit/logs/log-stream)
* [Splunk](/admin/audit/logs/scenarios/export-to-splunk)

### Secret Stores

* [AWS Secrets Manager](/admin/access/secret-stores/aws-secrets-manager)
* [Azure Key Vault](/admin/access/secret-stores/azure-key-vault)
* [CyberArk Conjur](/admin/access/secret-stores/cyberark-conjur)
* [CyberArk PAM](/admin/access/secret-stores/cyberark-pam)
* [Delinea Secret Server Vault](/admin/access/secret-stores/delinea-secret-server)
* [GCP Secret Manager](/admin/access/secret-stores/gcp-secret-manager)
* [HashiCorp Vault](/admin/access/secret-stores/hashicorp-vault)

### Security

* [CrowdStrike](/admin/access/policies/device-trust)
* [Duo](/admin/principals/mfa/mfa-duo)
* [Microsoft Defender](/admin/access/policies/device-trust)
* [Okta Verify](/admin/principals/mfa/mfa-okta)
* [SentinelOne](/admin/access/policies/device-trust)
* [TOTP](/admin/principals/mfa/mfa-totp)

### SSO

* [ADFS](/admin/principals/sso/adfs-oidc)
* [Auth0](/admin/principals/sso/auth0-oidc)
* [Entra ID (formerly Azure AD)](/admin/principals/sso/entra-oidc)
* [Google](/admin/principals/sso/google-oidc)
* [Jumpcloud](/admin/principals/provisioning/jumpcloud-provisioning)
* [Keycloak](/admin/principals/sso/keycloak-oidc)
* [Okta (OIDC)](/admin/principals/sso/okta-oidc)
* [Okta (SAML)](/admin/principals/sso/okta-saml)
* [OneLogin (OIDC)](/admin/principals/sso/onelogin-oidc)
* [OneLogin (SAML)](/admin/principals/sso/onelogin-saml)
* [Ping Identity (OIDC)](/admin/principals/sso/ping-identity-oidc)
* [Ping Identity (SAML)](/admin/principals/sso/ping-identity-saml)
* [Rippling](/admin/principals/sso/rippling-saml)
* [VMware Workspace ONE](/admin/principals/sso/vmware-oidc)

{% hint style="info" %}
To learn how to integrate any OpenID Connect (OIDC)-compliant SSO service, please see the [General SSO Guide](/admin/principals/sso).

To set up SSO using SAML with an identity provider that is not explicitly listed, see [SSO With SAML](/admin/principals/sso/saml).
{% endhint %}

### User Provisioning

* [Entra ID (formerly Azure AD)](/admin/principals/provisioning/entra-provisioning)
* [Google](/admin/principals/provisioning/google-provisioning)
* [Okta](/admin/principals/provisioning/okta-provisioning)
* [OneLogin](/admin/principals/provisioning/onelogin-provisioning)

{% hint style="info" %}
Use [StrongDM SCIM API Specification](/references/scim) when leveraging the StrongDM SCIM API to connect to an identity provider that is not explicitly listed.
{% endhint %}

### Workflows

* [Jira](/admin/access/approval-workflows/jira-workflows)
* [Microsoft Teams](/admin/access/access-workflows/teams-workflows)
* [ServiceNow](/admin/access/approval-workflows/servicenow-workflows)
* [Slack](/admin/access/access-workflows/slack-workflows)

### Incident Response

* [Incident.io](/admin/deployment/integrations/incidentio)
* [PagerDuty](/admin/deployment/integrations/pagerduty)


# AWS

The Amazon Web Services (AWS) cloud can be used to host StrongDM nodes and manage secrets. StrongDM can govern access to AWS CLI and many AWS resource types.

### Secrets Management

StrongDM integrates with the AWS Secrets Manager to allow your nodes to proxy access to resources using secrets that are added and maintained in your cloud-native secrets manager.

{% content-ref url="/pages/5jr3alldYkQSVkuISSsj" %}
[AWS Secrets Manager](/admin/access/secret-stores/aws-secrets-manager)
{% endcontent-ref %}

### Node Management

When configuring gateways or relays to proxy client traffic to resources, the EC2 Nodes guide can be of use for setup.

{% content-ref url="/pages/v774LhiTuRh13hmMf000" %}
[EC2 Nodes](/admin/networking/gateways-and-relays/ec2-nodes)
{% endcontent-ref %}

### Resources

Additionally, StrongDM offers proxied access to cloud resources using the following resource types.

#### Cloud Resources

* **AWS (Instance Profile)** - Proxy access to manage your Amazon Cloud via the aws command line tool, using EC2 instances for your nodes and Instance Profile access to authenticate the nodes to the cloud. See the [AWS (Instance Profile) guide](/admin/resources/clouds/aws-instance-profile) for more details.
* **AWS Cloud** - Proxy access to manage your Amazon cloud via the aws command line tool, using Secret Access Keys to authenticate your nodes to the cloud. See the [AWS Cloud guide](/admin/resources/clouds/aws) for more details.
* **AWS Management Console** - Proxy access to manage your Amazon Cloud for service accounts via the aws command line tool, using environment-loaded credentials on your nodes or Secret Access Keys to authenticate your nodes to the cloud. See the [AWS Management Console guide](/admin/resources/clouds/aws-console) for more details.

#### Cluster Resources

When setting up Kubernetes, it's advisable to use a Helm chart and the Kubernetes (Pod Identity) resource type. If you're manually setting up a Kubernetes resource in the cloud, you can also use the AWS-specific EKS and EKS (Instance Profile) resource types. See the following for more information:

* [Deploy Kubernetes via Helm chart](https://github.com/strongdm/charts/blob/main/deployments/sdm-relay/README.md)
* [Kubernetes (Pod Identity) resource guide](/admin/resources/clusters/kubernetes-podidentity)
* [EKS resource guide](/admin/resources/clusters/eks)
* [EKS (Instance Profile) resource guide](/admin/resources/clusters/eks-instance-profile)

#### Server Resources

Any of StrongDM's SSH resource types (listed on the [Servers](/admin/resources/servers) page) can be used to set up AWS server instances as resources in StrongDM.

#### Datasource Resources

Several of StrongDM's datasource resource types can be used to set up resources within AWS, but there are also several bespoke AWS resource types. See the guides for any of those resource types for more details:

* [Amazon Elasticsearch (IAM)](/admin/resources/datasources/amazon-es-iam)
* [Amazon Elasticsearch](/admin/resources/datasources/amazon-es)
* [Amazon Neptune](/admin/resources/datasources/amazon-neptune)
* [Amazon MQ AMQP](/admin/resources/datasources/amazon-mq-amqp)
* [Amazon MQ (AMQP 0.9.1)](/admin/resources/datasources/amazon-mq)

### User Management

StrongDM provides a generic SAML integration and the StrongDM SCIM API specification that can be used to integrate with the AWS Identity Center.

{% content-ref url="/pages/C1GtF1cjIprccZHL29Fw" %}
[SSO With SAML](/admin/principals/sso/saml)
{% endcontent-ref %}

{% content-ref url="/spaces/4XOJmXFslCMVCzIG2rKp/pages/taSBT9Zw8dcwKPTbA6gb" %}
[StrongDM SCIM API Specification](/references/scim)
{% endcontent-ref %}


# GCP

The Google Cloud Platform (GCP) can host StrongDM nodes, manage secrets, and manage users. StrongDM can govern access to gcloud and many GCP resource types.

### Secrets Management

StrongDM integrates with the GCP Secret Manager to allow your nodes to proxy access to resources using secrets that are added and maintained in your cloud-native secrets manager.

{% content-ref url="/pages/VdiClAwyQVgmLxLIUQYS" %}
[GCP Secret Manager](/admin/access/secret-stores/gcp-secret-manager)
{% endcontent-ref %}

### Node Management

When configuring gateways or relays to proxy client traffic to resources, the GCP Nodes guide can be of use for setup.

{% content-ref url="/pages/FzqqhaWGsVcb89rI6sds" %}
[GCP Nodes](/admin/networking/gateways-and-relays/gcp-nodes)
{% endcontent-ref %}

### User Management

StrongDM provides an integration for SSO authentication with Google as well as user provisioning with Google.

{% content-ref url="/pages/akSxHlp9NAKBsx1IAskc" %}
[SSO With Google](/admin/principals/sso/google-oidc)
{% endcontent-ref %}

{% content-ref url="/pages/KWBqlSwiRqO76D8pnlI5" %}
[Provisioning With Google Cloud](/admin/principals/provisioning/google-provisioning)
{% endcontent-ref %}

### Resources

Additionally, StrongDM offers proxied access to cloud resources using the following resource types.

#### Cloud Resources

* **GCP (Workforce Identity Federation)** - Proxy access to manage your Google Cloud via the CLI or through the web console using Workforce Identity Federation to authenticate. See the [GCP (Workforce Identity Federation) guide](/admin/resources/clouds/gcp-wif) for more details.
* GCP CLI/SDK (Service Account) - Proxy access to your Google Cloud for service accounts via the CLI or SDKs. See the [GCP CLI/SDK (Service Account) guide](/admin/resources/clouds/gcp) for more details.

#### Cluster Resources

When setting up Kubernetes, it's advisable to use a Helm chart and the Kubernetes (Pod Identity) resource type. If you're manually setting up a Kubernetes resource in the cloud, you can also use the Google-specific GKE resource type.

* [Deploy Kubernetes via the Helm chart](https://github.com/strongdm/charts/blob/main/deployments/sdm-relay/README.md)
* [Kubernetes (Pod Identity) resource guide](/admin/resources/clusters/kubernetes-podidentity)
* [GKE resource guide](/admin/resources/clusters/gke)

#### Server Resources

Any of StrongDM's SSH resource types (listed on the [Servers](/admin/resources/servers) page) can be used to set up AWS server instances as resources in StrongDM.

#### Datasource Resources

A variety of StrongDM's datasource resource types can be used to support Cloud SQL and other GCP resource types, depending on the database protocol used (see the Datasources list to review the available resource types), and there is also a bespoke BigQuery resource type.

* [Datasource guides](/admin/resources/datasources)
* [BigQuery](/admin/resources/datasources/bigquery)


# Microsoft

Azure can host StrongDM nodes and manage secrets. Users can be managed via Entra ID. StrongDM can govern access to Azure and to many Microsoft resource types.

### Secrets Management

StrongDM integrates with the Azure Key Vault to allow your nodes to proxy access to resources using secrets that are added and maintained in your cloud-native secrets manager.

{% content-ref url="/pages/JKdehtuOhm2FA2sGGP4Z" %}
[Azure Key Vault](/admin/access/secret-stores/azure-key-vault)
{% endcontent-ref %}

### Node Management

When configuring gateways or relays to proxy client traffic to resources, the Azure VM Nodes guide can be of use for setup.

{% content-ref url="/pages/tuEPiDGKs1TWfTSX5Og3" %}
[Azure VM Nodes](/admin/networking/gateways-and-relays/azure-vm-nodes)
{% endcontent-ref %}

### User Management

StrongDM provides an integration for SSO authentication with Entra ID as well as SCIM user provisioning with Entra ID.

{% content-ref url="/pages/8RmGtKC437c4uqq5hZzp" %}
[SSO With Microsoft Entra ID](/admin/principals/sso/entra-oidc)
{% endcontent-ref %}

{% content-ref url="/pages/SdEZR5fO7swT5G5GaQkR" %}
[Provisioning With Microsoft Entra ID](/admin/principals/provisioning/entra-provisioning)
{% endcontent-ref %}

### Resources

Additionally, StrongDM offers proxied access to cloud resources using the following resource types.

#### Cloud Resources

* Azure Cloud - Proxy access to manage your Azure cloud via the Azure CLI. See the [Azure Cloud guide](/admin/resources/clouds/azure) for more details.

#### Cluster Resources

When setting up Kubernetes, it's advisable to use a Helm chart and the Kubernetes (Pod Identity) resource type. If you're manually setting up a Kubernetes resource in the cloud, you can also use the Azure-specific AKS resource type.

* [Deploy Kubernetes via Helm chart](https://github.com/strongdm/charts/blob/main/deployments/sdm-relay/README.md)
* [Kubernetes (Pod Identity) resource guide](/admin/resources/clusters/kubernetes-podidentity)
* [AKS resource guide](/admin/resources/clusters/aks)

#### Server Resources

Any of StrongDM's SSH resource types (listed on the [Servers](/admin/resources/servers) page) can be used to set up AWS server instances as resources in StrongDM.

#### Datasource Resources

Several of StrongDM's datasource resource types can be used to set up resources within Azure, but there are also several bespoke Microsoft resource types:

* [Microsoft SQL Server](/admin/resources/datasources/microsoft-sql-server)
* [Microsoft SQL Server (Kerberos)](/admin/resources/datasources/microsoft-sql-server-kerberos)
* [Microsoft SQL Server (Azure AD)](/admin/resources/datasources/microsoft-sql-server-azure-ad)
* [Azure PostgreSQL](/admin/resources/datasources/azure-postgresql)
* [Azure Database for MySQL](/admin/resources/datasources/azure-mysql)


# Microsoft Copilot Studio Connector

Connect Microsoft Copilot Studio agents to StrongDM-managed resources so that end users can interact with resources through Copilot, using their existing StrongDM identities and entitlements.

{% hint style="warning" %}
This feature is currently in a closed-access tech preview. Functionality and documentation may change. Contact StrongDM for more information.
{% endhint %}

## Overview

The Microsoft Copilot Studio connector allows your Copilot agents to securely interact with StrongDM-managed resources. End users can list their entitled resources and run commands against SSH servers and SQL databases directly from a Copilot agent, without embedding credentials or changing your existing StrongDM infrastructure.

When a user interacts with a Copilot agent that has the StrongDM connector, StrongDM authenticates the user via OAuth and enforces access based on their existing StrongDM entitlements. All commands run through StrongDM's control plane and are authorized and logged just like any other StrongDM-mediated access.

No database credentials, SSH keys, or secrets are exposed to Copilot at any point. Credential injection and command execution happen exclusively on your organization's StrongDM-managed nodes.

## How It Works

The integration connects Microsoft Copilot Studio to StrongDM through the following flow:

1. A StrongDM administrator creates a Microsoft Copilot Studio connection in the StrongDM Admin UI and receives OAuth credentials and several URLs.
2. A Copilot developer creates a custom connector in Microsoft Copilot Studio and then adds the connector to their agent, using the StrongDM credentials and URLs.
3. When an end user invokes a StrongDM tool through the Copilot agent, the user is redirected through an OAuth flow with StrongDM (if not already authenticated). StrongDM issues a short-lived access token scoped to that user.
4. Copilot resource interactions on the user's behalf flow through StrongDM's control plane and the organization's StrongDM nodes, which route the traffic as they would normal user actions.

## Prerequisites

### StrongDM requirements

To set up the Microsoft Copilot Studio connector, you need the following in StrongDM:

* Your organization must have the Microsoft Copilot Studio connector feature enabled. Contact StrongDM support to inquire about access to the tech preview.
* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with access to the target resources
* The resources you want to expose through Copilot must be configured in StrongDM.
* Your organization must be on the US StrongDM control plane.

### Microsoft requirements

On the Microsoft side, you need the following:

* Microsoft Copilot Studio environment with permissions to create or edit agents
* Ability to add custom connectors to a Copilot Studio agent

For detailed information about working with connectors in Microsoft Copilot Studio, see [Microsoft's Copilot Studio documentation](https://learn.microsoft.com/en-us/microsoft-copilot-studio/).

## Policies

If your organization has the Policy feature enabled, commands issued through the Copilot connector are authorized against your configured policies and logged in the policy logs, in the same way as other StrongDM-mediated access, including PBAC for PostgreSQL resources. Policy log entries also indicate when the access was initiated through Copilot.

Be aware of the following limitations with respect to policy and Copilot:

* **Justification and TOTP MFA policies are not supported.** Policies that require a justification or TOTP MFA through the StrongDM Desktop application will deny access when triggered via Copilot.
* **Device trust** status will always be unknown or exempt, depending on whether the user is configured to be exempt from device trust.
* **Geolocation and source IP address** are based on the IP address the user initially authenticated with, and they do not reflect the user's current location if it changes after initial authentication.

## Limitations

Be aware of the following limitations during the Tech Preview:

* **US control plane only:** The Microsoft Copilot Studio connector is available only for organizations on the US StrongDM control plane that have been given access to the tech preview feature.
* **Rate limiting:** The connector is rate-limited to prevent excessive requests.
* **Supported resource types:** Only SSH servers and SQL databases (PostgreSQL, MySQL, and Microsoft SQL Server) are supported. Other resource types are not available through the connector.
* **No agent-specific entitlements:** Access is enforced based on the end user's StrongDM entitlements only. Composite identity authorization (combining agent identity and user identity) is not supported in this release.
* **Microsoft Copilot Studio only:** The connector works with Microsoft Copilot Studio agents. Other agentic platforms are not supported through this integration.
* **Request and response size and time limits:** Requests and responses are limited to 512 KiB, and command execution is limited to 25 seconds. If these limits are exceeded (for example, from a SQL query that returns a large result set) an error will be returned and displayed by the agent. To avoid hitting these limits, adjust your prompts to request data in smaller batches or with row limits applied.
* **SSH resource locking:** For SSH resources that require a resource lock, access is denied unless the end user has already locked the resource outside of Copilot (via the StrongDM Desktop application or CLI). To access such a resource through a Copilot agent, the user must acquire the lock externally before their session and release it when finished (or rely on lock expiration if enabled).

### Supported Resources

During the Tech Preview, the connector supports the following StrongDM resource types:

* **SSH servers:** Run shell commands against SSH resources to which the user has access.
* **SQL databases:** Run SQL queries against supported database resources to which the user has access. Supported databases include PostgreSQL, MySQL, and Microsoft SQL Server.

End users can also list the resources to which they are entitled in StrongDM, including the health status of those resources. Note that this listing includes all resource types to which the user is entitled, not only SSH and SQL resources.

## Set Up the StrongDM Integration

Follow these steps to set up the Microsoft Copilot Studio integration in StrongDM.

1. Log in to the StrongDM Admin UI.
2. Go to **Integrations** and then under **SaaS Agents**, find **Microsoft Copilot Studio** and click **Connect**.
3. Enter a **Name** for the connection (for example, "Copilot Production" or "Copilot Dev Team") and then click **Connect**.
4. StrongDM generates a **Client ID** and **Client Secret** and shows those as well as an **Authorize URL**, **Token URL**, **Refresh URL**, and **OpenAPI URL**. Leave this tab open to copy these values when configuring the connector in Microsoft Copilot Studio, or store them securely.

{% hint style="warning" %}
Copy the client secret before closing this configuration screen. You will not be able to retrieve it later.
{% endhint %}

## Configure the Connector in Microsoft Copilot Studio

After you have the client ID, client secret, and URLs from StrongDM, add the a custom connector to your Copilot Studio agent. At a high level, the steps are as follows:

1. Open Microsoft Copilot Studio.
2. Go to **Tools**, click **New tool**, choose **Custom connector**, and then choose **Import an OpenAPI from URL** from the **New custom connector** dropdown.
3. On the popup **Import an OpenAPI from URL** view, enter a **Connector name** (such as "StrongDM") and for **Paste in the URL for the Open API**, paste the value from the StrongDM connector setup screen that was called **OpenAPI URL** and then click **Import**.
4. The settings on the **General** tab can be adjusted as needed, such as the connector's icon or description.
5. Open the **Security** tab and ensure the **Authentication type** is set to "OAuth 2.0". Fill in the **Client ID**, **Client secret**, **Authorization URL**, **Token URL**, and **Refresh URL** from the StrongDM connector setup screen. Leave **Scope** empty.
6. The **Definition** tab includes information about the connector that is pulled in from the Open API specification. There should be three **Tools** available in the list on the left-hand side.
7. The **Code** tab can be skipped.
8. The **Test** tab requires the connector to be created to proceed, so click **Create connector**, and wait for the connector to be created and create a connection (which requires authenticating to link to your StrongDM account) and test if desired. If you don't want to create a connection to your StrongDM account and test here, you don't have to. You will just be prompted to do so on first use later.
9. Return to the Microsoft Copilot Studio home page and navigate to **Agents** in the sidebar. Then click **Create blank agent**.
10. In the agent's **Tools** tab, click **Add a new tool**, and then search for the name of the custom connector you just added. The tools available via that connector should appear as results. Select one, and choose **Add and configure**. Repeat for the other tools.
11. Now that your agent has the custom connector's tools configured, chat with the agent and ask it what StrongDM resources are available to it. Note that the agent will typically prompt you with "Let's get you connected first" and ask you to open the Connection Manager to authorize before proceeding (see [End User Authentication](#end-user-authentication)). Once connected, you can watch the agent use the List Available Resources tool and respond. You may also test an interaction with a resource at this stage (for example, try asking "How many users are in the development database?" or "What OS version is the build server running?").

For detailed steps on how to add and configure connectors in Copilot Studio, see [Microsoft's documentation on custom connectors](https://learn.microsoft.com/en-us/connectors/custom-connectors) .

### **Optional: Enable Database Targeting for Execute SQL Command**

The Execute SQL Command tool supports an optional parameter that allows the agent to target a specific database on a StrongDM resource that provides access to multiple databases on the same server. Optional parameters are disabled by default in Copilot Studio, so this requires additional configuration.

To enable this behavior, follow these steps.

1. Open the configuration for the Execute SQL Command tool.
2. Click the ellipsis (…) menu at the top of the page and select **Open code view**.
3. On the second line, immediately after the `kind: TaskDialog` line, add the following block:<br>

   ```yml
   inputs:
     - kind: AutomaticTaskInput
       propertyName: database
       shouldPromptUser: false
       inputSettings:
         defaultValue: =Blank()
   ```
4. Click **Save**. The agent is now able to pass an optional database name when executing SQL commands.

{% hint style="info" %}
Alternatively, instead of using the code view, you can use the graphical tool input editor to add a `database` input field, configure it not to re-prompt the user, and set it to an empty value (no value) if not found.
{% endhint %}

## End User Authentication

When an end user first interacts with a StrongDM tool through a Copilot agent, the agent prompts them to connect to the StrongDM control plane.

After clicking the **Connection Manager** link, they are taken to a page where they can select or create a connection for the custom connector created previously.

Clicking **Sign in** takes the user to the StrongDM OAuth endpoint. If they are not already authenticated, they are prompted to log in to their StrongDM account and are then prompted to connect.

Clicking **Connect** associates this specific agent instance with the displayed StrongDM user account. The user can then return to the agent and click **Retry** to continue.

This connection flow grants the agent a token that can be used to issue requests for up to three days, as long as the associated authentication remains valid. If the user explicitly logs out of StrongDM or the organization's session timeout is reached, the token is no longer valid.

If a user needs to change or delete the connection, they can do so in the **Connections** section of the Microsoft Power Apps page.

{% hint style="info" %}
Access is enforced strictly based on the user's existing StrongDM entitlements. If a user does not have access to a resource in StrongDM, they cannot access it through Copilot. Although resources that the user is able to request access to (but does not currently have) are not visible through Copilot, the user can request access to such resources through the StrongDM UI. Once access is approved, those resources will become accessible through Copilot.
{% endhint %}

## Auditing and Logging

All commands executed through the Copilot connector are logged in StrongDM's existing audit surfaces, just as any other user interaction with a resource would be. When viewed in the StrongDM Admin UI, log entries created through the Copilot integration also indicate the integration associated with the entry.

{% hint style="info" %}
The CLI, SDKs, and Log Stream interfaces do not currently include Copilot integration activity. Copilot-related access is visible in the Admin UI activity logs only. This is intentional during the tech preview.

Additionally, a "User authorized integration" activity is logged to the activity logs whenever an end user authorizes a Microsoft Copilot Studio agent.
{% endhint %}

## Troubleshooting

### User cannot authenticate through the Copilot agent

Verify that the user has an active StrongDM account and is able to log in to StrongDM directly. The OAuth flow requires a valid StrongDM user identity.

Also verify that the integration settings in StrongDM match those in the custom connector, particularly the Client ID.

### User cannot see or access a resource

Confirm that the user is entitled to the resource in StrongDM. Go to **Access** > **Roles** in the Admin UI and verify that the resource is attached to a role the user is a member of. The connector enforces the same entitlements as any other StrongDM access method.

If the user is unable to access a specific database on a resource (rather than the default database), verify that the optional database parameter is enabled as described in [Optional: Enable Database Targeting](#optional-enable-database-targeting-for-execute-sql-command). Also check that the resource configuration in StrongDM does not have **Restrict Database** (for PostgreSQL resources) or **Override Default Database** (for Microsoft SQL Server) set in a way that conflicts.

### Commands fail or time out

* Check that the StrongDM node (gateway, relay, or proxy cluster) that has access to the target resource is online and healthy. You can verify node status in the Admin UI under **Networking**.
* In Tech Preview, check to verify that the command Copilot ran is using the StrongDM resource ID rather than the resource name. Sometimes during testing, Copilot mistakenly used the resource name. This is a known issue that will be corrected for in the future.
* For SSH resources, check whether the resource requires a lock and verify that the user account associated with the agent is currently holding that lock.
* Ensure that the request will not generate a response exceeding 512 KiB or require more than 25 seconds to execute. Try requesting data in smaller batches.
* Ensure that the request and response do not contain non-UTF-8 characters.
* If a request fails with a `429` error mentioning resource exhaustion, this likely indicates that too many Copilot agents in the organization are concurrently executing commands against StrongDM.

### Commands that were working have started failing

Check that the user is still authenticated to StrongDM and still has access to the desired resource. The SDM authentication token may have expired independently of Copilot (for example, due to a session timeout or explicit logout). Try disconnecting and reconnecting to StrongDM in the agent's Connection Manager to refresh the authentication.

### Error code reference

The following table shows common error codes and their meanings.

| Error                                                                                                                          | Meaning                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400 Command execution failed: invalid operation: commands can only be executed against the default database on this resource` | The optional database parameter is not configured, or the resource does not allow targeting a non-default database.                                                                                           |
| `401 permission denied`                                                                                                        | The user's authentication is invalid (expired, logged out, or the account has been deleted).                                                                                                                  |
| `403 Command execution failed: permission denied`                                                                              | The user is authenticated but no longer has access to the target resource.                                                                                                                                    |
| `429 resource exhausted: Sorry! You've made too many requests…`                                                                | Too many Copilot agents in the organization are executing commands simultaneously.                                                                                                                            |
| `500 failed to execute command: permission denied: access denied`                                                              | The SSH resource requires a lock that the user has not acquired.                                                                                                                                              |
| `500 Deadline exceeded - execution time limit exceeded`                                                                        | The command exceeded the 25-second execution time limit.                                                                                                                                                      |
| `500 Invalid byte sequence for encoding "UTF8"`                                                                                | The command or its response contains non-UTF-8 characters.                                                                                                                                                    |
| `500 Response size exceeds maximum allowed size of 524,288 bytes`                                                              | The response exceeded the 512 KiB size limit. Try requesting data in smaller batches.                                                                                                                         |
| `ConnectorTimeoutError` (The connector has timed out after 240000 seconds)                                                     | Copilot's 30-second timeout was hit before StrongDM responded. Despite the message text, this usually indicates a connectivity issue (for example, no egress node is available to reach the target resource). |

### Still encountering issues?

Contact your StrongDM Tech Preview team. When reaching out, please provide the following information:

* Integration name
* Resource name or resource ID
* Error message and code displayed in the Copilot agent
* StrongDM account of the affected user


# PagerDuty Integration

StrongDM integration with PagerDuty that allows on-call members of PagerDuty schedules to receive access to specified resources within StrongDM while on call.

Many organizations manage incident response software that contains groups of users that are on call at any given time. The PagerDuty integration allows your StrongDM organization to connect directly to PagerDuty using an OAuth app and sync selected on-call schedules. Each time the integration syncs (every 15 minutes, or when triggered manually), it checks which PagerDuty users are on call on the selected schedules, and if it matches those users to StrongDM users, it adds them to a group in StrongDM.

Once those groups exist within StrongDM, admins can then grant them standing access to resources using roles. This would ensure that people who are on call from that schedule always have access to those resources through StrongDM. Admins can also define access workflows to allow those users who are on call to request access to resources for a limited time. Those requests can be configured to be approved either manually by selected approvers or automatically. Either way, the requests are logged and interactions audited.

Access can be made even more granular through the use of [access policies](/admin/access/policies).

## Prerequisites

* Administrator permission level for your StrongDM user in order to create and configure the integration and grant access to the resulting groups.
* A PagerDuty user with appropriate privileges to create and manage OAuth App integrations.

## PagerDuty Setup

1. Log in to PagerDuty as an admin.
2. Go to **Integrations** > **App Registration** > **My Apps** and then select **New App**.
3. Fill in a **Name** and **Description** with values that are useful to your PagerDuty administrators.
4. Select **OAuth 2.0**. In the app configuration screen, choose scoped OAuth if prompted, and then select the scopes you want to grant to the integration. For the StrongDM integration to function effectively, the following scopes are required (adjusting the scopes later may require reauthorizing the app):
   1. `oncalls.read`
   2. `schedules.read`
   3. `users.read`
5. Save the app. After saving, PagerDuty shows you the Client ID and Client Secret.

{% hint style="warning" %}
You need both values for StrongDM integration setup. The client secret is only shown at creation time, so store it securely.
{% endhint %}

## StrongDM Setup in the Admin UI

1. In the StrongDM Admin UI, navigate to the **Integrations** page.
2. Under **Incident Management**, click **Connect** on the PagerDuty item.
3. Fill in the required fields in the pop-out window.

<table data-header-hidden><thead><tr><th width="199.578857421875">Field</th><th width="130.29620361328125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Required</td><td>Name for the OAuth app, such as "StrongDM Integration"</td></tr><tr><td><strong>Instance URL</strong></td><td>Required</td><td>Your organization's PagerDuty URL; this must be a full URL, including <code>https://</code>, and is parsed for your organization's PagerDuty subdomain and region, if any (for example, <code>https://your-subdomain.pagerduty.com</code> or <code>https://your-subdomain.eu.pagerduty.com</code>)</td></tr><tr><td><strong>Client ID</strong></td><td>Required</td><td>Client ID of the OAuth app used for the StrongDM integration</td></tr><tr><td><strong>Client Secret</strong></td><td>Required</td><td>Client Secret of the OAuth app used for the StrongDM integration; shown only once at creation</td></tr><tr><td><strong>User Lookup Attribute</strong></td><td>Required</td><td><strong>Email</strong> or <strong>Identity Alias</strong> depending on whether you are using StrongDM user emails to correlate with PagerDuty users, or using StrongDM Identity Aliases to correlate to PagerDuty users</td></tr></tbody></table>

Once completed, groups from PagerDuty are imported.

{% hint style="info" %}
Note that if you wish to use **Identity Alias** for the **User Lookup Attribute**, you need to create an [Identity Set](/admin/principals/identity-alias) for use with PagerDuty. This Identity Set should contain Identity Aliases that exactly match each user's PagerDuty ID (for example, `PXPGF42`).
{% endhint %}

## Manage the Integration in the Admin UI <a href="#manage-the-integration-in-the-admin-ui" id="manage-the-integration-in-the-admin-ui"></a>

You can manage the integration you just set up by navigating in the Admin UI to **Integrations**, clicking on the **Connected Services** tab, and selecting the Incident.io integration you want to manage. On the integrations page, the left sidebar shows whether the integration is successfully connected. You can also see general information about the Incident.io integration itself and a link to the documentation.

### On-Call <a href="#on-call" id="on-call"></a>

<figure><img src="/files/5P434AqMiAlSLjwYMJc7" alt=""><figcaption></figcaption></figure>

In the **On-Call** tab, you can see the schedules that are being synced by the integration.

#### **Add Schedules**

To add schedules to this list, select **Add Schedules** and then choose the schedules you wish to sync to StrongDM. Once schedules are selected, StrongDM automatically creates and manages a group for each selected schedule containing only the PagerDuty users currently on call for that schedule. On-call users who do not match a StrongDM user are ignored. These groups can then be granted access through [Roles](/admin/access/roles), [Access Workflows](/admin/access/access-workflows) and [Approval Workflows](/admin/access/approval-workflows). That access can be further limited based on context or actions through [Policies](/admin/access/policies).

**Example**:

* Alice, Bob, Carlos, and Deanna are engineers that take on-call shifts on the PagerDuty schedule named "TestSchedule."
* Their StrongDM administrator opens the configuration for their existing PagerDuty integration, goes to the **On-Call** tab, and selects **Add Schedules**. From the list of schedules that are found in PagerDuty, the admin selects **TestSchedule** to add it to StrongDM.
* The admin can navigate to **Principals** > **Groups** in StrongDM and view the **TestSchedule** group. This group is identified in the list as a PagerDuty-managed group. If Alice, Bob, Carlos, and Deanna are existing StrongDM users with email addresses that match their PagerDuty accounts, but only Alice and Bob are currently on-call in the **TestSchedule** in PagerDuty, Alice and Bob should now also be listed in the **TestSchedule** group in StrongDM. When that shift ends, and Carlos and Deanna enter on-call status for that schedule, the StrongDM **TestSchedule** group should now have Carlos and Deanna in it. Alice and Bob would then be removed if they were no longer on-call.
* The admin can open the group and select the **Roles** tab and add roles to the group, which gives members of the group access to whatever resources that the selected roles have access to. See the [Roles](/admin/access/roles) page for more information.
* For just-in-time access, the admin can add a new role with no standing permissions to the **TestSchedule** group, then set up an access workflow that grants the users of this particular role the ability to request access to various resources as needed while on call. This can even be approved automatically, with the request process serving only to provide an audit trail when users ask for and receive access. See the [Access Workflows](/admin/access/access-workflows) page for more information.
* As members rotate off of on-call duty, they are removed from the TestSchedule StrongDM group during the next integration sync (which runs automatically every 15 minutes or can be manually triggered by an admin by clicking the **Sync Now** button on the **On-Call** tab).

#### **Remove Schedules**

Schedules that are currently synced with StrongDM can be removed by selecting them in the list and then clicking the **Remove Schedules** button that appears in the bottom left of the screen when schedules are selected.

### Connection Settings <a href="#connection-settings" id="connection-settings"></a>

The **Connection Settings** tab contains the same settings that were configured in the [Admin UI Setup](#strongdm-setup-in-the-admin-ui) section. The **Name** and **Instance URL** are read-only here, but the **Client ID** and **Client Secret** can be replaced if regenerated at the OAuth app in PagerDuty, and the **User Lookup Attribute** can be changed if you alter how you link StrongDM users and PagerDuty users.

## Manage Access for PagerDuty Groups <a href="#manage-access-for-pagerduty-groups" id="manage-access-for-pagerduty-groups"></a>

Groups imported from PagerDuty can be added to Roles like any other group or featured in access workflows enabling various on-call PagerDuty groups to gain access. See the following sections for information about how to further manipulate access with Access Workflows, Approval Workflows, Policies, and Roles.

* [Access Workflows](/admin/access/access-workflows)
* [Approval Workflows](/admin/access/approval-workflows)
* [Policies](/admin/access/policies)
* [Roles](/admin/access/roles)

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* **A user does not appear in the group**:
  * Confirm that the user exists in StrongDM.
  * Confirm that the user's email matches their email in PagerDuty exactly (or that their Identity Alias for the selected Identity set matches their PagerDuty ID exactly, if using Identity Aliases for user matching).
  * Confirm that the user is currently on-call in PagerDuty.
* **Schedules don’t show up**: Confirm that the OAuth app has the `schedules.read` scope.
* **On-call membership doesn't show recent changes**: Wait (up to 15 minutes) or trigger a manual sync by clicking the **Sync Now** button on the **On-Call** tab.
* **Integration stopped syncing after rotating secrets in the PagerDuty OAuth app**: Update the **Client Secret** field in StrongDM under **Connection Settings** with the new client secret.


# Incident.io Integration

StrongDM integration with Incident.io that allows on-call members of Incident.io schedules to receive access to specified resources within StrongDM while on call.

Many organizations manage incident response software that contains groups of users that are on call at any given time. The Incident.io integration allows your StrongDM organization to connect directly to Incident.io using an API key and sync selected on-call schedules. Each time the integration syncs (every 15 minutes, or when triggered manually), it checks which Incident.io users are on call on the selected schedules, and if it matches those users to StrongDM users, it adds them to a group in StrongDM.

Once those groups exist within StrongDM, admins can then grant them standing access to resources using roles. This would ensure that people who are on call from that schedule always have access to those resources through StrongDM. Admins can also define access workflows to allow those users who are on call to request access to resources for a limited time. Those requests can be configured to be approved either manually by selected approvers or automatically. Either way, the requests are logged and interactions audited.

Access can be made even more granular through the use of [access policies](/admin/access/policies).

## Prerequisites

* Administrator permission level for your StrongDM user in order to create and configure the integration and grant access to the resulting groups.
* An Incident.io user with appropriate privileges to create and manage API keys.

## Incident.io Setup

The Incident.io integration uses an API key to sync on-call schedules with StrongDM. Follow these steps to configure Incident.io for StrongDM:

1. Log in to Incident.io as an administrator.
2. Go to **Settings > API Keys**.
3. Click **Create API Key**.
4. Enter a meaningful **Name** that is useful to your Incident.io administrators.
5. Ensure that the API key has permission to read schedules.
6. Create the key and copy the API key value immediately. You will use this API key in the StrongDM Admin UI when connecting the integration.

{% hint style="warning" %}
The API key is only shown at creation time, so store it securely.
{% endhint %}

## StrongDM Setup in the Admin UI

1. In the StrongDM Admin UI, navigate to the **Integrations** page.
2. Under **Incident Management**, click **Connect** on the Incident.io item.
3. Fill in the required fields in the pop-out window.

<table data-header-hidden><thead><tr><th width="199.578857421875">Field</th><th width="130.29620361328125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Required</td><td>Name for the integration, such as "StrongDM Integration"</td></tr><tr><td><strong>API Key</strong></td><td>Required</td><td>API key for Incident.io</td></tr><tr><td><strong>User Lookup Attribute</strong></td><td>Required</td><td><strong>Email</strong> or <strong>Identity Alias</strong> depending on whether you are using StrongDM user emails to correlate with Incident.io users, or using StrongDM Identity Aliases to correlate to Incident.io users</td></tr></tbody></table>

Once completed, groups from Incident.io are imported.

{% hint style="info" %}
Note that if you wish to use **Identity Alias** for the **User Lookup Attribute**, you need to create an [Identity Set](/admin/principals/identity-alias) for use with Incident.io. This Identity Set should contain Identity Aliases that exactly match each user's Incident.io ID (for example, `01AB23C4DEFGHIJ5KLMNOP6Q`).
{% endhint %}

## Manage the Integration in the Admin UI <a href="#manage-the-integration-in-the-admin-ui" id="manage-the-integration-in-the-admin-ui"></a>

You can manage the integration you just set up by navigating in the Admin UI to **Integrations**, clicking on the **Connected Services** tab, and selecting the Incident.io integration you want to manage. On the integrations page, the left sidebar shows whether the integration is successfully connected. You can also see general information about the Incident.io integration itself and a link to the documentation.

### On-Call <a href="#on-call" id="on-call"></a>

<figure><img src="/files/VlSPUm7ZWWbFDGSOd7mM" alt=""><figcaption></figcaption></figure>

In the **On-Call** tab, you can see the schedules that are being synced by the integration.

#### **Add Schedules**

To add schedules to this list, select **Add incident.io Schedule** and then choose the schedules you wish to sync to StrongDM. Once schedules are selected, StrongDM automatically creates and manages a group for each selected schedule containing only the Incident.io users currently on call for that schedule. On-call users who do not match a StrongDM user are ignored. These groups can then be granted access through [Roles](/admin/access/roles), [Access Workflows](/admin/access/access-workflows) and [Approval Workflows](/admin/access/approval-workflows). That access can be further limited based on context or actions through [Policies](/admin/access/policies).

**Example**:

* Alice, Bob, Carlos, and Deanna are engineers that take on-call shifts on the Incident.io schedule named "TestSchedule."
* Their StrongDM administrator opens the configuration for their existing Incident.io integration, goes to the **On-Call** tab, and selects **Add Schedules**. From the list of schedules that are found in Incident.io, the admin selects **TestSchedule** to add it to StrongDM.
* The admin can navigate to **Principals** > **Groups** in StrongDM and view the **TestSchedule** group. This group is identified in the list as a Incident.io-managed group. If Alice, Bob, Carlos, and Deanna are existing StrongDM users with email addresses that match their Incident.io accounts, but only Alice and Bob are currently on-call in the **TestSchedule** in Incident.io, Alice and Bob should now also be listed in the **TestSchedule** group in StrongDM. When that shift ends, and Carlos and Deanna enter on-call status for that schedule, the StrongDM **TestSchedule** group should now have Carlos and Deanna in it. Alice and Bob would then be removed if they were no longer on-call.
* The admin can open the group and select the **Roles** tab and add roles to the group, which gives members of the group access to whatever resources that the selected roles have access to. See the [Roles](/admin/access/roles) page for more information.
* For just-in-time access, the admin can add a new role with no standing permissions to the **TestSchedule** group, then set up an access workflow that grants the users of this particular role the ability to request access to various resources as needed while on call. This can even be approved automatically, with the request process serving only to provide an audit trail when users ask for and receive access. See the [Access Workflows](/admin/access/access-workflows) page for more information.
* As members rotate off of on-call duty, they are removed from the TestSchedule StrongDM group during the next integration sync (which runs automatically every 15 minutes or can be manually triggered by an admin by clicking the **Sync Now** button on the **On-Call** tab).

#### **Remove Schedules**

Schedules that are currently synced with StrongDM can be removed by selecting them in the list and then clicking the **Remove Schedules** button that appears in the bottom left of the screen when schedules are selected.

### Connection Settings <a href="#connection-settings" id="connection-settings"></a>

The **Connection Settings** tabs contains the same settings that were configured in the [Admin UI Setup](#strongdm-setup-in-the-admin-ui) section. The **Name** is read-only here, but the **API Key** can be replaced if regenerated in Incident.io, and the **User Lookup Attribute** can be changed if you alter how you link StrongDM users and Incident.io users.

## Manage Access for Incident.io Groups <a href="#manage-access-for-pagerduty-groups" id="manage-access-for-pagerduty-groups"></a>

Groups imported from Incident.io can be added to Roles like any other group or featured in access workflows enabling various on-call Incident.io groups to gain access. See the following sections for information about how to further manipulate access with Access Workflows, Approval Workflows, Policies, and Roles.

* [Access Workflows](/admin/access/access-workflows)
* [Approval Workflows](/admin/access/approval-workflows)
* [Policies](/admin/access/policies)
* [Roles](/admin/access/roles)

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* **A user does not appear in the group**:
  * Confirm that the user exists in StrongDM.
  * Confirm that the user's email matches their email in Incident.io exactly (or that their Identity Alias for the selected Identity set matches their Incident.io ID exactly, if using Identity Aliases for user matching).
  * Confirm that the user is currently on-call in Incident.io.
* **Schedules don’t show up**: Confirm that API key has permission to read schedules
* **On-call membership doesn't show recent changes**: Wait (up to 15 minutes) or trigger a manual sync by clicking the **Sync Now** button on the **On-Call** tab.
* **Integration stopped syncing after updating keys in Incident.io**: Update the **API Key** field in StrongDM under **Connection Settings** with the new API key.


# Okta

StrongDM integrates with Okta as an identity provider, handling SSO, SCIM user/group provisioning, and MFA. StrongDM can also govern access to Okta itself.

## Okta

StrongDM integrates with Okta in two directions: StrongDM can use Okta as your identity provider to authenticate and provision your team into StrongDM, and StrongDM can also treat Okta itself as a managed resource so that you can control and audit who has admin access inside Okta.

Not sure which guide you need? Use the following tables to jump to the right one.

### Use Okta to authenticate and provision StrongDM users

| I want to...                                                                       | Guide                                                                      |
| ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Let my team log in to StrongDM with their Okta credentials (OIDC)                  | [SSO With Okta](/admin/principals/sso/okta-oidc)                           |
| Let my team log in to StrongDM with their Okta credentials (SAML or IdP-initiated) | [SAML for Okta](/admin/principals/sso/okta-saml)                           |
| Automatically create, sync, or deactivate StrongDM users from Okta (SCIM)          | [Provisioning With Okta](/admin/principals/provisioning/okta-provisioning) |
| Require an Okta Verify push as a second factor at StrongDM login                   | [MFA With Okta Verify](/admin/principals/mfa/mfa-okta)                     |

### Use StrongDM to manage access to Okta itself

| I want to...                                                                                                          | Guide                                                 |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
| Add Okta Admin Console as a StrongDM resource, and grant, revoke, or audit admin privileges (Okta Groups, JIT access) | [Okta (cloud resource)](/admin/resources/clouds/okta) |

{% hint style="info" %}
These two directions are independent in that you can set up one, the other, or both. Most organizations start with SSO or provisioning; the Okta resource guide is for teams who also want StrongDM to govern access to Okta's own admin console.
{% endhint %}


# Parent/Child Organizations

### What are Parent/Child Organizations?

A StrongDM parent organization is a primary organization that "super admins" can use to centrally administer one or more attached StrongDM organizations. A child organization is a fully fledged StrongDM organization, capable of having its own administration, activities, logs, integrations, access grants, workflows, and other functionality. Parent organizations have a sharply curtailed feature set and are intended only to be used to perform specific administrative controls for the entire group of organizations.

### Use Cases of Parent/Child Organizations

There are two primary use cases that may be assisted by the deployment of a parent organization.

#### Isolated business units

In many situations, your organization may desire to isolate the operations of parts of your business from each other, while still having a central set of "super admin" users that can administer all organizations. This may be a case of different departments or functionality, independent business units, or even dealing with mergers and acquisitions. In these cases, having separate integrations, roles, user directories, and administration patterns may be desired.

#### Simplified billing

It may be worthwhile to create a parent organization if your business already operates with multiple separate organizations but you desire to have a single unified billing arrangement. It also can be a way to separate billing data (seats used) between departments or business units while retaining the single billing apparatus for ease of management.

#### When are parent/child organizations unsuitable?

There are also situations where parent/child organizations may seem like a good solution but are usually not, such as with the following example scenarios.

* **Tree Structures**: Parent/child organizations do not include multiple levels of organizations (there is only parent and child), nor does it include any kind of nested permissions or settings between organizations.
* **Functional Parent Organization**: The parent organization has no ability to add infrastructure or manage access controls for resources.
* **Integration Dependence**: If you depend on having integrations (such as Slack or SSO providers) be functional across organizations, they have [limitations](#limitations-of-parentchild-organizations) when used in parent/child organizations.

### How Parent/Child Organizations Work

#### Limitations of parent/child organizations

* The parent organization is not a functional organization. The functionality of parent organizations is limited primarily to the administration of other organizations and centralized billing. See the [Parent Organization Management](#parent-organization-management) section for details.
* StrongDM requires unique email addresses for all users globally, so if a user needs access to resources from multiple organizations, in addition to needing separate user accounts in each organization, they need multiple unique email addresses. This is solvable for some email services and with some SSO providers. For example, Google allows the email address scheme in which `alice+org1@example.com`, `alice+org2@example.com`, and `alice@example.com` all go to the same mailbox. Some providers do not support this. Note that creating separate users across organizations for the same person will use separate licenses for each user account.
* Parent admins are by nature "super admins" with massive administrative reach. They can "drop in" to any child organization and function as an administrator there. They cannot themselves access resources, but they can trivially make themselves users, grant themselves permissions, and access resources as well. This kind of "super user" access should not be lightly granted.
* Integrations for access workflows, such as Slack or ServiceNow, cannot be used across multiple organizations. For example, it is not possible to have two different StrongDM apps configured in a single Slack workspace. If the separate StrongDM organizations share a Slack workspace, it is not possible to integrate more than one StrongDM organization to that Slack workspace.
* Integrations for SSO/SCIM can require further setup when using the same identity provider across multiple organizations. For some providers it may be a best practice to set up separate apps for each integration. For others, grouping users and choosing which to sync with which StrongDM organization might be enough. Compatibility should be considered prior to deploying multiple StrongDM organizations.

#### Setup process

1. Submit a request to Support, acknowledging that you understand the concepts explained here. Include any further questions that you have. Support also needs the names and emails for the user accounts you would like created in the parent organization (the "super admins").
2. After answering any questions and clarifying any necessary details, the Support team creates a new parent organization for you and then migrates your current organization(s) under the new parent as a child organization(s).
3. At this point, you can create new child organizations from the parent organization without further assistance from Support.

### Parent Organization Management

#### Child organizations

The **Organizations** page shows a list of the names of child organizations with no further details, and each can be clicked to see a details view for that child organization.

The details view shows several tabs of settings for that child organization. Each contains a read-only summary of the corresponding settings from that child organization:

* Authentication
* Logging & Encryption
* Security
* Sign-up & Provisioning

#### Direct administration of child organizations

Parent administrators can also administer child organizations directly. When logged in to the parent organization, the administrator can see in the top right user context menu, under **Login to organization**, a list of child organizations attached to this parent organization. Select the child organization that you would like to administer.

Parent administrators do not need to be manually added to child organizations as users; they are able to drop in and see and manage the child organization without having a separate user in that organization. While viewing the child organization, you may take any actions that an administrator of that organization could take. Your actions show up in **Activities** for that child organization.

#### Add child organizations

To add a child organization, the administrator of the parent organization can go to **Organizations** and click **Add child organization**. The form requires an organization name, and one or more administrator emails along with a first and last name. Once these invitations are sent and are accepted, the child organization is able to be configured and set up just like any other StrongDM organization.

#### User administration

Users are administered just as in regular organizations, but all users are administrators of the parent organization because there is no need for any other type of access. In fact, all users of the parent organization are considered "super admins" because they also have administrator access to every child organization.

The user management settings available in the parent organization are only for administering users in the parent organization, and those settings are not propagated into child organizations in any way.

#### Logs and activities

The **Activities** section of the parent organization only contains administrative activities that occur within the parent organization, such as the creation of new administrators or child organizations.

#### Billing

The **Billing** page in the parent organization contains the number of licenses paid for, the number of licenses used, and then a breakdown of each organization (parent and children) and the number of licenses that are currently being used by each. This unified billing page can provide at-a-glance license utilization for particular organizations within your company.

{% hint style="info" %}
The same unified billing screen showing the number of total licenses and those used per organization is visible on the parent organization and also on each child organization.
{% endhint %}


# Support

Support at StrongDM is broken up into three tiers: Bronze, Gold, and Platinum. Each tier has a set of expectations around response times, service-level agreements (SLA), personal interactions, and training, among other concerns. You may read more about Support levels on the [StrongDM Service Tiers](https://www.strongdm.com/pricing/service-tiers) page.

### StrongDM Help Center

StrongDM Support provides additional information about usage, deployment, installation, troubleshooting, and more, at the [StrongDM Help Center](https://help.strongdm.com/hc/).

To request help from StrongDM Support, please visit the StrongDM Help Center and submit a request ticket.

### Ticket Priority Definitions

Tickets submitted to the StrongDM Help Center can have one of four priority levels: Critical (1), High (2), Medium (3), and Low (4). Each priority level has a particular set of parameters to define it, as well as an expected update frequency. Each priority level also carries an expectation of what will be communicated by StrongDM after the resolution of the issue.

#### Critical (1)

With a critical priority issue, you cannot reasonably continue your work in your StrongDM organization. You experience a complete loss of service and/or encounter one of the following scenarios:

* All users cannot use StrongDM.
* Users cannot access any resources in their environment.

The update frequency for critical priority issues is a minimum of once per day and a maximum of once per hour. This frequency is determined by how impactful the issue is. A Zoom meeting is typically offered to the customer to recap the issue after it is resolved.

For most critical priority issues, a root cause analysis (RCA) will be provided.

#### High (2)

With a high priority issue, your StrongDM organization is running in a degraded mode. Operations can continue in a restricted fashion, although long-term productivity might be adversely affected and there is no temporary workaround. For example:

* Some users cannot use StrongDM.
* Users cannot access some resources in their environment.

The update frequency for high priority issues is a minimum of once per day and a maximum of twice per day (ideally at the start of business and again at the end of the business day). Frequency can be adjusted as needed by how impactful the issue is. A Zoom meeting is available upon request to recap the issue after it is resolved.

For most high priority issues, a root cause analysis (RCA) will not be provided.

#### Medium (3)

With a medium priority issue, your StrongDM organization experiences a minor loss of service, resulting in a partial, non-critical loss of functionality of the software. The impact is an inconvenience, which may require a workaround to restore functionality.

The update frequency for medium priority issues is once per day. Frequency can be adjusted as needed by how impactful the issue is.

For most medium priority issues, a root cause analysis (RCA) will not be provided.

#### Low (4)

With a low priority issue, you are likely making an information request, reporting a documentation error, recommending a product enhancement, or other similar issues. There is little to no impact to the operations of your StrongDM organization.

The update frequency for low priority issues is once per day. Frequency can be adjusted as needed by how impactful the issue is.

For most low priority issues, a root cause analysis (RCA) will not be provided.


# Networking

StrongDM networking involves making decisions about how your network is or will be laid out, and implementing StrongDM proxy services and arranging or grouping them with resources to provide the best experience for your network administrators and end users.

### Available StrongDM Proxy Types

All of the following StrongDM proxy types use the concept of a proxy service that runs on your infrastructure that interacts with StrongDM and proxies user connections to resources.

#### Proxy clusters

A StrongDM [proxy cluster](/admin/networking/proxy-clusters) comprises one or more proxy workers. A proxy worker is a process that mediates connectivity between clients and resources.

![](/files/WjbWWuJp5rtIOttJKZxA)

When a client connects to a StrongDM resource, it looks up which proxy cluster the resource belongs to and uses that cluster to connect. One of the proxy workers in the cluster parses and logs the request; fetches, decrypts, and injects credentials as necessary; and forwards the connection to the resource. Proxy clusters allow your resources and infrastructure to be segmented as you wish, and they allow your proxy infrastructure to scale with your organizational growth or increased traffic. Proxy clusters, when compared to active networking, do require clients to be able to reach out to each proxy cluster (or bridged proxy cluster) that the client might need to interact with. This is not particularly conducive to hub-and-spoke networking.

A [bridged proxy cluster](/admin/networking/proxy-clusters/bridged-proxy-clusters) also exists to allow bridging of traffic into private subnets.

#### Active networking

In [active networking](/admin/networking/gateways-and-relays), which is currently the default method of routing traffic in StrongDM, organizations stand up nodes (gateways and relays) to proxy client traffic to resources. All gateways interact with all gateways, and gateways can connect to all resources that are not in private subnets. All relays within private subnets can reach out to the resources in that subnet as well as to all gateways. This type of networking is not able to be used behind load balancers and is less efficient at routing traffic. However, it can be used in a hub and spoke method, where clients direct their connections at a central set of gateways that are available to them according to your network security rules, and then traffic is routed to other gateways or relays that the client did not need to be allowed to directly make requests to.

#### Explicit routing

[Explicit routing](/admin/networking/gateways-and-relays/explicit-routing), using peering groups, is a way to segment your network into groups (peering groups) that can interact with other groups. Each group contains nodes (gateways and relays) as well as potentially resources. This method of network deployment allows for more directed traffic, but also allows for directed networking decisions, such as allowing multiple peering groups with resources in them to accept traffic from one ingress peering group. Explicit routing is not able to be managed in the Admin UI.

### Docker

StrongDM has Docker images available for both the [containerized client](/admin/clients/docker-clients) as well as the [containerized relay](/admin/networking/gateways-and-relays/docker-nodes).


# Proxy Clusters

There are multiple ways to arrange your StrongDM deployment, as explained in the [Deployment](/admin/deployment) page. The recommended way to deploy StrongDM is through the use of proxy clusters. Proxy clusters are one of the available ways for you to proxy client traffic to your resources. They also provide a way to segment your network so that particular proxies are used to access particular resources. Proxy clusters sit behind your load balancers, and they allow you to scale your infrastructure to handle large amounts of traffic as needed; but they can also be run with only one or two proxy workers for simple network segments.

{% hint style="warning" %}
Every proxy worker in a cluster must have access to the same set of resources. Workers running in separate environments containing separate resources must belong to separate clusters.
{% endhint %}

When your organization is set up with proxy clusters, administrators can create proxy clusters, configure resources in StrongDM and attach them to the proxy clusters. Then, they allow users access to those resources through standing access with [Roles](/admin/access/roles) or through Just-in-Time (JIT) access with [Workflows](/admin/access/access-workflows).

Once they have been granted access, users can use the [client](/users/client) or [CLI](/references/cli) to connect to your resources. Their client reaches out to the appropriate proxy cluster. One of the workers in the cluster handles the request, verifies the client is authorized to connect, and obtains credentials to connect to the resource. The connection is proxied without the credentials ever being exposed to that user. The user simply clicks to connect and begins working on the resource, unaware of any of these behind-the-scenes actions.

### Overview

A StrongDM proxy cluster comprises one or more proxy workers. A proxy worker is a process that mediates connectivity between clients and resources.

{% hint style="info" %}
Proxy clusters are a new deployment option that can be used instead of traditional [gateways and relays](/admin/networking/gateways-and-relays). It is particularly useful for large networks that perform better with segmentation, or that have various subnets with differing requirements.
{% endhint %}

![](/files/WjbWWuJp5rtIOttJKZxA)

When a client connects to a StrongDM resource, it looks up which proxy cluster the resource belongs to and uses that cluster to connect. One of the proxy workers in the cluster parses and logs the request; fetches, decrypts, and injects credentials as necessary; and forwards the connection to the resource.

{% hint style="success" %}
We recommend the following best practices when deploying a proxy cluster:

* Deploy one proxy cluster in each environment where you host resources.
* A proxy cluster should consist of at least two proxy workers behind a load balancer for high availability.
* Configure the load balancer to accept connections on port 443 and forward them to the individual proxy workers on port 8443.
* Use a network load balancer to forward TCP traffic directly to the proxy workers without any processing.
* If the load balancer supports client IP address preservation, enable it.
* Use a DNS domain name to route traffic to the load balancer rather than an IP address.
* A bridged proxy cluster should consist of at least two bridge workers behind a load balancer for high availability and two egress-only proxy workers. The number of proxy workers should be equal to or greater than the number of bridge workers. See [Bridged Proxy Cluster](/admin/networking/proxy-clusters/bridged-proxy-clusters) for more details.
  {% endhint %}

#### Proxy worker egress requirements

Proxy workers must be able to send traffic to several destinations in order to function correctly:

{% tabs %}
{% tab title="US" %}

* `app.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
  {% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

* `app.uk.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.uk.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
  {% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

* `app.eu.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.eu.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
  {% endtab %}
  {% endtabs %}

For more information, please see the [Ports Guide](/admin/networking/ports-guide).

Additionally, if your organization requires outbound traffic from your infrastructure to pass through your own corporate proxy, you must either or both of the `HTTP_PROXY`/`HTTPS_PROXY` environment variables (or the StrongDM-specific version). Please see the [Environment Variables](/admin/deployment/environment-variables) for a list of available environment variables for use with StrongDM.

#### Authentication keys

Each proxy cluster uses authentication keys to link proxy workers and (optional) bridge workers to that specific cluster. The default limit for keys is four per proxy cluster, which enables optional rotation. The access key and secret key are stored in the configuration file `/etc/sysconfig/sdm-worker` along with any SDM environmental variables.

### Deploy a Single-Worker Proxy Cluster

{% hint style="warning" %}
This guide explains how to deploy a simple test cluster containing one proxy worker. For production environments we recommend using infrastructure tools to deploy multiple workers in a high availability configuration behind a load balancer. See these guides for platform-specific instructions if they apply to you:

* [Deploy ECS Fargate Proxy Clusters](/admin/networking/proxy-clusters/ecs-proxy-clusters)
* [Deploy Kubernetes Proxy Clusters](/admin/networking/proxy-clusters/kubernetes-proxy-clusters)
  {% endhint %}

1. Set up a **64-bit** Linux instance with at least 2 CPUs and 4 GB of memory. Make sure the firewall allows clients to connect to the instance on port 443.
2. Note the IP address of the instance.
3. Log in to the StrongDM Admin UI.
4. Go to **Networking** > **Proxy Clusters**.
5. Click **Add proxy cluster**. You can name the cluster here or modify it later.
6. Enter the address of your Linux instance (with port 443 included) in the **Advertised Address** field (for example: `111.111.111.111:443`).

   ![](/files/0pVkXP7SJKgzOWGpIkgu)
7. Click **Create proxy cluster**.
8. Click **Add authentication key**. The access key and secret key appear in a modal. Copy these and save them for use in a later step.

   ![](/files/v3HjPyITcJDx3dd4Ixi8)
9. Log in to the Linux instance.
10. To run the worker via Docker (recommended), first [install Docker](https://docs.docker.com/engine/install/). Then run the following command, substituting the access key and secret key you created:

{% tabs %}
{% tab title="US" %}

```shell
docker run \
  -e SDM_PROXY_CLUSTER_ACCESS_KEY=<ACCESS_KEY> \
  -e SDM_PROXY_CLUSTER_SECRET_KEY=<SECRET_KEY> \
  -e SDM_APP_DOMAIN=app.strongdm.com \
  --restart=always \
  --name sdm-worker \
  -p 443:8443 -d \
  public.ecr.aws/strongdm/relay
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```shell
docker run \
  -e SDM_PROXY_CLUSTER_ACCESS_KEY=<ACCESS_KEY> \
  -e SDM_PROXY_CLUSTER_SECRET_KEY=<SECRET_KEY> \
  -e SDM_APP_DOMAIN=app.uk.strongdm.com \
  --restart=always \
  --name sdm-worker \
  -p 443:8443 -d \
  public.ecr.aws/strongdm/relay
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```shell
docker run \
  -e SDM_PROXY_CLUSTER_ACCESS_KEY=<ACCESS_KEY> \
  -e SDM_PROXY_CLUSTER_SECRET_KEY=<SECRET_KEY> \
  -e SDM_APP_DOMAIN=app.eu.strongdm.com \
  --restart=always \
  --name sdm-worker \
  -p 443:8443 -d \
  public.ecr.aws/strongdm/relay
```

{% endtab %}
{% endtabs %}

11. To run the worker via `systemd`, download the StrongDM binary, unzip it, and run the installer. When prompted, paste the access key and secret key you created. After install, use `systemctl status sdm-worker` to check that the service is running.

{% tabs %}
{% tab title="US" %}

```shell
curl -J -O -L https://app.strongdm.com/releases/cli/linux
unzip sdmcli_*_linux_amd64.zip
./sdm install --worker --worker-bind-addr :443 --app-domain app.strongdm.com 
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```shell
curl -J -O -L https://app.uk.strongdm.com/releases/cli/linux
unzip sdmcli_*_linux_amd64.zip
./sdm install --worker --worker-bind-addr :443 --app-domain app.uk.strongdm.com 
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```shell
curl -J -O -L https://app.eu.strongdm.com/releases/cli/linux
unzip sdmcli_*_linux_amd64.zip
./sdm install --worker --worker-bind-addr :443 --app-domain app.eu.strongdm.com 
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, will fail to complete the installation.
{% endhint %}

{% hint style="warning" %}
For production installations, we recommend you configure the workers to bind to a higher port (8443 is the default) and use a load balancer to remap that to port 443.
{% endhint %}

12. Confirm the proxy worker is running by verifying that the address is accessible from the appropriate end user network, as in the following example. If everything is working correctly, the proxy worker returns an HTTP 404 status code.

```shell
curl -k https://111.111.111.111
404 Not Found
```

{% hint style="info" %}
This guide demonstrated how to configure a proxy cluster in the Admin UI with a single proxy worker. To set up a proxy cluster with more than one proxy worker, you must use a network load balancer. The proxy cluster address in StrongDM is the address of your load balancer, and each of the proxy workers is set up with the same proxy cluster access key, as was done for the single worker cluster in this guide. Traffic to the proxy cluster is then directed by your load balancer to a proxy worker, which are all capable of authenticating to your resource(s) and forwarding client traffic to them.
{% endhint %}

#### Deploy with the CLI

Proxy clusters, like gateways or relays, can also be deployed using the CLI. This uses the `sdm admin nodes` command structure.

```
sdm admin nodes create-proxy-cluster --name <CLUSTER_NAME> <ADDRESS>:<PORT>
```

For more details, see the CLI Reference page for [sdm admin nodes create-proxy-cluster](/references/cli/admin/nodes/create-proxy-cluster).

### Add Resources to a Proxy Cluster

To add resources to a proxy cluster, when adding or editing the resource in the Admin UI, select the name of the proxy cluster from the dropdown menu for the **Proxy Cluster** field. A resource attached to a proxy cluster will only be reachable via that proxy cluster.

At the command line, the `--proxy-cluster-id` option can be used to specify a proxy cluster. The ID of a cluster can be found using `sdm admin nodes list` or in the Admin UI under **Networking** > **Proxy Clusters**.

### Manage Existing Proxy Clusters

You can see a list of proxy clusters currently deployed in your organization in the **Networking** > **Proxy Clusters** page of the Admin UI. Selecting any cluster will bring you to the details view for that cluster, starting with the **Resources** tab. The **Resources** tab displays a list of all resources that are currently assigned to this proxy cluster. Each resource can be configured to be part of a particular proxy cluster in the configuration settings for that resource. There is also a **Keys** tab, which lists the available keys that can be used to add proxy workers to this cluster and allows the generation of additional keys. The **Settings** tab is where the cluster's settings can be configured (name and address).

#### Search filters

You can use search filters in the Admin UI on the **Networking** > **Proxy Clusters** page to search for specific proxy clusters and display them according to their name, address, or tags. Searching and filtering can also be done on the **Resources** tab when viewing the details of a particular proxy cluster.

To use filters, type or copy/paste the following filters into the **Search** field, with or without other text. Do not use quotes or tick marks.

| Filter                                        | Description                                                                      | Example search                                                                          |
| --------------------------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `listenaddr:<IP_ADDRESS>`                     | Shows proxy clusters with the specified address                                  | `listenaddr:10.0.0.021:443` finds clusters that have an address of `10.0.0.021:443`.    |
| `name:<PARTIAL_STRING>` or any free-form text | Shows proxy clusters with names that match the entered string; partial string OK | `name:keen-coffee` or `coffee` finds all clusters whose names contain those characters. |
| `tags:<TAG=VALUE>`                            | Shows proxy clusters with the specified tags                                     | `tags:Environment=sandbox` finds clusters that have the tag `Environment=sandbox`.      |

#### Update a proxy cluster

To update a proxy cluster, find the cluster in the Admin UI at **Networking** > **Proxy Clusters** or at the CLI using `sdm admin nodes list`. View the cluster by clicking it in the Admin UI list, to edit its configuration. Using the CLI, you can use `sdm admin nodes update CLUSTER_ID`. To delete one, you can go to **Settings** > **Delete** on its details page in the Admin UI, or use the `sdm admin nodes delete` command at the CLI.

### Upgrades

StrongDM proxy workers upgrade themselves automatically. To configure when these upgrades happen, see [Maintenance Windows](/admin/networking/maintenance-windows).

To minimize downtime during upgrades, configure your load balancer to periodically probe the [Liveness Check port](/admin/networking/gateways-and-relays#liveness-check) on each worker. When liveness checks are enabled, workers in the cluster coordinate with the load balancer and with each other to perform a rolling deployment upgrade during the maintenance window. The upgrade process for each worker looks like this:

1. Worker waits until there are no other workers in line ahead of it to restart.
2. Worker waits 90 seconds to allow any previously restarted workers to come back online and be registered with the load balancer.
3. Worker continues serving traffic, but shuts down its liveness check port to signal to the load balancer that it is shutting down.
4. Worker waits 90 seconds to allow the load balancer to remove it from the target group.
5. Worker severs all connections and restarts.

If blue/green deployments are desired, they can be set up using standard orchestration tools. Schedule deployments on a regular interval and configure the maintenance window such that the blue/green deployment happens before the window. This ensures the workers are already upgraded by the time the built-in rolling deployment occurs, and no restarts will be necessary.

### Third-Party Certificates

The StrongDM control plane automatically signs and issues certificates for proxy clusters, but you can also configure your proxy cluster to use your own certificates. Proxy workers respect the following environment variables, which can be mixed and matched:

* `SDM_TLS_CERT_SOURCE` determines where the proxy worker gets its TLS certificate from. Accepted values include:
  * `strongdm` (default): The proxy worker terminates TLS using a certificate signed by the StrongDM proxy cluster CA generated by the control plane.
  * `file`: The proxy worker terminates TLS using certificate and key PEM files specified by the `SDM_TLS_CERT_FILE` and `SDM_TLS_KEY_FILE` environment variables. The proxy worker automatically reloads the certificate from disk once per day, so the certificate should have a validity period of at least two days. Use this if you need to use your own certificates while also keeping the extra security afforded by mutual TLS.
  * `none`: The proxy worker does not terminate TLS. Use this if you want to terminate TLS using your own load balancer. You must also specify `SDM_TLS_CLIENT_AUTH=none`.
* `SDM_TLS_CLIENT_AUTH` controls how the proxy worker validates client TLS connections.
  * `direct` (default): The proxy worker establishes mutual TLS directly with clients and validates their client certificates directly. This mode is incompatible with `SDM_TLS_CERT_SOURCE=none`.
  * `none`: The proxy worker does not validate client certificates. Use this if you want to terminate TLS using your own load balancer.


# Bridged Proxy Cluster

### Overview

You can deploy a StrongDM [proxy cluster](/admin/networking/proxy-clusters) in "bridged" mode to enable access to a high-security internal network that only allows outbound network connections. The bridged proxy cluster has bridge workers outside the internal network and proxy workers inside the network. The proxy workers inside the network make outbound connections to one or more bridge workers running outside the network, which can then forward client traffic back to them.

{% hint style="info" %}
For organizations that have employed nodes (gateways and relays) previously, this functionality is similar to that of the relay.
{% endhint %}

How it works:

1. In this configuration, proxy workers are egress only, meaning they do not accept connections from outside, but they can initiate connections themselves. The proxy worker(s) inside the secure subnet reach out (through the load balancer) and make connections with the bridge worker(s) to prepare to receive traffic.
2. When a user attempts use their client (StrongDM Desktop app or CLI) to connect to a resource that is attached to the bridged proxy cluster, the client reaches out to the proxy cluster's load balancer. The traffic is then directed to a bridge worker, which has a connection open to a proxy worker and routes it there.
3. The proxy worker proxies the connection to the resource, authenticating to it without revealing the credentials to the user.

![](/files/zsx8iNWUvbstmHzpdaAD)

{% hint style="warning" %}
Just like in a normal proxy cluster, every proxy worker must have access to the same set of resources. Bridge workers do not intelligently route traffic between proxy workers running in different environments. Proxy workers running in separate environments containing separate resources must belong to separate clusters.
{% endhint %}

To deploy bridge workers, follow [the steps to deploy a normal proxy cluster](/admin/networking/proxy-clusters) and add the following variable to the bridge workers' environment:

```
SDM_BRIDGE=local
```

If you are using the `sdm install` command, you can use the `--bridge` flag to set this variable:

```shell
./sdm install --worker --bridge local --worker-bind-addr :443 --app-domain {APP_DOMAIN} 
```

This instructs the workers to run in bridge mode. StrongDM recommends running multiple bridge workers behind a load balancer for high availability.

Once the bridge workers are deployed, you can deploy proxy workers inside your sensitive network and configure them to connect to the bridge workers by adding the following environment variable:

```
SDM_BRIDGE=<PROXY_CLUSTER_ADDRESS>:<PORT>
```

Instead of binding to a local port and listening for incoming traffic, the proxy workers connect to the load-balanced bridge workers and start accepting client traffic from them.

* You do not need to allow inbound traffic into your sensitive network.
* You do not need to deploy a second load balancer inside the network.
* Proxy workers can only connect to bridge workers within the same proxy cluster. You cannot mix and match workers between proxy clusters.

{% hint style="success" %}
We recommend the following best practices when deploying a bridged proxy cluster:

* Deploy one proxy cluster in each environment where you host resources.
* A bridged proxy cluster should consist of at least two bridge workers behind a load balancer for high availability and two egress-only proxy workers. The number of proxy workers should be equal to or greater than the number of bridge workers.
* Configure the load balancer to accept incoming connections on port 443 and forward them to the individual bridge workers on port 8443.
* Use a network load balancer to forward TCP traffic directly to the bridge workers without any processing.
* If the load balancer supports client IP address preservation, enable it.
* Use a DNS domain name to route traffic to the load balancer rather than an IP address.
  {% endhint %}

### TLS Configuration

#### Clock Drift in TLS Connections

It is recommended to use [NTP](https://en.wikipedia.org/wiki/Network_Time_Protocol) for time on bridge workers and proxy workers, so that their clocks are in sync. If there is a clock drift of five seconds or more, certificates will mismatch and TLS bridge connections will fail. Clock drift can be prevented by using NTP to ensure sychronized time.

#### Third-party Certificates

Third-party certificates are supported [the same as in a normal proxy cluster](/admin/networking/proxy-clusters#third-party-certificates). You must ensure the relevant environment variables are set on both the bridge workers and proxy workers.

The proxy worker expects a TLS connection from the bridge worker. If the `TLS_CLIENT_AUTH` environment variable is set to `none` on the bridge worker, and the load balancer does not provide TLS auth for the connection, the proxy worker will fail to connect.

{% hint style="success" %}
A good rule to remember is that certificate settings on the bridge workers and proxy workers should typically match. For more information, read about certificate settings in the [proxy clusters](/admin/networking/proxy-clusters#third-party-certificates) page.
{% endhint %}

### Proxy Egress Requirements

Workers in a bridged proxy cluster have [the same egress requirements as in a normal proxy cluster](/admin/networking/proxy-clusters#proxy-egress-requirements). In addition, the proxy workers must be allowed to egress to the bridge workers.


# Deploy ECS Fargate Proxy Cluster

### Overview

AWS Fargate, a serverless compute engine, is a popular option for deploying containerized infrastructure with Amazon Elastic Container Service (ECS). This guide provides step-by-step instructions on how to deploy a StrongDM proxy cluster in Fargate.

Our instructions will show you how to set up your environment as shown.

![](/files/Me5AWXVW31DKbuoRh5le)

The diagram shows the following essential components needed to deploy a proxy cluster as a Fargate service using ECS:

* Virtual Private Cloud (VPC) with internet gateway
* Private subnet routing traffic through a NAT gateway in a public subnet to connect to the internet
* Network Load Balancer (NLB) distributing incoming traffic from the internet to a Fargate service in the private subnet

{% hint style="info" %}
When deploying your Fargate service in a private subnet without internet access, you need to [set up a NAT gateway](https://aws.amazon.com/premiumsupport/knowledge-center/ecs-fargate-tasks-private-subnet/) that reaches out to the internet to acquire the StrongDM proxy worker image and connect to StrongDM.
{% endhint %}

### Steps

These instructions explain how to configure an NLB, task definition, cluster, and service in the EC2 Console, as well as how to generate an authentication key from the StrongDM Admin UI. We recommend that you keep both the EC2 Console and the Admin UI open in your browser so you can easily tab between them.

#### Create an NLB in the EC2 Console

{% hint style="info" %}
Application Load Balancers (ALBs) are not compatible with StrongDM proxies. Use a Network Load Balancer (NLB) instead.
{% endhint %}

We recommend having the load balancer listen on port 443 and forward traffic to the individual proxies on port 8443.

1. Go to the EC2 Console in AWS.
2. From the left-hand menu, expand **Load Balancing** and select **Load balancers**.
3. Click **Create load balancer**, and under **Network Load Balancer**, click **Create**.
4. Set the **Basic configuration** properties:
   * **Load Balancer Name**: Enter a name for the load balancer.
   * **Scheme**: Select **Internet-facing**.
   * **IP address type**: Select **IPv4**. Note that an elastic IP is not required.
5. Set the **Network mapping** properties:
   * **VPC**: Select the VPC where this proxy cluster will be hosted.
   * **Mappings**: Select the availability zone where you want the load balancer to be hosted (that is, where the public subnet resides).
6. Set the **Listeners and routing** properties:
   * **Port:** Select TCP port **443**. Note that 443 is the default TCP port specified for SDM proxies, but you can modify it for your environment.
   * **Create target group**: Click the link, which opens a new tab.
7. On the **Specify group details** page that opens:
   * **Target type**: Select **IP Addresses** as the target group.
   * **Target group name**: Set the name of the target group.
   * **Port**: Set TCP port **8443**. This port needs to match the port you plan to expose on the Fargate container. The default is 8443.
   * Click **Next**.
8. On the next page, leave the options blank and click **Create target group**. Note that a target will be set later once the ECS container is created.
9. Go back to the **Load Balancers** properties page, and click the refresh button next to **Target group**.
10. Select the target group that was just created.
11. Click **Create load balancer**.
12. Click **View load balancers**, and copy the **NLB DNS name** of the NLB that you just created.
13. Select the name of the load balancer to open its details page.
14. On the **Attributes** tab, choose **Edit**.
15. On the **Edit load balancer attributes** page, turn **Cross-zone load balancing** on.
16. Choose **Save changes**.

#### Create a proxy cluster in StrongDM

To create a proxy cluster, follow these steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Networking** > **Proxy Clusters**.
3. Click **Add proxy cluster**.
4. For **Name**, enter a name for the cluster.
5. For **Advertised Address**, enter the NLB DNS name that was created in the EC2 Console, and the port number (we recommend port 443; for example, `my-sdm-proxy.elb.us-east-2.amazonaws.com:443`).
6. Click **Create proxy cluster**.
7. Click **Add authentication key**. The key appears in a modal. Copy the key and keep it in a secure place.

#### Create an ECS task definition

1. In the AWS ECS Console, go to **Task Definitions** and create a new task definition.
2. Select **Fargate** as the launch type compatibility, and click **Next step**.
3. On the **Configure task and container definitions** page, set the following:
   * **Task Definition Name**: Enter a task name.
   * **Task Role**: Select **None**.
   * **Task memory (GB)**: Select **4GB**.
   * **Task CPU (vCPU)**: Select **2 vCPU**.
4. Under **Container Definitions**, click **Add container** and then set the following:
   * **Container name**: Enter a name for the container.
   * **Image**: Set `public.ecr.aws/strongdm/relay` as the image URL.
   * **Memory Limits (MiB)**: Set a **soft limit of 2048**.
   * **Port mappings**: Add a TCP port map to **8443**.
   * **Environmental Variables**: For **Key**, set `SDM_PROXY_CLUSTER_ACCESS_KEY`. For **Value**, paste the access key created in the Admin UI. Then click **Add**. Repeat this process for `SDM_PROXY_CLUSTER_SECRET_KEY`.
5. Back on the **Configure task and container definitions** page, scroll down and click **Create**.

#### Create an ECS cluster

1. In the ECS Console, go to the **Clusters** section and click **Create Cluster**.
2. Services are associated with an ECS cluster. On the **Select cluster template** page, select **Networking Only Powered by AWS Fargate**, and click **Next step**.
3. On the **Configure cluster** page, enter the **cluster name**, and click **Create**.
4. Click **View Cluster**, which will open the **Clusters Management** page.

#### Create a new ECS service

1. On the **Clusters Management** page, click your cluster name. On that page, click the **Services** tab and then click **Create**.
2. On the **Create Service** page that opens, set the following:
   * **Launch type**: Select **FARGATE**.
   * **Task Definition**: Select the task definition created earlier.
   * **Service name**: Enter a name for this service.
   * **Number of tasks**: Set **2**.
   * **Minimum healthy percent**: Set **100**.
   * **Maximum healthy percent**: Set **200**.
   * **Deployment type**: Set **Rolling update**.
   * Click **Next step**.
3. On the **Configure network** page, set the following:
   * **Cluster VPC:** Select the Fargate VPC where the cluster is hosted.
   * **Subnets:** Select a private subnet. Without this, the NLB will not be able to reach the container (for example, `10.0.7.0/24`).
4. For **Security Groups**, click **Edit** and do the following:
   * Click **Create a new security group**.
   * In **Basic details:**
     * **Security group name:** Name the group.
     * **Description:** Describe what the group is for.
     * **VPC:** Select the VPC.
   * Under **Inbound rules:**
     * **Type:** Choose **Custom TCP**.
     * **Port range:** Choose the port (for example, "8443") you are mapping from the load balancer to the service.
     * **Source**: Choose **Anywhere**. Please note: The load balancer is only open on the ports you forward, and the service is on a private network. You can, however, specify the IP address or range of the load balancer if you prefer. We recommend starting with an open security group for testing; you can modify it later.
     * Click **Create security group**.
   * **Auto-assign public IP:** Set to **DISABLED**.
   * **Load balancer type:** Select **Network Load Balancer**.
   * **Load balancer name:** Select the NLB that you created earlier.
   * Click **Add to load balancer**.
   * **Production listener port:** Select the listener port you created earlier.
   * These steps also enable the **Health check grace period** field. Scroll up and enter a value of **600** (seconds), for a 10-minute grace period.
   * Click **Next step**.
   * Click **Next step**.
   * Click **Create Service**.
   * Click **View Service**.

#### Verify the proxy cluster

Refresh the page to see that the proxy worker tasks are online and running. It should take a couple of minutes for the IP addresses to show up in the target group associated with the NLB.


# Deploy Kubernetes Proxy Cluster

### Overview

This guide describes how to deploy a proxy cluster in your Kubernetes cluster. If you are trying to install a gateway or relay and not a proxy cluster, see the [Nodes in Kubernetes](/admin/networking/gateways-and-relays/kubernetes-nodes) guide.

### Prerequisites

To be successful when using this guide, you must meet the following general requirements:

* Ensure that you are an Administrator in StrongDM.
* Be sure that your Kubernetes cluster(s) is at v1.16 or later and has publicly accessible nodes and stable IPs.
* Install the `kubectl` command-line tool locally to interact with your Kubernetes clusters.
* Install Helm 3.0 or later locally.
* If you are using [Nginx Ingress Controller](https://kubernetes.github.io/ingress-nginx/), manually patch your services to [allow TCP and UDP traffic](https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/).

### Register the Proxy Cluster

You must first register the proxy cluster with StrongDM via the Admin UI and generate an authentication key for it. You will need to give the cluster a name and address.

Unfortunately it is not usually possible to know which external address the cluster will receive from Kubernetes before you deploy it. You should choose one of the following methods to handle the unknown address:

* Use a placeholder address for the cluster. After deploying the cluster, determine the address of the load balancer using `kubectl get svc` and update the cluster configuration in StrongDM to match.
* Choose a domain name ahead of time for the cluster address. After deploying the cluster, determine the address of the load balancer using `kubectl get svc` and manually update your domain records to point to it.
* Choose a domain name ahead of time for the cluster address. Use a [DNS controller](https://github.com/kubernetes-sigs/external-dns) to make Kubernetes automatically point the domain to your proxy cluster.

After choosing a strategy to configure the proxy cluster and update its address, follow these steps to register the cluster.

1. Log in to the StrongDM Admin UI.
2. Go to **Networking** > **Proxy Clusters**.
3. Click **Add proxy cluster**.
4. For **Name**, enter a name for the cluster.
5. For **Advertised Address**, enter your chosen address and port for the cluster (we recommend port 443; for example, `172.16.50.2:443`).
6. Click **Create proxy cluster**.
7. Click **Add authentication key**. The key appears in a modal. Copy the key and keep it in a secure place.

To generate a key via the CLI, use the [sdm admin nodes create-proxy-cluster](/references/cli/admin/nodes/create-proxy-cluster) command.

### Manage Kubernetes Proxy Clusters With Helm

To manage deployments of proxy clusters across your Kubernetes cluster, we recommend that you use our [Helm charts](https://github.com/strongdm/charts) and leverage the flexibility of Helm.

#### Install the sdm-proxy Helm chart

You can use the following steps to install proxies with Helm. Note that this example creates a single proxy worker. If you intend to have a proxy cluster with multiple workers, they will need to be behind a load balancer, as described in the [Proxy Clusters](/admin/networking/proxy-clusters) section.

1. Create a `values.yaml` file for use with the Helm chart. You can see a reference schema of the available options in the `sdm-proxy` GitHub repository [values.yaml](https://github.com/strongdm/charts/blob/main/deployments/sdm-proxy/values.yaml) file or on [ArtifactHub](https://artifacthub.io/packages/helm/strongdm/sdm-proxy) for further customization. The minimum values that must be specified in order to create the proxy cluster worker, register it with your organization, and register the cluster as a resource are shown in the following example.

```yaml
strongdm:
  auth: # StrongDM authentication sources
      clusterKey: "" # SDM_PROXY_CLUSTER_ACCESS_KEY with which this proxy should authenticate itself
      clusterSecret: "" # SDM_PROXY_CLUSTER_SECRET_KEY with which this proxy should authenticate itself
      adminToken: "" # SDM_ADMIN_TOKEN with which to create StrongDM resources
  autoRegisterCluster: # Register this cluster as a resource in StrongDM
    enabled: true
```

2. Install the Helm chart. Replace `<RELEASE_NAME>` with a unique and meaningful name.

   ```shell
   helm repo add strongdm https://helm.strongdm.com/stable/
   helm install <RELEASE_NAME> strongdm/sdm-proxy -f values.yaml
   helm status <RELEASE_NAME>
   ```
3. If you wish, you can verify that the chart created the proxy cluster worker, and that the resource was added to your StrongDM organization with the following methods:
   1. You can check that the proxy cluster worker is running in your cluster with `kubectl get services`.
   2. You can check that the cluster is added to StrongDM as a resource by looking in the Admin UI **Resources** > **Managed Resources**, or by using the CLI (`sdm admin clusters list`). If you did not specify any settings for your cluster resource, it will be named something based on your chosen `<RELEASE_NAME>`.

#### Upgrade the sdm-proxy Helm chart

To upgrade the sdm-proxy Helm chart, run the following command. For more, see the [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) command documentation.

```shell
helm upgrade <RELEASE_NAME> strongdm/sdm-proxy --install
```

{% hint style="info" %}
The proxies will automatically keep themselves up to date without you needing to upgrade the Helm chart. You only need to upgrade if you want a feature that is only available in a newer version of the sdm-proxy Helm chart.
{% endhint %}

#### Uninstall the sdm-proxy Helm chart

You can uninstall the sdm-proxy Helm chart by running the following command. This command removes all Kubernetes components associated with the release and deletes the release. For more, see the [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) reference documentation.

```shell
helm uninstall <RELEASE_NAME>
```


# Proxy Clusters Migration

### Migration Considerations

When you create a plan to migrate your StrongDM deployment from active networking using [gateways and relays](/admin/networking/gateways-and-relays) to [proxy clusters](/admin/networking/proxy-clusters), here are a few things to consider:

* Ensure your clients can reach the load balancer that you intend to use for the proxy cluster.
* Determine whether a bridged cluster is necessary. Bridged clusters are useful for the same situations where relays were often used in active networking deployments. If you need to provide access to resources that are inside an egress-only subnet, bridged proxy clusters are the way to accomplish this.
* When a resource is assigned to a proxy cluster, active client connections to that resource through gateways and relays are not disrupted. Only new connections route through the proxy cluster.

#### Migration from explicit routing

For users of explicit routing:

Do not remove resources from peering groups, if any, until after you’ve migrated and are satisfied with the proxy cluster setup. If a reversion is necessary, leaving the resources in peering groups would make that significantly easier.

### Migration Process

1. Create a network segmentation plan.
   1. What various proxy clusters does your organization need? This can be determined by access needs, security requirements, geographical locations, and other concerns.
   2. Map existing resources to the planned proxy clusters.
   3. Consider the amount of proxy workers needed for each cluster, based on the number of resources, and more importantly, the amount of anticipated traffic. Consider deploying at least two workers to every cluster, behind a load balancer, for high availability, as discussed in the [Proxy Clusters](/admin/networking/proxy-clusters) page.
   4. Consider which proxy clusters will need to be [bridged clusters](/admin/networking/proxy-clusters/bridged-proxy-clusters).
2. Set up proxy cluster for a test network segment first. See the [Proxy Clusters](/admin/networking/proxy-clusters) guide for more detail.
3. Ensure that it all works as expected prior to rolling out deployment.
4. Verify that the test cluster is healthy.
5. Add test resources to the cluster for your test segment. Ensure the test resources can be connected to directly prior to adding them to the cluster.
6. Once the test resources are added to the cluster, grant your user the ability to connect to the resource(s) using [roles](/admin/access/roles), and test connecting to the resource.
7. After the first cluster is set up satisfactorily, add each resource that you want included in this proxy cluster, one by one. Then, repeat this setup process with additional proxy clusters, until your planned migration is complete.

If all testing goes well, this procedure can be followed for each planned segment until all planned segments are up and running, or automate the creation of your clusters and registration of resources by creating Terraform plans or CLI automations.


# Gateways and Relays

### Overview

Gateways serve as the primary entry point to a StrongDM network. Gateways have an assigned IP address and optional DNS entry.

Relays, much like gateways, are how the StrongDM network connects with resources such as databases and servers. Unlike a gateway, the relay does not listen for client connections. When might this be helpful? For a secure network where you are not able to expose ports, the StrongDM relay is the answer. The relay dials out to connect to your gateways, preserving the egress-only nature of your firewall, but allowing your StrongDM clients to reach any configured resources in the network via those connections.

{% hint style="info" %}
We recommend the following best practices when configuring gateways and relays:

* Deploy gateways and relays in pairs for redundancy.
* Offset gateway and relay [maintenance windows](/admin/networking/maintenance-windows) within any pair for redundancy.
* Deploy gateways in regions that are closest to the largest amount of users.
* Deploy relays in regions as close as possible to the resources to which they send traffic.
* Do not place gateways and relays behind a load balancer. If you must do so (such as with a cluster) there must be a 1:1 relationship between the port and the container. Deploying new gateways and relays via autoscaling is all right, but failover and routing are handled by StrongDM.
* The hierarchy of gateways and relays is usually best with a limited number of gateways. Aim for 20 gateways maximum and have as many relays as necessary to enable the desired data flow or segregation. For more flexibility in network segmentation or for larger amounts of deployed resources and proxies, consider using [Proxy Clusters](/admin/networking/proxy-clusters).
  {% endhint %}

### Gateways

Gateways serve as the primary entry point to a StrongDM network. Therefore, each gateway must be assigned an address that is accessible to your users. They can be deployed with a Domain Name System (DNS) entry or sit privately on the corporate network behind a Virtual Private Network (VPN). You can also assign an IP address directly if you prefer not to use DNS or a VPN. You need at least one gateway to connect to resources, but we recommend running them in pairs.

{% hint style="info" %}
If your host is set up so that the IP address changes upon reboot, this change also causes the gateway to lose connection to StrongDM. There is no way to change the IP address of the gateway in StrongDM manually after the gateway has been created. If this is an issue, one solution is to use a fully qualified domain name instead of an IP address for the gateway or relay hostname in StrongDM. Another is to use the [self-registering StrongDM Gateway AMI](/admin/networking/gateways-and-relays/sdm-ami).
{% endhint %}

StrongDM gateways are usually exposed directly to the internet. In the case of a flat network, the gateway talks to the target systems on the corporate network. On a segmented network with no ingress, however, resources such as databases and servers may not be publicly accessible. If you wish to extend your StrongDM network into a more secure network or subnet, you may deploy a relay behind your firewall to route traffic and allow egress-only connections to secured resources.

![](/files/Bo2Wt06GYdUJxSEpWrbp)

Gateways are essentially relays with an assigned IP address and optional DNS entry. Both gateways and relays also decrypt end-user credentials and deconstruct requests for auditing purposes.

When clients connect to the StrongDM network, they request a list of available gateways. StrongDM determines the most suitable route and sends all connections through one or more of these gateways. From the point of view of a resource, such as a database or server, all traffic originates from any relay or gateway with access to the resource.

{% hint style="info" %}
Certificates for gateways automatically regenerate 14 days before they expire. During this process, the gateway will restart, typically without a noticeable impact on services.
{% endhint %}

Gateways can be deployed as a native [Linux service](/admin/networking/gateways-and-relays/ecs-nodes), [Docker container](/admin/networking/gateways-and-relays/docker-nodes), or [Kubernetes container](/admin/networking/gateways-and-relays/kubernetes-nodes). For more, check the **Download & Install** page in the Admin UI.

Gateway settings and configurations can be managed in the Admin UI from **Networking** > **Gateways**. On the **Gateways** page, you can add new gateways and view the [status](#view-status) and details of existing gateways.

#### Add a gateway

1. Log in to the Admin UI.
2. Go to **Networking** > **Gateways**.
3. Click **Add gateway**. You can rename the gateway here or modify it later. **Advertised host** is the IP address or host that the gateway listens on. The **Advertised port** (default **5000**) is the port that the service listens on.

   ![](/files/otjEIahzhxo3tGjfz6bu)
4. Click **Advanced** to add a **Bind IP** or a **Bind Port**.
5. Click **Create gateway** and the gateway token appears in a modal. Copy the gateway token and save it for use in a later step.

   ![](/files/hvtlORvFZQaOIVELJKDV)
6. Set up a **64-bit** Linux instance to run the gateway. Machines should have at least 2 CPUs and 4 GB of memory. If the instance is using SELinux, you need to [disable SELinux](/admin/networking/selinux) to install the gateway.

{% hint style="info" %}
If you are familiar with Terraform, and choose to set up a gateway in AWS, you can [automate gateway setup](https://github.com/strongdm/terraform-aws-sdm-gateway)!
{% endhint %}

7. Log in to the gateway instance. Then download the StrongDM binary:

{% tabs %}
{% tab title="US" %}

```sh
curl -J -O -L https://app.strongdm.com/releases/cli/linux
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
curl -J -O -L https://app.uk.strongdm.com/releases/cli/linux
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
curl -J -O -L https://app.eu.strongdm.com/releases/cli/linux
```

{% endtab %}
{% endtabs %}

1. Unzip the binary:

   ```sh
   unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
   ```
2. Run the installer:

{% tabs %}
{% tab title="US" %}

```sh
sudo ./sdm install --node
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

{% endtab %}
{% endtabs %}

The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, will fail to complete the installation.

{% hint style="info" %}
The `--node` flag indicates to the software that you are installing a gateway or relay rather than a client. The flags `--gateway` and `--relay` alias to `--node` as well. The token that you paste in the next step, not the install flag used here, will dictate whether the software installs in "relay mode" or as a gateway.
{% endhint %}

1. When you are prompted for the gateway token you created, paste it into the terminal. Press enter. For security purposes, the token does not display in the terminal.
2. Log in to the Admin UI and go to **Networking** > **Gateways**. The gateway you created appears online and healthy. You may need to hard refresh the page.
3. Confirm your gateway creation was successful by verifying that the LISTENADDR is accessible from the appropriate end user network, as in the following example.

```bash
telnet 10.0.50.17 5000
Trying 10.0.50.17...
Connected to 10.0.50.17
Escape character is '^]'
```

4. Repeat this process to create a second gateway if you wish.

{% hint style="info" %}
We recommend deploying gateways and relays in pairs for high availability.
{% endhint %}

### Relays

As with gateways, StrongDM uses relays to connect with network resources such as databases and servers. However, relays do not listen for client connections. They can be deployed behind your firewall when internal subnets do not allow ingress, and you are not able to expose ports publicly.

Relays create a reverse tunnel to form connections to the gateway. With this action, they preserve the egress-only nature of your firewall and allow your users to reach any configured resources in the network via their StrongDM [client](/users/client).

![](/files/Bo2Wt06GYdUJxSEpWrbp)

When clients connect to the StrongDM network, they request a list of available gateways. StrongDM determines the most suitable route and sends all connections through one or more of these gateways. From the point of view of a resource, such as a database or server, all traffic originates from any relay or gateway with access to the resource.

The relay component can be deployed as a native [Linux service](/admin/networking/gateways-and-relays/ecs-nodes), [Docker container](/admin/networking/gateways-and-relays/docker-nodes), or [Kubernetes container](/admin/networking/gateways-and-relays/kubernetes-nodes). For more, check the **Download & Install** page in the Admin UI.

Relay settings and configurations can be managed in the Admin UI from **Networking** > **Relays**. On the **Relays** page, you can add new relays and view the [status](#view-status) and details of existing relays.

#### Relay use cases

How do you know when to deploy a relay instead of a gateway? You may wish to use a relay if your organization has sensitive resources or if you want to isolate certain parts of the network in order to further protect them.

Relays are typically used if the organization has any of the following:

* Sensitive internal website resources (data science tools, CI/CD, internal repositories, and so forth)
* Sensitive databases with network compliance requirements
* Sensitive servers with network compliance requirements
* Segmented networks for Protected Health Information (PHI), Personally Identifiable Information (PII), or other sensitive data, with separate VPCs with additional compliance requirements

#### Add a relay

Add a relay to generate a relay token.

![](/files/O6k6qr7vkbT4IwM6z7bZ)

1. Log into the Admin UI.
2. Go to **Networking** > **Relays**.
3. Click the **Add relay** button.
4. In the modal that appears, you can rename the relay, or you can do it later.
5. Click **Create relay** and the relay token appears. ![](/files/zz9oZNeuxfclMSbJqUmz)
6. Copy the relay token and save it for use in a later step.
7. Set up a **64-bit** Linux instance to run the relay. Machines should have at least 2 CPUs and 4 GB of memory. If the instance is using SELinux you need to [disable SELinux](/admin/networking/selinux) to install the relay.
8. Log in to the relay instance and download the StrongDM binary:

{% tabs %}
{% tab title="US" %}

```sh
curl -J -O -L https://app.strongdm.com/releases/cli/linux
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
curl -J -O -L https://app.uk.strongdm.com/releases/cli/linux
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
curl -J -O -L https://app.eu.strongdm.com/releases/cli/linux
```

{% endtab %}
{% endtabs %}

9. Unzip it:

   ```sh
   unzip sdmcli_*_linux_amd64.zip
   ```
10. Run the installer:

{% tabs %}
{% tab title="US" %}

```sh
sudo ./sdm install --node
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, will fail to complete the installation.
{% endhint %}

12. When prompted for the relay token you created, paste it into the terminal and press enter. For security purposes you will not see the token on the screen.
13. Log in to the Admin UI and the relay you created should now appear as online, with a heartbeat. You may need to hard refresh the page.
14. Repeat this process to create a second relay if you wish. We recommend running them in pairs for high availability.
15. To allow access to and from resources and StrongDM, make sure that [relay egress requirements](#egress-requirements) are met.

{% hint style="info" %}
We recommend deploying gateways and relays in pairs for redundancy.
{% endhint %}

### Egress Requirements

Although relays do not allow ingress, both gateways and relays do have some egress requirements. Gateways and relays must be able to successfully send traffic to several destinations in order to function correctly. Specifically, they must meet the following minimal egress requirements:

{% tabs %}
{% tab title="US" %}

* `app.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
* Gateway(s) in your StrongDM organization
  {% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

* `app.uk.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.uk.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
* Gateway(s) in your StrongDM organization
  {% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

* `app.eu.strongdm.com:443` (which resolves to multiple IP addresses)
* `downloads.eu.strongdm.com:443` (which resolves to multiple IP addresses) for downloading updates
* Gateway(s) in your StrongDM organization
  {% endtab %}
  {% endtabs %}

For more information, please see the [Ports Guide](/admin/networking/ports-guide).

Additionally, if your organization requires outbound traffic from your infrastructure to pass through your own corporate proxy, you must set either or both of the `HTTP_PROXY`/`HTTPS_PROXY` environment variables (or the StrongDM-specific version). Please see the [Enviroment Variables](/admin/deployment/environment-variables) for a list of available environment variables for use with StrongDM.

### Gateway and Relay Management in the Admin UI

The **Gateways** and **Relays** pages of the Admin UI list the gateways and relays that have been configured for your organization. On these pages, you may search and filter on gateways and relays, view status, view the last heartbeat, and get more details about each node.

{% hint style="info" %}
Gateways and relays without a heartbeat for 30 days are automatically removed.
{% endhint %}

A list (in table format) of existing gateways or relays is displayed on the **Gateways** and **Relays** pages in the Admin UI. You can sort the table of gateways or relays in your organization by clicking on column headers. Clicking a column header sorts the table by the values in that column, in ascending order. Clicking again on the same header reverses the sorting direction.

#### Search filters

You can use search filters to search for specific gateways and relays and display them according to their name, status, listen address, or bind address.

To use filters, type or copy/paste the following filters into the **Search** field, with or without other text. Do not use quotes or tick marks.

| Filter                                        | Description                                                                          | Example search                                                                                         |
| --------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `bindaddr:<IP_ADDRESS>`                       | Shows gateways or relays with the specified bind address                             | `bindaddr:0.0.0.0:5000` finds gateways or relays that have a bind address of `0.0.0.0:5000`.           |
| `listenaddr:<IP_ADDRESS>`                     | Shows gateways or relays with the specified listen address                           | `listenaddr:10.0.0.021:5000` finds gateways or relays that have a listen address of `10.0.0.021:5000`. |
| `name:<PARTIAL_STRING>` or any free-form text | Shows gateways or relays with names that match the entered string; partial string OK | `name:keen-coffee` or `coffee` finds all gateways or relays whose names contain those characters.      |
| `status:<BOOLEAN>`                            | Shows gateways or relays that are online (`true`) or offline (`false`)               | `status:false` finds all offline gateways or relays.                                                   |

#### View status

In addition to the gateway or relay name and heartbeat, you can see its current status (for example, "online").

The possible statuses for gateways and relays are shown in the following table.

| Status                | Description                                                                                                                                                                                                                                                                | Node type      |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| **awaiting restart**  | Gateway or relay is waiting to enter a restart window to execute a planned restart                                                                                                                                                                                         | Gateway, relay |
| **dead**              | Gateway or relay is offline or not able to reach the StrongDM API                                                                                                                                                                                                          | Gateway, relay |
| **isolated**          | Relay cannot dial or successfully handshake an authentication with any gateways; isolated relays may successfully healthcheck resources, but their routes will be unavailable for use by users, as there is no way for the user to hop from a gateway to an isolated relay | Relay          |
| **new gateway**       | Gateway has been created but has not been started or has never accessed the StrongDM API                                                                                                                                                                                   | Gateway        |
| **new relay**         | Relay has been created but has not been started or has never accessed the StrongDM API                                                                                                                                                                                     | Relay          |
| **online**            | Gateway or relay is able to reach out to both the StrongDM API and at least one gateway and can serve client connections                                                                                                                                                   | Gateway, relay |
| **restarting**        | Gateway or relay has shut down for a planned restart                                                                                                                                                                                                                       | Gateway, relay |
| **verifying restart** | Gateway or relay has come online once and is awaiting coming back online after an initial restart                                                                                                                                                                          | Gateway, relay |

### Maintenance and Monitoring

There are several features that enable administrators to maintain and monitor the status of the gateways and relays in their organization.

#### Maintenance Windows

See the [Maintenance Windows](/admin/networking/maintenance-windows) for information about how to schedule a maintenance window for gateways and relays.

If a gateway or relay has been active (had a heartbeat at least once) and then remains completely inactive (no heartbeat) for 30 days, it is automatically removed from the StrongDM organization due to its inactivity.

#### Liveness Check

The StrongDM binary includes a configurable 'liveness' URL that you can use to verify that the relay/gateway is alive and functioning properly. To enable this URL:

* **Docker:** Add `-e SDM_ORCHESTRATOR_PROBES=:9090` to the invocation. **9090** is the default port; you can replace it with any port.
* **Kubernetes:** Liveness check is already enabled in the Kubernetes configuration.
* **Direct configuration:** Add the `SDM_ORCHESTRATOR_PROBES` environment variable when starting the relay/gateway process, setting it to `:9090` or whichever port you prefer.

Once configured, you can check `http://ip-of-relay:9090/liveness`, replacing `9090` with the port you configured in the environment variable. If it returns HTTP status 200, then the relay/gateway is in good health.

#### Relay/Gateway Capacity

The StrongDM binary is carefully designed to use a relatively constant amount of RAM, so its memory utilization should not change significantly through the process lifecycle. Because of this, StrongDM recommends watching the CPU load of the underlying machine to assess the need for additional capacity.

{% hint style="info" %}
When increasing gateway/relay capacity, you can either add a new gateway or relay or, if you are running in a virtual environment, simply add additional CPUs to the system.
{% endhint %}

**Load Average**

The StrongDM binary will use all available CPUs. If you note that more than 50% of your CPU cores are constantly saturated, then this is a good measure that it is time to scale up.

**CPU Time of sdm Process**

If you notice that the CPU time of the `sdm` process is increasing faster than real time (for instance, if it uses 30 hours of CPU time in 15 hours of real time) then this is another indication that it is time to scale up capacity.

**Throughput**

If a lower tier node instance is between clients and high traffic resources, it is possible that the limited transfer speeds or caps of the node will affect the speed of interactions, compared to direct connections from the client to the resource. If this is happening, it may be an indication that node infrastructure with greater throughput is necessary for your organization's nodes.

### Install Your Gateway or Relay

The first step to deploy StrongDM is to decide where to host your StrongDM gateways and relays. This is not a final decision; you can change them, or add additional gateways and relays at any time. Check out the following guides to learn how to install a node on various tech stacks:

{% content-ref url="/pages/EMZQ6PAti5dGs3kPLkkZ" %}
[Nodes in Docker Containers](/admin/networking/gateways-and-relays/docker-nodes)
{% endcontent-ref %}

{% content-ref url="/pages/FzqqhaWGsVcb89rI6sds" %}
[GCP Nodes](/admin/networking/gateways-and-relays/gcp-nodes)
{% endcontent-ref %}

{% content-ref url="/pages/TJFaWsTJoej1R9HNR2hk" %}
[Maintenance Windows](/admin/networking/maintenance-windows)
{% endcontent-ref %}

{% content-ref url="/pages/DLiqd4AQzA6wKFOwJzMO" %}
[Nomad Nodes](/admin/networking/gateways-and-relays/nomad-nodes)
{% endcontent-ref %}

{% content-ref url="/pages/V2j8JqGZJdTA4dnfH0FB" %}
[Uninstall Linux-Based Nodes](/admin/networking/gateways-and-relays/uninstall-nodes)
{% endcontent-ref %}


# Azure VM Nodes

### Overview

This guide describes how to create and configure a Microsoft Azure virtual machine (VM) to host a StrongDM node (gateway or relay), as well as how to create and install the node.

### Prerequisites

Ensure that you are an account administrator in StrongDM.

### Steps

#### Create an Azure VM

If you already have an Azure VM up and running, check that its properties match those described in this section and in [Configure Networking settings](#configure-networking-settings). Then proceed to [Add a node in StrongDM](#add-a-node-in-strongdm).

1. In Azure, go to **Home** > **Virtual Machines**, click **Create**, and then click **Virtual Machine**.
2. On the **Virtual Machine** page, underneath **Ubuntu Server**, click **Create**.
3. On the **Create a virtual machine** page that opens, set the following properties on the **Basics** tab:
   1. **Subscription:** Select your subscription type.
   2. **Resource group:** Select the appropriate resource group for your account.
   3. **Virtual machine name:** Give the VM a memorable name (for example, “strongdm-gw01”).
   4. **Region:** Select the appropriate region for the VM.
   5. **Availability options:** Choose your availability.
   6. **Security type:** Set as per your organization standard.
   7. **Image:** Make sure the selected image is still Ubuntu and the latest Gen available (for example, “Ubuntu Server 20.04 LTS”).
   8. **Azure Spot instance:** Optional
   9. **Size:** Choose the appropriate size for your needs.
   10. **Authentication type:**
   11. If you select **Password**, as we did for this example, also set the **Username** and **Password** for the VM.
   12. If you select **SSH public key**, also set the SSH public key source and Key pair name.
   13. **Public inbound ports:** Select **Allow selected ports**.
   14. **Select inbound ports:** Select **SSH (22)** to allow port 22.
4. Click **Next** to set the remaining properties on the **Disks** tab, **Networking** tab, **Management** tab, **Advanced** tab, and **Tags** tab. You can set all the standard options or whatever works for your organization.
5. On the **Review + create** tab, check that the VM’s properties are correct, take care of business, and click **Create**.

#### Configure Networking settings

{% hint style="info" %}
This step to set inbound port rules is only necessary if your VM is going to host a StrongDM gateway. If you are deploying a relay, please skip ahead to [Connect to the VM](#connect-to-the-vm).
{% endhint %}

1. Once your VM is deployed, click into its resource name to view its **Networking** area.
2. Go to **Inbound Port Rules**, click **Add inbound port rule**, and set the following:
   1. **Source:** Select **Any**.
   2. **Source port ranges:** Set **\***.
   3. **Destination:** Set **IP Addresses**.
   4. **Destination IP addresses/CIDR ranges:** Enter the public IP of the VM you just deployed with **/32** to specify the specific machine (for example, **10.0.0.021/32**). You can find the public IP address under **Networking**, where it is displayed at the top of the page.
   5. **Service:** Set **Custom**.
   6. **Destination port ranges:** Set **5000**.
   7. **Protocol:** Set **TCP**.
   8. **Action:** Set **Allow**.
   9. **Priority:** Enter **100** so it has the highest priority.
   10. **Name:** Change the name to **StrongDM**.
3. Click **Add** to save your changes.

#### Connect to the VM

Once your Azure VM is up and running, you should be able to connect to it.

1. Click into the name of your VM to get to its **Overview** blade.
2. Click **Connect** and then select your connection method. In this example, we selected SSH and went through the setup process to **connect via SSH with client**.

#### Add a Node in StrongDM

The following instructions are for creating a gateway and generating a token in the Admin UI. To do the same via the CLI instead of the Admin UI, see [sdm admin nodes create-gateway](/references/cli/admin/nodes/create-gateway).

To add a gateway, follow these steps.

1. Log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Gateways**.
3. Click **Add gateway**.
4. For **Name**, enter a memorable name (for example, “azure-vm”). This name will be displayed in the Admin UI. You can edit the name later.
5. For **Advertised Host**, enter the public IP address of your Azure VM (for example, “10.0.0.021”). The gateway will be listening on this address.
6. For **Advertised Port**, set the TCP port for the service to listen on (default: 5000). ![](/files/SMLEq3R0GOPwbm7PdQ44)
7. Click **Create gateway** to generate a token that you'll need later in the installation process. The token is only shown to you one time. Carefully copy the token and save it somewhere safe for later use. ![](/files/hvtlORvFZQaOIVELJKDV)

To add a relay, follow these steps.

1. Log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Relays**.
3. Click **Add relay**.
4. For **Name**, enter a name for the relay.
5. Click **Create relay**.
6. Copy the token and keep it in a secure place.

### Node Installation

1. Log in to the Azure VM you created to host your gateway or relay.
2. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.strongdm.com/releases/cli/linux
   ```
3. Unzip it (if this is a new server, you may need to install a package to unzip archives, such as with `sudo apt-get install unzip` on Ubuntu distributions):

   ```bash
   unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
   ```
4. Install the node:

{% tabs %}
{% tab title="US" %}

```sh
sudo ./sdm install --node
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

{% endtab %}
{% endtabs %}

```
You will be prompted for the token you generated when creating a gateway or relay; paste it in and hit Enter. Note that the token won't show in the terminal for security purposes, similar to the masking of a password.
```

{% hint style="info" %}
The installer must be run by a user who exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, may fail to complete the installation.
{% endhint %}

5. Log in to the StrongDM Admin UI. In **Networking** > **Gateways** or **Networking** > **Relays**, the node you created should appear to be online and have a heartbeat. If it doesn't appear online, perform a hard refresh of your browser. Within a couple of minutes, if it is still not online, verify that the StrongDM daemon is running by running `ps aux|grep sdm` on the server and looking for a line that says `sdm relay`.


# Nodes in Docker Containers

A node in your StrongDM network is either a gateway or a relay. You can find out more about them in the [Nodes](/admin/networking/gateways-and-relays) section of the documentation.

This guide describes how to do the following:

1. Create a standard gateway or relay in your Docker container.
2. Create a self-registering gateway or relay in your Docker container.

### Prerequisites

You can install your gateways or relays using either the [StrongDM Node Docker Image](#the-strongdm-relay-binary) or your existing Docker image; however, the configuration options in this guide assume you deployed, or will deploy, the StrongDM Node Docker Image.

Gateways and relays *must* be installed on "always up" Docker machines, as they form the connection to StrongDM for all users accessing the resources behind it. You may repurpose a preexisting machine (for example, bastion host), or in AWS parlance, any general purpose instance with 2 CPUs and 4 GBs memory. For example, the M3s or M4s are a good option.

{% hint style="warning" %}
When setting up Docker gateways or relays, it is recommended to run `sdm` as root to allow gateways or relays to upgrade themselves automatically. If gateways or relays do not update automatically, this may cause incompatibilities between versions, which may result in access interruptions for your end users.
{% endhint %}

### Gateway and Relay Differences

Because gateways are functionally different from relays, in that they listen for and accept incoming connections, it is important to note the following:

* If you configure a gateway, you must know the host address before you start because the relay token must be passed.
* If you create a relay token within StrongDM, you have to know the gateway address ahead of time. Once it is registered and you have the token, then you can pass the token into your Docker image.

Additionally, for self-registering gateways or relays, you must figure out which address a gateway or relay listens on. Once that is done, the gateway or relay registers itself with StrongDM, retrieves the token, and so forth.

### Standard Gateways and Relays

This section walks you through the process of setting up a gateway or relay using the StrongDM Node Docker Image.

1. Add your gateway/relay to the Admin UI and generate a token for it.
   1. Log into the Admin UI and select **Gateways** in the left navigation.
   2. Click the **Add gateway** button in the upper right, and a box will pop up.
   3. Name the gateway, set the advertised host, and set the port. The **Advertised host** should be the IP address or host that the gateway listens on. Select a **TCP port** (default **5000**) for the service to listen on.
   4. Click on **create** and the token appears onscreen.
   5. Copy the token and put it aside, being careful to capture every character. You will need it again below. See [sdm admin nodes create-gateway](/references/cli/admin/nodes/create-gateway) if you want to generate a token via the CLI.

{% hint style="info" %}
If you intend to create a relay instead of a gateway, click **Add relay**, fill in the name, and click **Create**.
{% endhint %}

2. Execute the Docker command `docker pull public.ecr.aws/strongdm/relay` to download the StrongDM Node Docker Image. Note that you may obtain the same link from the Admin UI's **Downloads & Install** page.
3. To activate your gateway/relay, type the following Docker command replacing \<YOUR\_TOKEN> with the actual token you created:

   ```shell
    docker run --restart=always [--net=host] --name sdm-relay -e SDM_RELAY_TOKEN=<YOUR_TOKEN> -p 5000:5000 -d public.ecr.aws/strongdm/relay
   ```

   The `net=host` option is only necessary if the destination database is known as `localhost` (if you are running sdm-relay colocated with the resource), otherwise the Docker default works. If the destination database is already in a container, we can provide a separate pattern for configuring Docker container linking.
4. Log in to the Admin UI. In that section, the gateway/relay you created appears **Online**, with a heartbeat.

### Self-Registering Gateways and Relays

This section describes how to create a self-registering gateway or relay. The process involves modifying the default StrongDM Node Docker Image to take an [admin token](/admin/principals/admin-tokens) that generates its own relay token with the purpose of registering itself to your StrongDM organization.

{% hint style="info" %}
Note that STDOUT logging is on by default in the StrongDM client Docker image. For more information, see `SDM_DOCKERIZED` in [Environment Variables](/admin/deployment/environment-variables).
{% endhint %}

#### Generate the token

You can generate an admin token that has only one function: to create relay tokens. To do this, follow these steps:

1. In the Admin UI, go to section **Principals** > **Tokens** and click **Add token**.
2. On the **Create Admin Token** page, under **Relays**, select the checkbox for **Create**.
3. Click the **Create** button at the bottom.
4. Copy the token that is generated, as you will need it later.

{% hint style="info" %}
For more detailed information on creating admin tokens, see [Admin Tokens](/admin/principals/admin-tokens).
{% endhint %}

#### Create the new Dockerfile

You can modify the default [StrongDM relay binary](https://gallery.ecr.aws/strongdm/relay), which is included in the StrongDM Node Docker Image, by creating and building a new Dockerfile. Use the following file to define your new Docker image. Save it as `autoreg.dock` in a directory on a system with Docker installed.

```docker
# Use the following command to build the Dockerfile.
# docker build -f autoreg.dock .
FROM public.ecr.aws/strongdm/relay:latest
ADD autoreg.sh /autoreg.sh
RUN chmod a+x /autoreg.sh
ENTRYPOINT ["/autoreg.sh"]
```

Note that this file references a shell script. Use the following file as `autoreg.sh`, which should be saved in the same directory as `autoreg.dock`.

```bash
#!/bin/bash
CMD=/sdm.linux
if [ -f /sdm/.sdmrc ]
then
	unset SDM_ADMIN_TOKEN
	# set the relay token env variable
	source /sdm/.sdmrc
else
	# necessary to suppress stdout during token create
	unset SDM_DOCKERIZED
	# generate fresh relay token (depends on inheriting SDM_ADMIN_TOKEN)
	SDM_RELAY_TOKEN=$($CMD relay create)
    export SDM_RELAY_TOKEN
	# retain the relay token
	echo "export SDM_RELAY_TOKEN=${SDM_RELAY_TOKEN}" >/sdm/.sdmrc
	# temporary auth state is created by invoking `relay create` and must be cleared out prior to relay startup
	rm /root/.sdm/*
	unset SDM_ADMIN_TOKEN
	export SDM_DOCKERIZED=true # reinstate stdout logging
fi
# --daemon arg automatically respawns child relay process during version upgrades or abnormal termination
$CMD relay --daemon
```

{% hint style="info" %}
It is important to understand why each command is in this script:

* First, unset `SDM_DOCKERIZED` to turn off STDOUT logging, so when you run `$CMD relay create` it is only outputting the token itself.
* Next, turn off admin authentication by removing the token in `SDM_ADMIN_TOKEN` and deleting the `.sdm` directory. Otherwise, when you run the relay, it attempts to authenticate with the admin token.
* Finally, turn on `SDM_DOCKERIZED` and run the relay command. The `--daemon` flag is needed to ensure the relay automatically restarts itself in case of upgrades or abnormal terminations.
  {% endhint %}

With `autoreg.dock` and `autoreg.sh` in place, run the following command to generate the Dockerfile, taking note of the output image name.

```bash
$ docker build -f autoreg.dock .
[+] Building 1.3s (8/8) FINISHED                                                                                                                                   docker:default => [internal] load build definition from autoreg.dock                                                                                                                       0.0s
=> => transferring dockerfile: 252B                                                                                                                                         0.0s
=> [internal] load metadata for public.ecr.aws/strongdm/relay:latest                                                                                                        0.6s
=> [internal] load .dockerignore                                                                                                                                            0.0s
=> => transferring context: 2B                                                                                                                                              0.0s
=> [internal] load build context                                                                                                                                            0.0s
=> => transferring context: 816B                                                                                                                                            0.0s
=> CACHED [1/3] FROM public.ecr.aws/strongdm/relay:latest@sha256:fa4604d08a6d633d13cf56721677c8157dc74ee1f90d5620da8163aa3bbed080                                           0.0s
=> [2/3] ADD autoreg.sh /autoreg.sh                                                                                                                                         0.1s
=> [3/3] RUN chmod a+x /autoreg.sh                                                                                                                                          0.4s
=> exporting to image                                                                                                                                                       0.1s
=> => exporting layers                                                                                                                                                      0.1s
=> => writing image sha256:1478948b3cd63707f1d0434b7adeb4ccabb64d7172078c39c4945ec9966a7097                                                                                 0.0s
```

#### Run the new Docker container

Similarly to creating a normal Docker node, you must invoke this Docker image with an environment variable. Replace **\<ADMIN\_TOKEN>** with the admin token you generated above, and with the ID of the Docker image you just generated.

```bash
docker run --restart=always [--net=host] --name sdm-relay -e SDM_ADMIN_TOKEN=<ADMIN_TOKEN> -d <ID>
```

{% hint style="info" %}
The `--net=host` option is only necessary if the destination database is known as localhost (running sdm-relay colocated with the DB). If you plan to use these instructions to generate arbitrary numbers of relays, be sure to account for this in the `--name` flag by removing it or generating a new name for each relay.
{% endhint %}

#### Verify your new node

Log into the Admin UI. In that section, the node you created should appear with the **online** status and a heartbeat.


# EC2 Nodes

### Overview

This guide explains how to install a StrongDM node (gateway or relay) on EC2. The StrongDM node works with any Linux distribution and any server with two CPUs and four GB of memory.

{% hint style="info" %}
There are also automated options for node setup.

* If you are comfortable with Terraform, and choose to set up a gateway in AWS, you can [automate gateway setup](https://github.com/strongdm/terraform-aws-sdm-gateway).
* Alternatively, if you prefer Docker, see our [Docker](/admin/networking/gateways-and-relays/docker-nodes) documentation.
  {% endhint %}

### Steps

1. Launch an EC2 instance: we recommend a t3.medium (2 vCPU, 4 GB RAM) with any Linux distribution. Modify the security group to allow your StrongDM clients to reach this server. By default this is port 5000 from all sources. This can also be a custom port from a private subnet depending on your network configuration.
2. Navigate to the StrongDM Admin UI.
3. ![](/files/SMLEq3R0GOPwbm7PdQ44)\
   Go to **Networking** > **Gateways** and click **Add gateway**, or go to **Networking** > **Relays** and click **Add relay**
4. For a gateway, for **Advertised Host**, enter the hostname or IP address from the EC2 instance. The hostname that you provide should be either the public IPv4 address or the external DNS hostname (which will resolve to the public IPv4 address). Additionally, for **Advertised Port**, enter the port that you left open for the gateway to interact with StrongDM clients (by default, `5000`).
5. For a relay, name the relay.
6. Click **Create gateway** or **Create relay**. This generates a token **that is shown to you one time** that you'll need to use later in the installation process. Carefully copy the token and save it somewhere for later use.
7. Log in to the EC2 instance you created to host your gateway or relay.
8. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.strongdm.com/releases/cli/linux
   ```
9. Unzip it (if this is a new server, you may need to install a package to unzip archives, such as with `sudo apt-get install unzip` on Ubuntu distributions):

   ```bash
   unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
   ```
10. Install the node:

{% tabs %}
{% tab title="US" %}

```sh
sudo ./sdm install --node
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

{% endtab %}
{% endtabs %}

```
You will be prompted for the token you created; paste it in and hit enter. Note that the token won't show in the terminal for security purposes, similar to the masking of a password.
```

{% hint style="info" %}
The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, may fail to complete the installation.
{% endhint %}

11. Switch back to the Admin UI **Gateways** or **Relays** page. The node you created should appear to be online and have a heartbeat. If it doesn't appear online, perform a hard refresh of your browser. Within a couple minutes, if it is still not online, verify that the StrongDM service is running by running `ps aux|grep sdm` on the server and looking for a line that says `sdm relay`.


# ECS Fargate Gateway Deployment Guide

### Overview

AWS Fargate, a serverless compute engine, is a popular option for deploying containerized infrastructure with Amazon Elastic Container Service (ECS). This guide provides step-by-step instructions on how to get StrongDM nodes (gateways and relays) up and running in Fargate.

Our instructions will show you how to set up your environment as shown.

![](/files/Me5AWXVW31DKbuoRh5le)

The diagram shows the following essential components needed to deploy a gateway as a Fargate task using ECS:

* Virtual Private Cloud (VPC) with internet gateway
* Private subnet routing traffic through a NAT gateway in a public subnet to connect to the internet
* Network Load Balancer (NLB) distributing incoming traffic from the internet to a Fargate task in the private subnet

{% hint style="info" %}
When deploying your Fargate task in a private subnet without internet access, you need to [set up a NAT gateway](https://aws.amazon.com/premiumsupport/knowledge-center/ecs-fargate-tasks-private-subnet/) that reaches out to the internet to acquire the StrongDM gateway image and connect to StrongDM.
{% endhint %}

### Steps

These instructions explain how to configure an NLB, task definition, cluster, task, and service in the EC2 Console, as well as how to generate a token from the StrongDM Admin UI. We recommend that you keep both the EC2 Console and the Admin UI open in your browser so you can easily tab between them.

{% hint style="info" %}
See these steps in action in our [ECS Fargate installation video tutorial](https://www.youtube.com/watch?v=UKjNvyKqmfA).
{% endhint %}

#### Create an NLB in the EC2 Console

{% hint style="info" %}
If you are deploying a relay instead of gateway, please skip this step and don't create an NLB. Unlike gateways, a relay does not bind to an interface and port, so relays don't need to be paired with a load balancer. Each relay must be defined by its own Fargate task, as the token is unique and cannot be active in more than one relay process.
{% endhint %}

{% hint style="info" %}
An Application Load Balancer (ALB) only works on the application layer. StrongDM requires support for the network layer and transport layer for gateways to work properly. Due to this requirement, an ALB should not be used with gateways. Instead, use a Network Load Balancer (NLB).
{% endhint %}

1. Go to the EC2 Console in AWS.
2. From the left-hand menu, expand **Load Balancing** and select **Load balancers**.
3. Click **Create Load balancer**, and under **Network Load Balancer**, click **Create**.
4. Set the **Basic configuration** properties:
   * **Load Balancer Name**: Enter a name for the load balancer.
   * **Scheme**: Select **Internet-facing**.
   * **IP address type**: Select **IPv4**. Note that an elastic IP is not required.
5. Set the **Network mapping**:
   * **VPC**: Select the VPC where this ECS gateway will be hosted.
   * **Mappings**: Select the availability zone where you want the load balancer to be hosted (that is, where the public subnet resides).
6. Set the **Listeners and routing** properties:
   * **Port:** Select TCP port **5000**. Note that 5000 is the default TCP port specified for SDM gateways, but you can modify it for your environment.
   * **Create target group**: Click the link, which opens a new tab.
7. On the **Specify group details** page that opens:
   * **Target type**: Select **IP Addresses** as the target group.
   * **Target group name**: Set the name of the target group.
   * **Port**: Set TCP port **5000** for the listener. This port needs to match the port you plan to expose on the Fargate container.
   * Click **Next**.
8. On the next page, leave the options blank and click **Create target group**. Note that a target will be set later once the ECS container is created.
9. Go back to the **Load Balancers** properties page, and click the refresh button next to **Target group**.
10. Select the target group that was just created.
11. Click **Create load balancer**.
12. Click **View load balancers**, and copy the **NLB DNS name** of the NLB that you just created.

#### Create a token in StrongDM

To create a gateway token, follow these steps.

1. Log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Gateways**.
3. Click **Add gateway**.
4. For **Name**, enter a name for the gateway.
5. For **Advertised Host**, enter the NLB DNS name that was created in the EC2 Console.
6. For **Advertised Port**, set **5000**.
7. Click **Create gateway**. The token appears in a modal. Copy the token and keep it in a secure place.

To create a relay token, follow these steps.

1. Log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Relays**.
3. Click **Add relay**.
4. For **Name**, enter a name for the relay.
5. Click **Create relay**. The token appears in a modal. Copy the token and keep it in a secure place.

#### Create an ECS task definition

1. In the AWS ECS Console, go to **Task Definitions** and create a new task definition.
2. Select **Fargate** as the launch type compatibility, and click **Next step**.
3. On the **Configure task and container definitions** page, set the following:
   * **Task Definition Name**: Enter a task name.
   * **Task Role**: Select **None**.
   * **Task memory (GB)**: Select **4GB**.
   * **Task CPU (vCPU)**: Select **2 vCPU**.
4. Under **Container Definitions**, click **Add container** and then set the following:
   * **Container name**: Enter a name for the container.
   * **Image**: Set `public.ecr.aws/strongdm/relay` as the image URL.
   * **Memory Limits (MiB)**: Set a **soft limit of 2048**.
   * **Port mappings**: Add a TCP port map to **5000**. This port needs to match the BIND port specified for the StrongDM token.
   * **Environmental Variables**: For **Key**, set `SDM_RELAY_TOKEN`. For **Value**, set the token value created in the Admin UI. Then click **Add**.
5. Back on the **Configure task and container definitions** page, scroll down and click **Create**.

#### Create an ECS cluster

1. In the ECS Console, go to the **Clusters** section and click **Create Cluster**.
2. Services are associated with an ECS cluster. On the **Select cluster template** page, select **Networking Only Powered by AWS Fargate**, and click **Next step**.
3. On the **Configure cluster** page, enter the **cluster name**, and click **Create**.
4. Click **View Cluster**, which will open the **Clusters Management** page.

#### Create a new ECS service

1. On the **Clusters Management** page, click your cluster name. On that page, click the **Services** tab and then click **Create**.
2. On the **Create Service** page that opens, set the following:
   * **Launch type**: Select **FARGATE**.
   * **Task Definition**: Select the task definition created earlier.
   * **Service name**: Enter a name for this service.
   * **Number of tasks**: Set **1**.
   * **Minimum healthy percent**: Set **0**.
   * **Maximum healthy percent**: Set **100**.
   * **Deployment type**: Set **Rolling update**.
   * Click **Next step**.
3. On the **Configure network** page, set the following:
   * **Cluster VPC:** Select the Fargate VPC where the cluster is hosted.
   * **Subnets:** Select a private subnet. Without this, the NLB will not be able to reach the container (for example, `10.0.7.0/24`).
4. For **Security Groups**, click **Edit** and do the following:
   * Click **Create a new security group**.
   * In **Basic details:**
     * **Security group name:** Name the group.
     * **Description:** Describe what the group is for.
     * **VPC:** Select the VPC.
   * Under **Inbound rules:**
     * **Type:** Choose **Custom TCP**.
     * **Port range:** Choose the port (for example, "5000") you are mapping from the load balancer to the service.
     * **Source**: Choose **Anywhere**. Please note: The load balancer is only open on the ports you forward, and the service is on a private network. You can, however, specify the IP address or range of the load balancer if you prefer. We recommend starting with an open security group for testing; you can modify it later.
     * Click **Create security group**.
   * **Auto-assign public IP:** Set to **DISABLED**.
   * **Load balancer type:** Select **Network Load Balancer**.
   * **Load balancer name:** Select the NLB that you created earlier.
   * Click **Add to load balancer**.
   * **Production listener port:** Select **5000 TCP**.
   * These steps also enable the **Health check grace period** field. Scroll up and enter a value of **600** (seconds), for a 10-minute grace period.
   * Click **Next step**.
5. On the **Set Auto Scaling** page:
   * Make sure that **Auto-scaling** is set to **Do not adjust the service’s desired count**.
   * Click **Next step**.
   * Click **Create Service**.
   * Click **View Service**.

#### Verify the node

Refresh the page to see that the ECS gateway or relay is online and running. It should take a couple of minutes for the IP address to show up in the target group associated with the NLB, after which the node should appear in the Admin UI with an active heartbeat.

In the Admin UI’s **Gateways** or **Relays** page, you’ll see that your ECS gateway or relay is **online**.

### Additional Information

#### Redundant gateways

We recommend deploying gateways in pairs for redundancy. Gateways automatically load balance and fail over when necessary. Because of this, gateways should not be behind the same load balancer.

Because each gateway requires a unique gateway token, a new Fargate task needs to be defined and associated with a new discovery service. Both services, however, can reside in the same ECS cluster.


# Explicit Routing

### Overview

This guide provides a general overview of an advanced feature that allows StrongDM administrators to define their organization’s network topology. Explicit routing enables an organization's nodes (gateways and relays) and resources to be segmented into explicitly declared groups called peering groups. Administrators can specify which nodes and resources are attached to peering groups and which peering groups peer with other peering groups.

When peering groups are used, the resource connection process is faster than usual because the flow of user traffic from the client to nodes to target resources is predetermined by the network administrator. When a user's client authenticates to StrongDM and requests to connect to a particular resource, that request is routed based on a calculation to the peering group in which the resource and node(s) are attached. Only the node(s) in the peering group check the user’s permission level, role(s), and access grants and initiate a connection to the target resource.

In contrast, when peering groups are not used, the path between the client and the target is fluid and unpredictable. Each node attempts to insert itself into the path to serve a resource, even when it may not be physically possible.

For organizations that have a high number of nodes and resources, using explicit routing can significantly improve how client traffic is routed to nodes and resources.

At this time, it is optional to use explicit routing.

This guide explains how to manage your network with peering groups. Currently, network management is done in the CLI, SDKs, and Terraform.

In this guide, you will learn how to do the following in the CLI and/or Terraform:

* Enable and disable peering groups (CLI only).
* View and change the current network mode.
* Create, delete, and view peering groups.
* Link peering groups together.
* Attach and detach nodes and resources to or from peering groups.
* View resource routing information.
* View the network topology.

### Prerequisites

To use this guide, you must be a StrongDM account administrator.

If using the SDKs or Terraform to manage the network, your API key must have the "Relays Create" and "Relays List" permissions.

Please see the StrongDM documentation for more information about [nodes](/admin/networking/gateways-and-relays) and [How StrongDM Works](/concepts/how-strongdm-works).

### Network

An organization's StrongDM network is made up of StrongDM clients, nodes, and resources. You can segment parts of your StrongDM network into peering groups.

A peering group is an explicitly declared group of nodes (gateways and relays), and/or resources. Grouping them as such allows a specific subset of gateways and relays to be used to access a specific subset of resources. If a network has more than one peering group, one group can peer with (be connected to) another with a link.

A link allows the target peering group to receive connections from the specified peering group. Links must be created manually from one peering group to the other peering group. They are not mutually linked. For example, if you link peering group B to peering group A, B peers with A, but A is not peered back to B. Unlinking two peering groups severs the connection between them and they no longer peer.

### Network Topology

A network topology is the physical and logical arrangement of nodes and links in a network. There are many types of network topologies. StrongDM expects an organization that is using explicit routing to arrange the network into segments that align with one of the following three topologies.

#### Topology 1

Topology 1 includes a single peering group, which has gateway(s) and resource(s) attached. The attached gateway receives client traffic and facilitates the connection to the attached resource(s).

```mermaid
graph LR; A((<b>Client</b>)); B(<b>Peering Group</b><br>Gateway 1<br>Gateway 2<br>Resource); A-->|traffic|B;
```

The peering group functions in an ingress capacity, meaning that clients can connect directly to its gateways. This group must contain at least one gateway, and it must contain at least one resource because as the only peering group in this topology, it also functions in an egress capacity (that is, it facilitates the connection to the resources).

#### Topology 2

Topology 2 includes two peering groups that are peered together using a link.

A link is an established connection between one specified peering group and another target peering group. Links are created manually. In the CLI, for example, a link is created by using a command and specifying the peering groups to connect: `sdm admin network link ingress-group egress-group`.

Once a link is created, the peering actually works in reverse; the peering group that is providing the egress functionality (that is, the access to resources) peers with, or connects to, the peering group that is providing ingress functionality (that is, the group that is connected to by the client). When groups are linked and peering occurs, traffic can then flow from the client to the resource unimpeded.

```mermaid
graph LR;
    A((<b>Client</b>));
    B(<b>Ingress Peering Group</b><br>Gateway 1<br>Gateway 2);
    C(<b>Egress Peering Group</b><br>Relay 1<br>Relay 2<br>Resource);
    A-->|traffic|B;
    B-->|traffic|C;
    C-. link .-> B;
```

There are several reasons why one might wish to separate ingress and egress into two separate groups. It can help with the isolation of resources to further protect them, and it can also allow segmented geographic networks to access a shared set of resources while using different network resources. For example, let's say you have a peering group with resources in it, but there are two different links set up from geographically disparate peering groups that allow incoming traffic. In this example situation, traffic can be more local to the user until it needs to be routed to the resources.

#### Topology 3

Topology 3 incorporates three peering groups that are peered together with links, as described in Topology 2. This arrangement, however, adds a third function to the link relationship: the bridge. The peering group that functions as a bridge sits between the ingress and egress peering groups, allowing for even further isolation and segmentation.

As with any other arrangement, links connect the peering groups together, and links are created manually. In the CLI, for example, links are created by using a command and specifying all three peering groups to connect: `sdm admin network link ingress-group bridge-group egress-group`.

The egress group peers with the bridge group, which then peers with the ingress group. Traffic is then allowed to flow in the reverse direction, from the client to the ingress group to the bridge group to the egress group, where the resources are attached.

```mermaid
graph LR;
    A((<b>Client</b>));
    B(<b>Ingress Peering Group</b><br>Gateway 1<br>Gateway 2);
    C(<b>Bridge Peering Group</b><br>Gateway 3<br>Gateway 4);
    D(<b>Egress Peering Group</b><br>Relay 1<br>Relay 2<br>Resource);
    A-->|traffic|B;
    B-->|traffic|C;
    C-->|traffic|D;
    C-. link .-> B;
    D-. link .-> C;
```

{% hint style="warning" %}
A peering group that provides user ingress cannot function in a bridge or egress capacity anywhere in the network. If a peering group initiates any peering itself, it is no longer eligible to accept client connections as an ingress peering group.
{% endhint %}

#### Possible linking errors

The links between peering groups must create a route for client traffic that doesn't loop around the network endlessly. Client traffic must be able to flow from the entry point of the network (a peering group that has attached gateways) to an exit (a peering group that has attached nodes and resources).

**Error message**

Any attempt to create a loop results in an error, as in the following example from the CLI:

```sh
$ sdm admin network create group-a
g-344cb0d865131f01
$ sdm admin network create group-b
g-0cbf0d9065131f05
$ sdm admin network create group-c
g-6cf058f865131f26
$ sdm admin network link group-a group-b
$ sdm admin network link group-b group-c
$ sdm admin network link group-a group-c
time="2023-09-26T11:13:29-07:00" level=error msg=[cli.Error] error="cannot link peering groups: aborted: loop detector blocked peering groups link: invalid operation: detected loop between g-6cf058f865131f26 and g-344cb0d865131f01"
cannot link peering groups: aborted: loop detector blocked peering groups link: invalid operation: detected loop between g-6cf058f865131f26 and g-344cb0d865131f01
```

#### Network segmentation example use cases

**Regions are completely segmented**

In this example, the network contains separate gateways, relays, resources, and peering groups for three distinct geographic regions. This topology is ideal because users are connected to resources within their region.

```mermaid
graph LR;
    A((<b>Client</b>));
    B(<b>US-W Ingress Peering Group</b><br>Gateway 1);
    C(<b>US-W Egress Peering Group</b><br>Relay 1<br>US-W Resource);
    A-->|US-W traffic|B;
    B-->|traffic|C;
    C-. link .-> B;

    D(<b>US-E Ingress Peering Group</b><br>Gateway 2);
    E(<b>US-E Egress Peering Group</b><br>Relay 2<br>US-E Resource);
    A-->|US-E traffic|D;
    D-->|traffic|E;
    E-. link .-> D;

    F(<b>EU-Central Ingress Peering Group</b><br>Gateway 3);
    G(<b>EU-Central Egress Peering Group</b><br>Relay 3<br>EU-Central Resource);
    A-->|EU-Central traffic|F;
    F-->|traffic|G;
    G-. link .-> F;
```

**All regions are served by one gateway**

In this example, the network contains an ingress peering group with an attached gateway, and three regional peering groups that have a matching regional resource attached. In this topology, the network is not completely segmented, but only one gateway is needed and client traffic can be routed to region-specific resources as intended.

```mermaid
graph RL;
    A(<b>Ingress Peering Group</b><br>Gateway);
    B(<b>US-W Egress Peering Group</b><br>Relay 1<br>US-W Resource);
    C(<b>US-E Egress Peering Group</b><br>Relay 2<br>US-E Resource);
    D(<b>EU-Central Egress Peering Group</b><br>Relay 3<br>EU-Central Resource);
    E((<b>Client</b>));
    B-. link .-> A;
    C-. link .-> A;
    D-. link .-> A;
    A---|all traffic|E
```

**All regions use the same gateway and resource**

In this example, the network contains an ingress peering group with an attached gateway, and three regional peering groups that all have the same resource attached. The network is not segmented, and the route system may choose an inefficient path for the client traffic.

###

```mermaid
graph RL;
    A(<b>Ingress Peering Group</b><br>Gateway);
    B(<b>US-W Egress Peering Group</b><br>Relay 1<br>Resource 1);
    C(<b>US-E Egress Peering Group</b><br>Relay 2<br>Resource 1);
    D(<b>EU-Central Egress Peering Group</b><br>Relay 3<br>Resource 1);
    E((<b>Client</b>));
    B-. link .-> A;
    C-. link .-> A;
    D-. link .-> A;
    A---E
```

### Enforcement Modes

The network can operate with or without peering groups enabled at all. When peering groups are not enabled, new peering groups and links cannot be created. Nodes will attempt to communicate with all available gateways and resources.

Peering groups can be enabled with one of three enforcement modes: permissive, exclusive, or strict.

#### Permissive mode

Permissive mode allows the network to operate with optional peering groups, for routing purposes only. In permissive mode, the link between nodes behaves as in off mode, where every node attempts to connect to every other node. Resources in a peering group are only routable from nodes in peering groups. Resources not in a peering group are routable from any reachable path, whether through nodes in peering groups or not.

The client receives and tries to connect to all gateways, regardless of their location or network availability.

If the user attempts to connect to a resource in a peering group, the user's client traffic is routed accordingly using the peering group(s) to which the resource is attached.

Furthermore, when permissive mode is enforced, any resources not in a peering group can be used as if peering groups are off. That means that if the user attempts to connect to a resource that is not in a peering group, the user's client traffic is routed using default route calculation logic. The flow of client traffic moves as if the network is working in off mode, where gateways listen for client connections, and they peer with every other available node in the network.

#### Exclusive mode

Exclusive mode is similar to permissive mode, in that it allows the network to operate with or without peering groups, but exclusive mode is more restrictive. In exclusive mode, the network operates with mutually exclusive peering group and non-peering group nodes and resources.

Resources in a peering group are only routable from nodes in the same peering group or in a linked peering group. Likewise, resources not in a peering group are only routable from nodes not in a peering group.

Nodes in a peering group do not communicate with nodes not in a peering group.

#### Strict mode

Strict mode forces the network to use explicit routing. Nodes only communicate with nodes in linked peering groups and resources in the same peering group.

{% hint style="warning" %}
In strict mode, nodes and resources not in a peering group are unreachable.
{% endhint %}

When strict mode is enforced, peering group nodes only connect to nodes in a linked peering group. For example, if group A is linked to group B, peering group nodes in group A only connect to peering group nodes in group B. Nodes that are not in a peering group don't connect to any peers.

Moreover, the client receives only the subset of gateways that can accept incoming client connections.

If the user attempts to connect to a resource in a peering group, the user's client traffic is routed accordingly using the peering group(s) to which the resource is attached. If the user attempts to connect to a resource that is not in a peering group, the user is unable to connect.

### Recommendations

If explicit routing is used, we generally recommend the following order of operations:

1. Learn whether the network has peering groups on or off.
2. If you wish to use peering groups, set the network to operate in permissive mode.
3. Create peering groups.
4. Attach nodes and resources to peering groups.
5. Create links between peering groups.
6. View your network topology to understand how you have set it up.
7. Manage peering groups and make changes as needed.

### Manage the Network with the CLI

You can manage and define your StrongDM network in the CLI with [sdm admin network](/references/cli/admin/network) and its subcommands:

* `sdm admin network enforce` sets the enforcement level (mode) for peering groups.
* `sdm admin network create` creates a new network peering group.
* `sdm admin network delete` deletes a network peering group and all its dependencies.
* `sdm admin network list` lists all network peering groups.
* `sdm admin network show` shows details of a network peering group.
* `sdm admin network attach` attaches a resource or a node to a peering group.
* `sdm admin network detach` detaches a resource or a node from a peering group.
* `sdm admin network link` creates a link between two peering groups by ensuring that the target group can receive connections from the specified group.
* `sdm admin network unlink` removes the link between two peering groups.
* `sdm admin network topology` draws the current network topology.
* `sdm admin network route` returns information about a route for a given resource.

#### View the network's enforcement level

When setting up your network, the first action to take is to find out if the network has peering groups on or off. If peering groups are on, you also need to know which mode is enforced.

Use the following command to view the current enforcement level:

```sh
sdm admin network enforce
```

In response, the current mode is shown. Possible responses and their meanings are as follows:

* `off`: Peering groups are disabled.
* `permissive`: Peering groups are enabled and the network is working in permissive mode.
* `exclusive`: Peering groups are enabled and the network is working in exclusive mode.
* `strict`: Peering groups are enabled and the network is working in strict mode.

#### Set enforcement level for peering groups

In the CLI, modes are set using the command `sdm admin network enforce` and the arguments `off`, `permissive`, `exclusive`, or `strict`. In response, the value set is shown.

Turn on peering groups and set permissive mode:

```sh
sdm admin network enforce permissive
```

Turn on peering groups and set exclusive mode:

```sh
sdm admin network enforce exclusive
```

Turn on peering groups and set strict mode:

```sh
sdm admin network enforce strict
```

Turn off peering groups:

```sh
sdm admin network enforce off
```

{% hint style="info" %}
If peering groups are configured and you wish to change the mode to "off," you must first delete the peering groups.
{% endhint %}

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#enforce).

#### Create a new network peering group

To create a new peering group, use the following command and enter a name for the peering group:

```sh
sdm admin network create <PEERING_GROUP_NAME>
```

Example:

```sh
sdm admin network create unique-peering-group
```

{% hint style="info" %}
When creating a peering group that will have resources in it, ensure that all nodes in that peering group can access the resources.
{% endhint %}

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#create).

#### Delete a network peering group and all its dependencies

Deletion of a peering group removes the peering group from the network, detaches all nodes and resources that are attached to it, and unlinks it from other peering groups.

To delete a peering group, use the following command and specify the name of the peering group to delete:

```sh
sdm admin network delete <PEERING_GROUP_NAME>
```

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#delete).

#### List all network peering groups

To get a list of all peering groups in the network, use the following command:

```sh
sdm admin network list
```

Example:

```sh
$ sdm admin network list
ID                     Name
g-1234a56b789012b1     bridge
g-2de3456f789011f2     egress
g-34c5678d910123aa     ingress
```

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#list).

#### Show details of a network peering group

Use the following command to view details of a specific peering group:

```sh
sdm admin network show <PEERING_GROUP_NAME>
```

Example:

```sh
$ sdm admin network show egress
g-2de3456f789011f2 egress

Resources               Name
rs-45abcde123456d3d     local example

Nodes                   Name
n-6d4f5e90650383c5      gw-12345

Peers With              Name
g-1234a56b789012b       bridge
```

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#show).

#### Attach a resource or a node to a peering group

To attach a resource or a node to a peering group, use the following command. Specify the name or ID of the peering group and the name or ID of the resource or node. Separate multiple nodes and resources with a space.

```sh
sdm admin network attach <GROUP_ID|GROUP_NAME> <RESOURCE_ID|RESOURCE_NAME|NODE_ID|NODE_NAME> [<RESOURCE_ID|RESOURCE_NAME|NODE_ID|NODE_NAME>...]
```

Example:

```sh
sdm admin network attach group1 rs-0000000000000000
```

If the node or resource name contains spaces, set the name within quotes, as in the following example:

```sh
sdm admin network attach group1 'mysql resource'
```

{% hint style="info" %}
When attaching resources to a peering group, ensure that all nodes in that group can access the resources in that peering group.

Explicit routing statically defines the network topology rather than relying on dynamic connectivity (healthchecks). In a valid configuration, all nodes in a peering group must have access to all resources in that peering group. Similarly, all nodes in a peering group must have network connectivity to all nodes in another peering group to which it is linked.
{% endhint %}

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#attach).

#### Detach a resource or a node from a peering group

To detach a resource or a node to a peering group, use the following command. Specify the name or ID of the peering group and the name or ID of the resource or node:

```sh
sdm admin network detach <GROUP_ID|GROUP_NAME> <RESOURCE_ID|RESOURCE_NAME|NODE_ID|NODE_NAME> [<RESOURCE_ID|RESOURCE_NAME|NODE_ID|NODE_NAME>...]
```

Example:

```sh
sdm admin network detach group1 rs-0000000000000000
```

If the node or resource name contains spaces, set the name within quotes, as in the following example:

```sh
sdm admin network detach group1 'mysql resource'
```

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#detach).

#### Link peering groups

Linking two peering groups enables the target peering group to receive connections from the specified peering group.

A peering group can peer to another peering group. To enable such peering, you must create a link from one peering group to the other peering group. They are not mutually linked. For example, if you link peering group B to peering group A, B peers with A, but A is not peered back to B.

Use the following command to create a link between two or three specified peering groups:

```sh
sdm admin network link <INGRESS_GROUP_ID_OR_NAME> [<BRIDGE_GROUP_ID_OR_NAME>] <EGRESS_GROUP_ID_OR_NAME>
```

Example:

```sh
sdm admin network link ingress-example egress-example
```

{% hint style="warning" %}
It is possible to create complex chains of links that will result in [errors](#possible-linking-errors) or undesirable behavior.

Example:

```sh
sdm admin network link group-a group-b
sdm admin network link group-b group-c
sdm admin network link group-a group-c
```

{% endhint %}

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#link).

#### Unlink peering groups

To remove the link between two or three peering groups, use the following command and specify the names of the peering groups to unlink:

```sh
sdm admin network unlink <INGRESS_GROUP_ID_OR_NAME> [<BRIDGE_GROUP_ID_OR_NAME>] <EGRESS_GROUP_ID_OR_NAME> 
```

Example:

```sh
sdm admin network unlink ingress-example egress-example
```

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#unlink).

#### View current network topology

Running `sdm admin network topology` causes a StrongDM network report to display in your web browser. The report provides a visual diagram of the peering group(s) in your network, if any, and the links between them. In addition, the report provides lists of the nodes and resources, with their ID or name, that are attached to peering groups. The network report can help you to visualize your network's components and understand the flow of traffic from the client to peering group(s) to resource(s).

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#topology).

#### View routing information for a resource

To view routing information for a specific resource, use the following command and specify the name or ID of the resource:

```sh
sdm admin network route <RESOURCE_ID_OR_NAME>
```

Example:

```sh
$ sdm admin network route 'local example'
local example (rs-45abeba065037d3d)
0:      0s      gw-11223 (n-1bd282a66504abcd) -> gw-12111 (n-3415a3136504abde) -> gw-20930 (n-55e70f2d6504ac01)
1:      0s      gw-11223 (n-1bd282a66504abcd) -> gw-12111 (n-3415a3136504abde) -> gw-28123 (n-1322f0416504abad)
```

{% hint style="info" %}
The `sdm admin network route` command doesn't take into account healthchecks when routing to a resource in a peering group.
{% endhint %}

See the CLI Reference for a copy of the help text available for [sdm admin network](/references/cli/admin/network#route).

#### CLI Example

This section provides an example of how to use all the `sdm admin network` CLI commands to define and manage peering groups, nodes, and resources in a StrongDM network.

```sh
# Create postgres resource
sdm admin resources add postgres pg-local --hostname sdmlocal --port 5432 --username user --password password --database database

# Create "relay1" relay
sdm admin nodes create --name relay1 

# Create "bridge1" gateway
sdm admin nodes create-gateway --name bridge1 sdmlocal:3333

# Create "gateway2" gateway
sdm admin nodes create-gateway --name gateway2 sdmlocal:4444

# View current network enforcement level
$ sdm admin network enforce
off

# Turn on peering groups
$ sdm admin network enforce permissive
permissive

# Create ingress peering group
sdm admin network create ingress-group

# Create bridge peering group
sdm admin network create bridge-group

# Create egress peering group
sdm admin network create egress-group

# Create links
sdm admin network link ingress-group bridge-group egress-group

# Attach resource to egress peering group
sdm admin network attach egress-group pg-local

# Attach "relay1" relay to egress peering group
sdm admin network attach egress-group relay1

# Attach "bridge1" gateway to bridge peering group
sdm admin network attach bridge-group bridge1

# Attach "gateway2" gateway to ingress peering group
sdm admin network attach ingress-group gateway2

# View network report
sdm admin network topology

# View routing information for resource
$ sdm admin network route pg-local
pg-local (rs-301d1f7e6511c672)
0:      0s      relay-1 (n-1bd282a66504abcd) -> bridge1 (n-3415a3136504abde) -> gateway2 (n-55e70f2d6504ac01)
```

### Manage the Network with Terraform

In addition to using the CLI, you may use Terraform to manage and define your StrongDM network. This section includes a Terraform example.

```tf
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "5.1.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
    # Add API access key and secret key from Admin UI
    api_access_key = "njjSn...5hM"
    api_secret_key = "ziG...="
}

# Create postgres resource
resource "sdm_resource" "local-pg" {
    postgres {
        name = "local-pg"
        hostname = "sdmlocal"
        port = "5432"
        username = "user"
        password = "password"
        database = "database"
    }
}

# Create "relay1" relay
resource "sdm_node" "relay1" {
    relay {
        name = "relay1"
    }
}

# Create "bridge1" gateway
resource "sdm_node" "bridge1" {
    gateway {
        name = "bridge1"
        listen_address = "sdmlocal:3333"
        bind_address = "0.0.0.0:3333"
    }
}

# Create "gateway2" gateway
resource "sdm_node" "gateway2" {
    gateway {
        name = "gateway2"
        listen_address = "sdmlocal:4444"
        bind_address = "0.0.0.0:4444"
    }
}

# Create ingress peering group
resource "sdm_peering_group" "ingress" {
    name = "ingress"
}

# Create bridge peering group
resource "sdm_peering_group" "bridge" {
    name = "bridge"
}

# Create egress peering group
resource "sdm_peering_group" "egress" {
    name = "egress"
}

# Create link from egress peering group to bridge peering group
resource "sdm_peering_group_peer" "egress_to_bridge" {
    group_id = "${sdm_peering_group.egress.id}"
    peers_with_group_id = "${sdm_peering_group.bridge.id}"
}

# Create link from bridge peering group to ingress peering group
resource "sdm_peering_group_peer" "bridge_to_ingress" {
    group_id = "${sdm_peering_group.bridge.id}"
    peers_with_group_id = "${sdm_peering_group.ingress.id}"
}

# Attach resource to egress peering group
resource "sdm_peering_group_resource" "pg_to_egress" {
    group_id = "${sdm_peering_group.egress.id}"
    resource_id = "${sdm_resource.local-pg.id}"
}

# Attach "relay1" relay to egress peering group
resource "sdm_peering_group_node" "relay1_to_egress" {
    group_id = "${sdm_peering_group.egress.id}"
    node_id = "${sdm_node.relay1.id}"
}

# Attach "bridge1" gateway to bridge peering group
resource "sdm_peering_group_node" "bridge1_to_bridge" {
    group_id = "${sdm_peering_group.bridge.id}"
    node_id = "${sdm_node.bridge1.id}"
}

# Attach "gateway2" gateway to ingress peering group
resource "sdm_peering_group_node" "gateway2_to_ingress" {
    group_id = "${sdm_peering_group.ingress.id}"
    node_id = "${sdm_node.gateway2.id}"
}
```

For additional information, see our [Terraform provider](https://registry.terraform.io/providers/strongdm/sdm/latest/docs) documentation.

### Manage the Network with the SDKs

To manage and define the StrongDM network with the StrongDM SDKs, please see the SDKs on GitHub:

* [Go](https://github.com/strongdm/strongdm-sdk-go)
* [Java](https://github.com/strongdm/strongdm-sdk-java)
* [Python](https://github.com/strongdm/strongdm-sdk-python)
* [Ruby](https://github.com/strongdm/strongdm-sdk-ruby)

#### API domain objects

This feature adds the following new [API Reference](/references/api#domain-objects), which are present in all of the SDKs.

{% hint style="info" %}
Each SDK also contains language-specific documentation of each object.
{% endhint %}

| Domain object         | Description                                                                            |
| --------------------- | -------------------------------------------------------------------------------------- |
| PeeringGroups         | Provides the building blocks necessary to obtain explicit network topology and routing |
| PeeringGroupPeers     | Provides the building blocks necessary to link two peering groups                      |
| PeeringGroupNodes     | Provides the building blocks necessary to attach a node to a peering group             |
| PeeringGroupResources | Provides the building blocks necessary to attach a resource to a peering group         |


# GCP Nodes

### Overview

This guide explains how to install a StrongDM node (gateway or relay) on a Google Cloud Platform (GCP) Compute Engine instance.

### Prerequisites

You must first create a Compute Engine instance, also known as a virtual machine (VM), in GCP. We recommend an e2-medium (two vCPU, four GB RAM) with any Linux distribution.

Most gateways need a public IP address. Modify the firewall for this instance to allow your users to reach this server. Typically, this will be public access to port 5000; however, you may choose any non-privileged port or limit ingress to a private subnet, depending on your network configuration. Relays, however, are not exposed to the public, and do not require any ports to be exposed.

### Steps

1. Log in to the [Admin UI](https://app.strongdm.com/app/admin).
2. If using a gateway, go to **Networking** > **Gateways** and click **Add gateway**. If using a relay, go to **Networking** > **Relays** and click **Add relay**.

![](/files/SMLEq3R0GOPwbm7PdQ44)

3. Give the gateway or relay a name.
4. For a gateway, define the advertised host for the server (for example, `sdm-gw0.yourcompany.com` or `111.222.333.444`). It must be an IP or hostname accessible to your StrongDM clients. Enter the port you left open for the gateway to interact with StrongDM clients (by default, `5000`).
5. Click **Create gateway** or **Create relay**. This generates a token that is only shown to you one time. You need this token in the installation process. Carefully copy the token and save it somewhere for later use.
6. Log in to the instance you created to host your node.
7. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.strongdm.com/releases/cli/linux
   ```
8. Unzip it (if this is a new server, you may need to install a package to unzip archives, such as with `sudo apt-get install unzip` on Ubuntu distributions):

   ```bash
   unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
   ```
9. Install the node:

```sh
sudo ./sdm install --node
```

*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

```
When you are prompted for the token you created earlier, paste it in and hit enter. Note that the token does not display in the terminal for security purposes, similar to the masking of a password.
```

{% hint style="info" %}
The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, may fail to complete the installation.
{% endhint %}

9. In the Admin UI, go to **Networking** > **Gateways** or **Networking** > **Relays** to check the status of your node.

The node you created should appear online, with a heartbeat. If it does not appear online, perform a hard refresh of your browser. If it is still not online in a few minutes, verify that the StrongDM service is running with the `ps aux|grep sdm` command on the server. Look for a line that includes `sdm relay`.


# Kubernetes Nodes

### Overview

This guide describes how to create a node (gateway or relay) in your Kubernetes cluster. You can follow the [manual approach](#create-a-node-manually) or optionally use the [Helm chart method](#create-a-node-with-helm) to install your node. If you're interested in using a proxy cluster rather than a gateway or relay, see the [Proxy Clusters in Kubernetes](/admin/networking/proxy-clusters/kubernetes-proxy-clusters) guide.

### Prerequisites

To be successful when using this guide, you must meet the following general requirements:

* Ensure that you are an Administrator in StrongDM.
* Be sure that your Kubernetes cluster(s) is at version 1.16 or later and has publicly accessible nodes and stable IPs.
* Install the [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) command-line tool locally to interact with your Kubernetes clusters.
* If you are using [Nginx Ingress Controller](https://kubernetes.github.io/ingress-nginx/), manually patch your services to [allow TCP and UDP traffic](https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/).
* If you are using Helm to manage your node, install Helm 3.0 or later locally.

### Manage Kubernetes Nodes With Helm

StrongDM has a Helm chart that can be used to create a node within your cluster, register it with your StrongDM organization, and then register the cluster itself as a resource in your StrongDM organization as well. All you need to do this is to have an [admin token](/admin/principals/admin-tokens) that gives you permission to create nodes and cluster resources.

1. Create a `values.yaml` file for use with the Helm chart. You can see a reference schema of the available options in the `sdm-relay` GitHub repository [values.yaml](https://github.com/strongdm/charts/blob/main/deployments/sdm-relay/values.yaml) file or on [ArtifactHub](https://artifacthub.io/packages/helm/strongdm/sdm-proxy) for further customization. The minimum values that must be specified in order to create the node, register it with your organization, and register the cluster as a resource are shown in the following example.

```yaml
strongdm:
  auth: # StrongDM authentication sources
    adminToken: "" # Specify an admin token to allow the chart to create and register your node
  autoCreateNode: # create/register the node in StrongDM, using the SDM_ADMIN_TOKEN
    enabled: true
  autoRegisterCluster: # register this cluster as a resource in StrongDM
    enabled: true
```

2. Install the Helm chart. Replace `<RELEASE_NAME>` with a unique and meaningful name.

   ```shell
   helm repo add strongdm https://helm.strongdm.com/stable/
   helm install <RELEASE_NAME> strongdm/sdm-relay -f values.yaml
   helm status <RELEASE_NAME>
   ```
3. If you wish, you can verify that the chart created the node, and that the node and resource were added to your StrongDM organization with the following methods:

   1. You can check that the node is running in your cluster with `kubectl get services`, which should output something similar to the following, with an `sdm-relay-service` running:

   ```shell
   NAME                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)           AGE
   kubernetes          ClusterIP   10.96.0.1       <none>        443/TCP           21h
   sdm-relay-service   NodePort    10.104.132.14   <none>        30001:30001/TCP   21h
   ```

   2. You can check that the node is added to StrongDM by looking in the Admin UI under **Networking** > **Gateways** or **Networking** > **Relays**, or by using the CLI (`sdm admin nodes list`). If you did not specify any settings for your node, it will be named something random, but the IP will match your cluster.
   3. You can check that the cluster is added to StrongDM as a resource by looking in the Admin UI under **Resources** > **Managed Resources**, or by using the CLI (`sdm admin clusters list`). If you did not specify any settings for your cluster resource, it will be named something based on your chosen `<RELEASE_NAME>`.

{% hint style="info" %}
Note that this example is creating a relay as the default, which assumes that your organization has one or more working gateways already, as relays are egress-only, meaning that they do not accept direct traffic from clients. You can alter this behavior by adding `gateway.enabled:true` to your chart, as shown in the GitHub repository [values.yaml](https://github.com/strongdm/charts/blob/main/deployments/sdm-relay/values.yaml) file or on [ArtifactHub](https://artifacthub.io/packages/helm/strongdm/sdm-proxy). You can also customize further in this configuration, such as naming the gateway or relay something specific or creating it with custom maintenance windows.
{% endhint %}

#### Upgrade the sdm-relay Helm chart

To upgrade the sdm-relay Helm chart, run the following command. For more, see the [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) command documentation.

```shell
helm upgrade <RELEASE_NAME> strongdm/sdm-relay
```

{% hint style="info" %}
The nodes will automatically keep themselves up to date without you needing to upgrade the Helm chart. You only need to upgrade if you want a feature that is only available in a newer version of the sdm-relay Helm chart.
{% endhint %}

#### Uninstall the sdm-relay Helm chart

You can uninstall the sdm-relay Helm chart by running the following command. This command removes all Kubernetes components associated with the release and deletes the release. For more, see the [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) reference documentation.

```shell
helm uninstall <RELEASE_NAME>
```

### Create a Node Manually

In some circumstances, you may wish to deploy a gateway or relay in a Kubernetes cluster without using Helm. You will need to create a gateway token or relay token in StrongDM, install your node and configure it in your cluster, and then verify that it is connected to StrongDM.

#### Create a token

To successfully set up your Kubernetes node, you must first create the gateway or relay in the Admin UI and generate a token for it.

**Create a gateway token**

To create a gateway token, follow these steps.

1. Log in to the Admin UI.
2. Go to **Networking** > **Gateways**.
3. Click **Add gateway**.
4. For **Name**, enter a name for the gateway.
5. For **Advertised Host**, enter the IP address or host that the gateway listens on.
6. For **Advertised Port**, set the port (default **5000**) for the service to listen on.
7. Click **Create gateway** and the gateway token appears in a modal.
8. Copy the token and keep it in a secure place.

To generate a gateway token via the CLI instead, see [sdm admin nodes create-gateway](/references/cli/admin/nodes/create-gateway).

On macOS, there is an additional step: encode the resulting token in Base64 using `echo -n [token-string] | base64`. PowerShell and Windows commands may differ. If you generated the token from the CLI, it may contain a trailing `\n` character, which you have to remove before passing it through `base64`.

{% hint style="info" %}
When using Helm to install the gateway or relay, check the [Helm chart configurations](#install-the-sdm-relay-helm-chart) for additional port information.
{% endhint %}

**Create a relay token**

To register the node and create a relay token, follow these steps.

1. Log in to the Admin UI.
2. Go to **Networking** > **Relays**.
3. Click **Add relay**.
4. For **Name**, enter a name for the relay.
5. Click **Create relay**.
6. Copy the token and keep it in a secure place.

To generate a relay token via the CLI instead, see [sdm admin nodes create](/references/cli/admin/nodes/create).

On macOS, there is an additional step: encode the resulting token in Base64 using `echo -n [token-string] | base64`. PowerShell and Windows commands may differ. If you generated the token from the CLI, it may contain a trailing `\n` character, which you have to remove before passing it through `base64`.

{% hint style="info" %}
When using Helm to install the gateway or relay, check the [Helm chart configurations](#install-the-sdm-relay-helm-chart) for additional port information.
{% endhint %}

#### Create your node

Once you have a valid token, you can continue with the steps in this section to manually create your Kubernetes gateway or relay.

1. Follow the steps to [create a token](#create-a-token).
2. Create the YAML manifest for your Kubernetes node. Use the following content, replacing `[token-in-base64]` with your Base64-encoded token.

   ```yaml
   kind: Secret
   apiVersion: v1
   metadata:
     name: sdm-relay-secret
   type: Opaque
   data:
     token: [token-in-base64]
   ---
   kind: Deployment
   apiVersion: apps/v1
   metadata:
     name: sdm-relay-deployment
     labels:
       app: sdm-relay
   spec:
     replicas: 1 # must always be 1.
     selector:
       matchLabels:
         app: sdm-relay
     template:
       metadata:
         labels:
           app: sdm-relay
       spec:
       # You may use node affinity to ensure that these containers are only
       # deployed to publicly visible nodes.
       # This doesn't work with fargate profiles
       #      affinity:
       #        nodeAffinity:
       #          requiredDuringSchedulingIgnoredDuringExecution:
       #            nodeSelectorTerms:
       #            - matchExpressions:
       #              - key: alpha.eksctl.io/nodegroup-name
       #                operator: In
       #                values:
       #                - ng-1
         containers:
         - name: sdm-relay
           image: public.ecr.aws/strongdm/relay:latest
           imagePullPolicy: Always
           env:
           - name: SDM_ORCHESTRATOR_PROBES
             value: ":9090"
           - name: SDM_RELAY_TOKEN
             valueFrom:
               secretKeyRef:
                 name: sdm-relay-secret
                 key: token
           livenessProbe:
             httpGet:
               path: /liveness
               port: 9090
             initialDelaySeconds: 25
             timeoutSeconds: 10
             periodSeconds: 15
             failureThreshold: 5
   ---
   ```

   If you are setting up a relay, that is the end of the config file. If you are setting up a gateway, you also need the next snippet added to your YAML manifest.

   ```yaml
   kind: Service
   apiVersion: v1
   metadata:
     name: sdm-relay-service
     labels:
       app: sdm-relay
   spec:
     type: "NodePort"
     selector:
       app: sdm-relay
     ports:
       - name: gateway
         # or relay
         port: 30001
         targetPort: 5000
         nodePort: 30001
         # You may use externalIPs as a way to get a stable IP configuration.
         # then map 80.11.12.10 to sdmrelay.mycompany.com
     externalIPs:
       - 34.220.97.45
   ```

{% hint style="info" %}
To ensure that the external IP address is persistent, you need to either use node affinity (in the **Deployment** section) or `externalIPs` in the **NodePort** section.
{% endhint %}

3. Create the deployment and activate your gateway. You may have to specify a directory for the YAML file.

   ```shell
   kubectl create -f name-of-gateway-file.yml
   ```
4. Verify the node is running. Your node appears in the list of running services.

   ```shell
   kubectl get services
   ```

   ```shell
   NAME                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)           AGE
   kubernetes          ClusterIP   10.96.0.1       <none>        443/TCP           21h
   sdm-relay-service   NodePort    10.104.132.14   <none>        30001:30001/TCP   21h
   ```

{% hint style="info" %}
Relay deployments are not listed under kubectl services.
{% endhint %}

5. Log in to the Admin UI. Go to **Networking** > **Gateways** (or **Networking** > **Relays**). The node you created appears online with a heartbeat. Click **Details** to view additional information.

   ![](/files/L3Sc7fXJXChiaxAtfwAP)


# Linux Nodes

### Overview

This guide describes how to install a StrongDM node (gateway or relay) on Linux.

### Steps

1. Log in to the [StrongDM Admin UI](https://app.strongdm.com/app/admin).
2. Go to **Networking** > **Gateways** and click **Add gateway**, or go to **Networking** > **Relays** and click **Add relay**.

![](/files/SMLEq3R0GOPwbm7PdQ44)

3. For **Name**, enter a display name for the gateway or relay.
4. For a gateway, for **Advertised Host**, define the advertised host for the server (for example, `sdm-gw0.yourcompany.com`, or `111.222.333.444`). It must be an IP or hostname accessible to your StrongDM clients. Additionally, for **Advertised Port**, enter the port that you left open for the gateway to interact with StrongDM clients (by default, `5000`).

If you change the advertised port, verify whether or not you also need to change the bind port. The bind port is set from the **Advanced** option upon [gateway creation](/admin/networking/gateways-and-relays#add-a-gateway).

1. Click **Create gateway** or **Create relay**. A token is generated **that is only shown to you one time** that you'll need to use later in the installation process. Carefully copy the token and save it somewhere for later use.
2. Log in to the server you created to host your node.
3. Download the StrongDM binary:

   ```bash
   curl -J -O -L https://app.strongdm.com/releases/cli/linux
   ```
4. Unzip it (if this is a new server, you may need to install a package to unzip archives, such as with `sudo apt-get install unzip` on Ubuntu distributions):

   ```bash
   unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
   ```
5. Install the node:

{% tabs %}
{% tab title="US" %}

```sh
sudo ./sdm install --node
```

{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.uk.strongdm.com --node
```

{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

```sh
sudo ./sdm install --app-domain app.eu.strongdm.com --node
```

{% endtab %}
{% endtabs %}

```
You will be prompted for the token you generated in the Admin UI; paste it in and hit enter. Note that the token won't show in the terminal for security purposes, similar to the masking of a password.
```

{% hint style="info" %}
The installer must be run by a user that exists in the `/etc/passwd` file. Any users remotely authenticated, such as with LDAP or an SSO service, may fail to complete the installation.
{% endhint %}

6. In the Admin UI, go back to **Networking** > **Gateways** or **Networking** > **Relays** to check the status of your node.

The node you created should appear to be online and have a heartbeat. If it doesn't appear online, perform a hard refresh of your browser. Within a couple of minutes, if it is still not online, verify that the StrongDM daemon is running by running `ps aux|grep sdm` on the server and looking for a line that says `sdm relay`.


# Nomad Nodes

### Overview

This guide describes how to create and run a StrongDM node (gateway or relay) on HashiCorp Nomad.

To learn more about gateways and relays in general, see [Nodes](/admin/networking/gateways-and-relays).

### Prerequisites

* Be an Administrator in StrongDM.
* Ensure that you have a running Nomad instance and are familiar with the Nomad CLI or Nomad Web UI.

### Steps

#### Add a node in the Admin UI

You can add either a gateway (allows ingress) or relay (egress connections only) using Nomad.

**Add a gateway**

To add a gateway, follow these steps.

1. Log in to the StrongDM Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Gateways** and click **Add gateway**.
3. For **Name**, enter a unique name for the gateway. This is the name that is displayed throughout StrongDM.
4. For **Advertised Host**, use the IP address or hostname of your Nomad server.
5. For **Advertised Port**, edit the port number if you want it to differ from the default 5000.
6. Click **Advanced** to set optional properties.
7. For **Bind IP**, optionally set the IP address for the gateway to listen on. You can use `0.0.0.0` for all interfaces.
8. For **Bind Port**, optionally set the port for the gateway to listen on (default: 5000).
9. Click **Create gateway** to save.
10. Copy the token that is generated. This token is used in later steps.

**Add a relay**

To add a relay, follow these steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Networking** > **Relays**.
3. Click **Add relay**.
4. For **Name**, enter a name for the relay.
5. Click **Create relay**.
6. Copy the token and keep it in a secure place.

#### Create the node on Nomad

You can choose one of two ways to create a StrongDM node on Nomad. You can use either the [Nomad CLI](#use-the-nomad-cli) or [Nomad Web UI](#use-the-nomad-web-ui).

**Use the Nomad CLI**

1. Use SSH to log in to your Nomad server.
2. Use a text editor to create a new file called `sdm-gateway.nomad.hcl`.
3. Copy the following example code and paste it into your file:

```hcl
variable "datacenters" {
  type = list(string)
  default = ["dc1"]
}

variable "sdm_relay_token" {
  type    = string
}

job "sdm" {
  datacenters = var.datacenters
  
  # Add namespace if using one
  # namespace = "default"
  
  # Add type specification
  type = "service"
  
  group "gateways" {
    count = 1
    
    network {
      port "gateway" {
        static = 5000
        to     = 5000
      }
    }
    
    # Add service registration
    service {
      name = "sdm-gateway"
      port = "gateway"
      provider = "nomad"
      tags = ["sdm"]
      check {
        type     = "tcp"
        port     = "gateway"
        interval = "30s"
        timeout  = "2s"
      }
    }
    
    task "server" {
      driver = "docker"
      
      config {
        image = "public.ecr.aws/strongdm/relay"
      }
      
      resources {
        cpu    = 2000 # MHz
        memory = 4096 # MB
      }
      
      # Add template for secrets management (optional)
      template {
        data = <<EOT
SDM_RELAY_TOKEN="${var.sdm_relay_token}"
EOT
        destination = "${NOMAD_SECRETS_DIR}/env.txt"
        env         = true
      }
      
      # Add restart policy
      restart {
        attempts = 3
        delay    = "30s"
        interval = "5m"
        mode     = "delay"
      }
    }
    
    # Add update strategy
    update {
      max_parallel = 1
      health_check = "checks"
      min_healthy_time = "10s"
      healthy_deadline = "5m"
      auto_revert = true
    }
  }
}
```

4. In your file, replace the `$datacenters` and `$SDM_RELAY_TOKEN` placeholders with the actual values. If you added a gateway in the Admin UI and changed the port to a port other than the default, change the port here too.
5. Save and close the file.
6. Create a new job:

   ```shell
   nomad job init sdm-gateway
   ```
7. Do a dry run to make sure there are no issues:

```shell
nomad job plan sdm-gateway
```

8. Start the job:

```shell
nomad job run sdm-gateway
```

**Use the Nomad Web UI**

1. Log in to the Nomad Web UI.
2. Go to the **Jobs** tab.
3. Click **Run Job**.
4. Copy the following example code:

```hcl
variable "datacenters" {
  type = list(string)
  default = ["dc1"]
}

variable "sdm_relay_token" {
  type    = string
}

job "sdm" {
  datacenters = var.datacenters
  
  # Add namespace if using one
  # namespace = "default"
  
  # Add type specification
  type = "service"
  
  group "gateways" {
    count = 1
    
    network {
      port "gateway" {
        static = 5000
        to     = 5000
      }
    }
    
    # Add service registration
    service {
      name = "sdm-gateway"
      port = "gateway"
      provider = "nomad"
      tags = ["sdm"]
      check {
        type     = "tcp"
        port     = "gateway"
        interval = "30s"
        timeout  = "2s"
      }
    }
    
    task "server" {
      driver = "docker"
      
      config {
        image = "public.ecr.aws/strongdm/relay"
      }
      
      resources {
        cpu    = 2000 # MHz
        memory = 4096 # MB
      }
      
      # Add template for secrets management (optional)
      template {
        data = <<EOT
SDM_RELAY_TOKEN="${var.sdm_relay_token}"
EOT
        destination = "${NOMAD_SECRETS_DIR}/env.txt"
        env         = true
      }
      
      # Add restart policy
      restart {
        attempts = 3
        delay    = "30s"
        interval = "5m"
        mode     = "delay"
      }
    }
    
    # Add update strategy
    update {
      max_parallel = 1
      health_check = "checks"
      min_healthy_time = "10s"
      healthy_deadline = "5m"
      auto_revert = true
    }
  }
}
```

5. In the **Job Definition** section, paste that example code.
6. Replace the `$datacenters` and `$SDM_RELAY_TOKEN` placeholders with the actual values. If you added a gateway in the Admin UI and changed the port to a port other than the default, change the port here too.
7. Click **Plan**.
8. Ensure no errors occurred.
9. Click **run**.

#### Verify that your node is online

In the Admin UI, go to **Networking** > **Gateways** or **Networking** > **Relays** to verify that the node you created is online.

If it does not appear online, perform a hard refresh of your web browser. Within a couple of minutes, if it is still not online, verify that the StrongDM daemon is running by running `ps aux|grep sdm` on the server and looking for `sdm relay` in the output.


# StrongDM Gateway AMI Installation Guide

### Overview

The StrongDM Gateway Amazon Machine Image (AMI) makes it easy to deploy nodes (gateways and relays) when launching Amazon EC2 instances. The AMI comes with the StrongDM package pre-installed. When you launch the EC2 instance using the correct token, the node registers in your StrongDM organization without you having to manually create it, and you are ready to connect to your resource.

This guide describes how to attach the StrongDM Gateway AMI to a new EC2 instance, set a StrongDM token, and enable the correct security settings in order to connect to EC2 through StrongDM.

{% hint style="info" %}
The AMI is provided as a courtesy. It is not maintained as regularly as the standard StrongDM gateway and relay packages. If you are unsure about whether to use a regular [Docker image](/admin/networking/gateways-and-relays/docker-nodes) or the AMI, we recommend using a Docker image.
{% endhint %}

### Prerequisites

Be an Administrator in StrongDM.

Decide whether you want to install a gateway or a relay. If installing a gateway, you need an admin token (`SDM_ADMIN_TOKEN`). If installing a relay, you need a relay token (`SDM_RELAY_TOKEN`).

{% hint style="info" %}
An admin token can be used on multiple machines and it is allowed to create relays and read the list of relays. A relay token can be used on only one machine, and it is only allowed to read.
{% endhint %}

### Steps

These instructions explain how to launch an EC2 instance and get a StrongDM token to configure your gateway. We recommend that you keep AWS and the StrongDM Admin UI open in separate browser tabs or windows, so you can easily switch between them.

#### Get a StrongDM token

If you are setting up a self-registering gateway, follow these steps.

1. In a new browser tab or window, log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Principals** > **Tokens**, and click **Add token**.
3. On the **Create Admin Token** page, for **Name**, enter a descriptive name (for example, “Gateway AMI Creator"), so you can remember what this token is for later.
4. Set the token's **Expiration** (1 week, 1 month, 1 year, or never).
5. Select the checkbox for **Relays**, and underneath that, select **List** and **Create**.
6. Click **Create gateway** to generate the `SDM_ADMIN_TOKEN` value.
7. **Copy** the admin token value and save it somewhere safe.

If you are setting up a relay, follow these steps.

1. In a new browser tab or window, log in to the Admin UI at [app.strongdm.com](https://app.strongdm.com).
2. Go to **Networking** > **Relays** and click **Add relay**.
3. Fill out the name of the relay and click **Create relay** to generate the `SDM_RELAY_TOKEN` value.
4. **Copy** the relay token value and save it somewhere safe.

#### Create a new EC2 instance

1. In AWS, go to the EC2 Dashboard and click **Launch instance**.
2. On the **Choose an Amazon Machine Image (AMI)** page, click **Community AMIs**.
3. Search for “StrongDM” and then choose the latest AMI available.
4. Click **Select** to attach the StrongDM Gateway AMI to your EC2 instance root device volume.
5. Choose your instance type and click **Next**.

{% hint style="info" %}
The AMI is based on Ubuntu and works on any instance type with two CPUs and four GB of memory. We recommend a t3.medium.
{% endhint %}

5. This step describes two different ways to configure user data. You can set it up with an admin token or relay token, or you can pull a password from a secrets store.

   To configure user data with an admin token or relay token, do the following:

   1. On the **Configure Instance Details** page, set all properties the way you want.
   2. Expand **Advanced Details** and configure **User data**:
   3. Select **As text**.
   4. In the **User data** box, enter the token variable and the token value in this specific format:

      If you are setting up a self-registering gateway, enter `SDM_ADMIN_TOKEN=<TOKEN>`.

      Example: `SDM_ADMIN_TOKEN=hU8sHfhdjgg6g43dgabba...7fdjjg.djs1stqjjdop90fjs946fmh`

      If you are setting up a relay, enter `SDM_RELAY_TOKEN=<TOKEN>`.

      Example: `SDM_RELAY_TOKEN=cU2sHfasj5g9g11dgambv...3fdjjg.lks1qiqjjdxy90fjs946fll`

{% hint style="info" %}
If using an admin token instead of relay token, you also have the option to set a custom listen address (the default is the AWS IP for the EC2 instance) and/or custom port (5000 by default). These can be added after the SDM\_ADMIN\_TOKEN variable by using the SDM\_RELAY\_PORT and SDM\_LISTEN\_ADDRESS variables, each separated by line breaks.
{% endhint %}

{% hint style="warning" %}
Only define the SDM environment variables in this section, in the indicated format. Any further customization or additions in the "User data" section could break the AMI installation.
{% endhint %}

To configure user data with a password from a secrets store (for example, AWS Secrets Manager) in your StrongDM Gateway AMI, you can structure your user data as follows:

````
  ```bash
  #!/usr/bin/bash

  # Do updates
  apt update -y
  
  # Install required helper apps
  apt install -y unzip awscli jq
  
  # Set the StrongDM admin token variable with key value from Secrets Manager
  # where <SECRET_ID> = ARN of the secret, <REGION> is your AWS region, and <SECRET_KEY> is the name of the key that stores the StrongDM admin token
  # Example:  aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:us-west-2:123456789012:secret:sdm/secrets-4hJMIj --region us-west-2 --query SecretString --output text| jq -r ".admintoken")
  
  ADMIN_TOKEN=$(aws secretsmanager get-secret-value --secret-id <SECRET_ID> --region <REGION> --query SecretString --output text | jq -r ".<SECRET_KEY>")
  
  # Set the StrongDM admin token variable in a way that systemctl can use it
  
  systemctl set-environment SDM_ADMIN_TOKEN="$ADMIN_TOKEN"
  
  # Restart the StrongDM gateway setup script (the script included with the StrongDM Gateway AMI)
  systemctl restart sdm-relay-setup
  
  # Unset the SDM_ADMIN_TOKEN in systemctl because sdm-proxy fails to start if it has this and SDM_RELAY_TOKEN
  systemctl unset-environment SDM_ADMIN_TOKEN
  
  # Enable and restart sdm-proxy
  systemctl enable sdm-proxy
  systemctl restart sdm-proxy
  ```
````

6\. Set up the instance the way you want on the **Add Storage** and **Add Tags** pages.

7\. On the **Configure Security Group** page, click **Add Rule** and set:

* **Type**: Custom TCP
* **Port Range**: 5000
* **Source**: Anywhere

{% hint style="info" %}
If you are setting up a gateway and you neglect the Configure Security Group step, clients are not able to connect.
{% endhint %}

8. At the bottom of the page, click **Review and Launch**.
9. On the **Review Instance Launch** page that opens, check that everything looks OK, and click **Launch**.
10. When prompted to select an existing key pair or create a new key pair, choose your key pair, check the acknowledgement box, and click **Launch Instances**.

#### Check launch status

It may take a few minutes to get your instance and gateway or relay up and running. You can check the instance’s launch status in both AWS and StrongDM.

**In AWS**

1. Check launch status by going to the **Instances** page.
2. Find the instance that you just launched. If it is up, it is shown in the **Running** state.

**In StrongDM**

If you set up a self-registering gateway:

1. Look at the **Networking** > **Gateways** page.
2. Because you gave the EC2 instance an admin token, the instance registers the StrongDM gateway when the instance comes online. You should now see a new gateway in this section. (If you do not, wait a few minutes and refresh the page.)
3. If you didn't enter a name for the new gateway, it may have been given a a less than obvious name (such as “stinky-fruit-123"). If you do not know which gateway is for EC2, you can compare the gateway’s **Listen Address** to the IP address in your EC2 instance. Once you identify the new gateway, you may want to rename it with a more descriptive name (for example, “aws-ec2-gateway”).
4. The gateway is live when its status shows that it is **online**.

If you set up a relay:

1. Look on the **Networking** > **Relays** page, which should now display your new relay.
2. It is normal for the status to be **offline** or **restarting** at first. When the state changes to **online**, your relay is ready.

Now that installation is complete, you can use StrongDM!


# Uninstall Linux-Based Nodes

### Overview

This article provides the general process of uninstalling Linux-based nodes (gateways or relays). If you need to remove the StrongDM gateway or relay software from your server and do not intend to destroy the server itself, follow the instructions provided.

### Steps

1. Log in to the server via a command-line interface.
2. Stop any and all StrongDM services with a command similar to the following:

```bash
sudo systemctl stop sdm-proxy sdm-worker sdm
```

3. Remove all StrongDM (`sdm`) files, including environment configuration files, service unit files, and binaries, as in the following example. We suggest running this command with `sudo` and using the `-f` (force) flag to ensure the files are entirely removed regardless of any potential permission issues.

```bash
sudo rm -f /etc/sysconfig/sdm* /etc/systemd/system/sdm*.service /usr/local/bin/sdm /opt/strongdm/bin/sdm
```

4. Reload the systemd configuration to ensure systemd acknowledges the services are gone:

```bash
sudo systemctl daemon-reload
```

5. Unset the `SDM_RELAY_TOKEN` and `SDM_ADMIN_TOKEN` environment variables:

```bash
unset SDM_RELAY_TOKEN
unset SDM_ADMIN_TOKEN
```

6. Although it may not be necessary in your specific situation, we suggest that you reboot the server, to be thorough.


# Maintenance Windows

This article describes how to set a maintenance window for nodes (gateways, relays, and proxy workers). Scheduling a maintenance window allows you to have some control over the hour of the day when node upgrades happen. If a custom maintenance window is not specified, the default window of 7:00 Coordinated Universal Time (UTC) daily applies.

All nodes have a maintenance window and follow a standard process for upgrades:

1. When a node is notified of a new version and it has no client connections, it updates itself immediately unless a [custom schedule using cron notation](#configure-weekly-schedules-remotely) has been set.
2. If a node does have client connections, however, it enters the state "Awaiting Restart" and updates as soon as client connections drop to zero. If that doesn't happen before the maintenance window is reached, the node terminates all connections, updates, and restarts with the new version. The default maintenance window is 7:00 UTC.

### How to Schedule Maintenance Windows

There are several ways to schedule maintenance windows. You can configure simple daily maintenance windows using an environment variable or in the YAML configuration for a container. You can also use options when starting a node via the CLI to set either a simple daily maintenance window, or a schedule(s) of cron-based weekly maintenance window(s).

The method you choose depends on your setup and what is easiest for you:

* [Configure weekly schedules remotely](#configure-weekly-schedules-remotely) using the `--maintenance-windows` option.
* [Configure a daily window with the CLI](#configure-a-daily-window-with-the-cli) using the `--maintenance-window-start` option.
* [Configure a daily window with an environment variable](#configure-a-daily-window-with-an-environment-variable) for standard Linux installations.
* [Configure a daily window for containers with YAML](#configure-a-daily-window-for-containers-with-yaml) to deploy your node with a container.

{% hint style="info" %}
To ensure high availability for your StrongDM network, we recommend that you set unique maintenance window values for your nodes. At minimum, if your nodes are deployed in pairs, the members of each pair should have different windows. This enables each node to restart at a different hour, maintaining availability for users to continue to connect to your resources.
{% endhint %}

#### Configure weekly schedules remotely

You may use [cron notation](https://crontab.guru) to configure routine node update window(s) to take place on a weekly basis. These schedules must be semicolon-separated. The first group listed will indicate the time window in which the node will cut off connections, restart, and update, no matter the load on the node. The other schedules listed will be windows in which the node will restart and update if it is currently serving no traffic and updates are available.

This command may be run remotely at the CLI using the ID of the node in question, and when the node updates, it will use the set schedule(s).

Because nodes are required to have at least one maintenance window available each week, the values for the `month` and `day_of_month` fields in the cron-formatted schedule will be rejected if not set to `*`. The notation should be in the following format:

```shell
sdm admin nodes update --maintenance-windows="<CRON_SCHEDULE>;<SECONDARY_CRON_SCHEDULES>" <GATEWAY_ID>
```

Example:

```shell
sdm admin nodes update --maintenance-windows="* 7 * * 0,6;* * * * *" n-56988fae64a73652
```

In this example (according to the first cron schedule) the node will forcibly restart and update (if updates are available) at 7:00 on Saturdays and Sundays. Optionally (according to the second schedule) if there are updates available any hour of any day of the week when the node is not under load, it will restart and update.

{% hint style="info" %}
If the cron schedule method is used to remotely set maintenance windows for a node and then one of the other methods is used to also configure a daily window directly on the node, the window set locally on the node will be ignored in favor of the cron schedule.
{% endhint %}

#### Configure a daily window with the CLI

To set an hour each day that the node will be available to restart and update, you can use the `--maintenance-window-start` option when starting or updating the node. Replace `<VALUE>` in the example with an integer representing the UTC hour (0-23) that you would like to set as your maintenance window:

```shell
sdm relay --maintenance-window-start <VALUE>
```

Example:

```shell
sdm relay --maintenance-window-start 15
```

In the example shown, the value is set to 15. If the node is not under load when a new version releases, it restarts and updates. If it is under load when a new version releases, the maintenance window starts at 15:00 UTC. At that time, the node starts terminating client connections, restarts, and updates.

#### Configure a daily window with an environment variable

If your node is installed on a Linux host, we recommend that you use the environment variable method to set a maintenance window:

1. Install your node using our default [Linux Installation Guide](/users/client/linux) instructions. Doing so installs a systemd .service unit file and an environment file.
2. Open the environment file for editing. The default location is `/etc/sysconfig/sdm-proxy` for nodes, or `/etc/sysconfig/sdm-worker` for proxy clusters.
3. Add a new line with the `SDM_MAINTENANCE_WINDOW_START` variable, formatted as an integer, representing the UTC hour (0-23) that you would like to set as your maintenance window:

   ```shell
   SDM_RELAY_TOKEN=[redacted]
   SDM_MAINTENANCE_WINDOW_START=15
   ```

{% hint style="warning" %}
Make sure not to edit the `SDM_RELAY_TOKEN` value in the environment file.
{% endhint %}

4. Save the file.
5. Run the following to pick up the update:

   ```shell
   systemctl daemon-reload
   ```
6. Restart the service. For gateways and relays:

   ```shell
   systemctl restart sdm-proxy
   ```

   For proxy clusters:

   ```shell
   systemctl restart sdm-worker
   ```

#### Configure a daily window for containers with YAML

If you are using YAML to deploy the StrongDM Gateway image in a container, you can set a maintenance window by using the `SDM_MAINTENANCE_WINDOW_START` environment variable formatted as an integer representing the UTC hour (0-23) that you would like to set as your maintenance window:

```yml
spec: null
containers:
  - name: sdm-relay
image: 'public.ecr.aws/strongdm/relay:latest'
imagePullPolicy: Always
environment:
  - SDM_RELAY_TOKEN=[redacted]
  - "SDM_ORCHESTRATOR_PROBES=:9090"
  - SDM_MAINTENANCE_WINDOW_START=15
```

In the example shown, the environment variable sets a maintenance window at 15 UTC.


# Ports Guide

To understand how the components of StrongDM work together, first look at the [How StrongDM Works](/concepts/how-strongdm-works) pages. This page details the network ports that need to be opened in order for the various components to successfully communicate.

All ports listed are TCP unless otherwise noted.

### Client

{% tabs %}
{% tab title="US" %}

| Destination            | Port     | Type    | Requirement | Description                                                                                                                         |
| ---------------------- | -------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| app.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate users and obtain information such as available resources and routing information |
| login.strongdm.com     | 443      | Egress  | Required    | Allows the client to determine which control plane to connect to during login                                                       |
| downloads.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                     |
| checkip.amazonaws.com  | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as for connection troubleshooting                                             |
| 1.1.1.1                | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                   |
| Gateway                | Custom   | Egress  | Required    | Clients egress to gateways (default 5000)                                                                                           |
| Client (loopback)      | 65220    | Ingress | Required    | Required for the CLI to be able to report on state/status                                                                           |
| Client (loopback)      | 65230    | Ingress | Required    | Required to allow proxy traffic for web resources                                                                                   |
| Client (loopback)      | Custom   | Ingress | Required    | Configured inbound [port override](/admin/resources/port-overrides) for each resource to which the client has access                |
| {% endtab %}           |          |         |             |                                                                                                                                     |

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type    | Requirement | Description                                                                                                                         |
| ------------------------- | -------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| app.uk.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate users and obtain information such as available resources and routing information |
| login.strongdm.com        | 443      | Egress  | Required    | Allows the client to determine which control plane to connect to during login                                                       |
| downloads.uk.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                     |
| checkip.amazonaws.com     | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as for connection troubleshooting                                             |
| 1.1.1.1                   | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                   |
| Gateway                   | Custom   | Egress  | Required    | Clients egress to gateways (default 5000)                                                                                           |
| Client (loopback)         | 65220    | Ingress | Required    | Required for the CLI to be able to report on state/status                                                                           |
| Client (loopback)         | 65230    | Ingress | Required    | Required to allow proxy traffic for web resources                                                                                   |
| Client (loopback)         | Custom   | Ingress | Required    | Configured inbound [port override](/admin/resources/port-overrides) for each resource to which the client has access                |
| {% endtab %}              |          |         |             |                                                                                                                                     |

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type    | Requirement | Description                                                                                                                         |
| ------------------------- | -------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| app.eu.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate users and obtain information such as available resources and routing information |
| login.strongdm.com        | 443      | Egress  | Required    | Allows the client to determine which control plane to connect to during login                                                       |
| downloads.eu.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                     |
| checkip.amazonaws.com     | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as for connection troubleshooting                                             |
| 1.1.1.1                   | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                   |
| Gateway                   | Custom   | Egress  | Required    | Clients egress to gateways (default 5000)                                                                                           |
| Client (loopback)         | 65220    | Ingress | Required    | Required for the CLI to be able to report on state/status                                                                           |
| Client (loopback)         | 65230    | Ingress | Required    | Required to allow proxy traffic for web resources                                                                                   |
| Client (loopback)         | Custom   | Ingress | Required    | Configured inbound [port override](/admin/resources/port-overrides) for each resource to which the client has access                |
| {% endtab %}              |          |         |             |                                                                                                                                     |
| {% endtabs %}             |          |         |             |                                                                                                                                     |

### Relays and Workers

Relays and proxy workers in a bridged proxy cluster only need to have egress traffic.

{% tabs %}
{% tab title="US" %}

| Destination            | Port     | Type   | Requirement | Description                                                                                                                                    |
| ---------------------- | -------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.strongdm.com       | 443      | Egress | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.strongdm.com | 443      | Egress | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com  | 443      | Egress | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                | 53 (UDP) | Egress | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                | Custom   | Egress | Required    | Egress to gateways in order to securely establish connections through which to allow traffic (default 5000)                                    |
| Resource               | Custom   | Egress | Required    | Egress to resources                                                                                                                            |
| Secret Stores          | Custom   | Egress | Required    | May reach out to the configured secret store (if any) and acquire credentials to connect to the target resource                                |
| {% endtab %}           |          |        |             |                                                                                                                                                |

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type   | Requirement | Description                                                                                                                                    |
| ------------------------- | -------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.uk.strongdm.com       | 443      | Egress | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.uk.strongdm.com | 443      | Egress | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com     | 443      | Egress | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                   | 53 (UDP) | Egress | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                   | Custom   | Egress | Required    | Egress to gateways in order to securely establish connections through which to allow traffic (default 5000)                                    |
| Resource                  | Custom   | Egress | Required    | Egress to resources                                                                                                                            |
| Secret Stores             | Custom   | Egress | Required    | May reach out to the configured secret store (if any) and acquire credentials to connect to the target resource                                |
| {% endtab %}              |          |        |             |                                                                                                                                                |

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type   | Requirement | Description                                                                                                                                    |
| ------------------------- | -------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.eu.strongdm.com       | 443      | Egress | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.eu.strongdm.com | 443      | Egress | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com     | 443      | Egress | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                   | 53 (UDP) | Egress | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                   | Custom   | Egress | Required    | Egress to gateways in order to securely establish connections through which to allow traffic (default 5000)                                    |
| Resource                  | Custom   | Egress | Required    | Egress to resources                                                                                                                            |
| Secret Stores             | Custom   | Egress | Required    | May reach out to the configured secret store (if any) and acquire credentials to connect to the target resource                                |
| {% endtab %}              |          |        |             |                                                                                                                                                |
| {% endtabs %}             |          |        |             |                                                                                                                                                |

### Gateways and Workers

Gateways, bridge workers in a bridged proxy cluster, or proxy clusters in a single-worker cluster (no bridge or load balancer) have a small amount of ingress required.

{% tabs %}
{% tab title="US" %}

| Destination            | Port     | Type    | Requirement | Description                                                                                                                                    |
| ---------------------- | -------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com  | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                | Custom   | Egress  | Required    | Egress to other gateways dependent upon your network topology (default 5000)                                                                   |
| Resource               | Custom   | Egress  | Required    | Egress to resources                                                                                                                            |
| Secret Stores          | Custom   | Egress  | Required    | May reach out to the appropriate secret store (if any) and acquire credentials to connect to the target resource                               |
| Advertised Port        | Custom   | Ingress | Required    | Ingress allowed from clients, gateways, and relays (default 5000)                                                                              |
| {% endtab %}           |          |         |             |                                                                                                                                                |

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type    | Requirement | Description                                                                                                                                    |
| ------------------------- | -------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.uk.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.uk.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com     | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                   | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                   | Custom   | Egress  | Required    | Egress to other gateways dependent upon your network topology (default 5000)                                                                   |
| Resource                  | Custom   | Egress  | Required    | Egress to resources                                                                                                                            |
| Secret Stores             | Custom   | Egress  | Required    | May reach out to the appropriate secret store (if any) and acquire credentials to connect to the target resource                               |
| Advertised Port           | Custom   | Ingress | Required    | Ingress allowed from clients, gateways, and relays (default 5000)                                                                              |
| {% endtab %}              |          |         |             |                                                                                                                                                |

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination               | Port     | Type    | Requirement | Description                                                                                                                                    |
| ------------------------- | -------- | ------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| app.eu.strongdm.com       | 443      | Egress  | Required    | Allows communication with StrongDM to authenticate and obtain information such as routing information and credential information for resources |
| downloads.eu.strongdm.com | 443      | Egress  | Required    | Allows updates to the software to be downloaded                                                                                                |
| checkip.amazonaws.com     | 443      | Egress  | Optional    | Allows information to be derived from public IP, such as the Admin UI "Location" field for gateways/relays                                     |
| 1.1.1.1                   | 53 (UDP) | Egress  | Optional    | Cloudflare fallback for DNS resolution of StrongDM endpoints if default DNS fails                                                              |
| Gateway                   | Custom   | Egress  | Required    | Egress to other gateways dependent upon your network topology (default 5000)                                                                   |
| Resource                  | Custom   | Egress  | Required    | Egress to resources                                                                                                                            |
| Secret Stores             | Custom   | Egress  | Required    | May reach out to the appropriate secret store (if any) and acquire credentials to connect to the target resource                               |
| Advertised Port           | Custom   | Ingress | Required    | Ingress allowed from clients, gateways, and relays (default 5000)                                                                              |
| {% endtab %}              |          |         |             |                                                                                                                                                |
| {% endtabs %}             |          |         |             |                                                                                                                                                |

### Scripts That Use the API

{% tabs %}
{% tab title="US" %}

| Destination      | Port | Type   | Requirement | Description                        |
| ---------------- | ---- | ------ | ----------- | ---------------------------------- |
| app.strongdm.com | 443  | Egress | Required    | Required for calling API endpoints |
| {% endtab %}     |      |        |             |                                    |

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination         | Port | Type   | Requirement | Description                        |
| ------------------- | ---- | ------ | ----------- | ---------------------------------- |
| app.uk.strongdm.com | 443  | Egress | Required    | Required for calling API endpoints |
| {% endtab %}        |      |        |             |                                    |

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination         | Port | Type   | Requirement | Description                        |
| ------------------- | ---- | ------ | ----------- | ---------------------------------- |
| app.eu.strongdm.com | 443  | Egress | Required    | Required for calling API endpoints |
| {% endtab %}        |      |        |             |                                    |
| {% endtabs %}       |      |        |             |                                    |

### Active Directory Domain Controllers for RDP Certificate Auth

{% tabs %}
{% tab title="US" %}

| Destination      | Port | Type   | Requirement | Description                                                                                      |
| ---------------- | ---- | ------ | ----------- | ------------------------------------------------------------------------------------------------ |
| app.strongdm.com | 443  | Egress | Required    | Allows communication with StrongDM to obtain information such as the Certificate Revocation List |
| {% endtab %}     |      |        |             |                                                                                                  |

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination         | Port | Type   | Requirement | Description                                                                                      |
| ------------------- | ---- | ------ | ----------- | ------------------------------------------------------------------------------------------------ |
| app.uk.strongdm.com | 443  | Egress | Required    | Allows communication with StrongDM to obtain information such as the Certificate Revocation List |
| {% endtab %}        |      |        |             |                                                                                                  |

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

| Destination         | Port | Type   | Requirement | Description                                                                                      |
| ------------------- | ---- | ------ | ----------- | ------------------------------------------------------------------------------------------------ |
| app.eu.strongdm.com | 443  | Egress | Required    | Allows communication with StrongDM to obtain information such as the Certificate Revocation List |
| {% endtab %}        |      |        |             |                                                                                                  |
| {% endtabs %}       |      |        |             |                                                                                                  |


# Metrics

You can enable metrics on StrongDM nodes (gateways, relays, or proxy workers) in order to assist with monitoring and observability. When visualized on monitoring dashboards and mapped to alerts, metrics provide valuable insights into the status of nodes, including connection failures, disconnects, availability, and so forth. Monitoring nodes can help you to preemptively address and understand problems as soon as they arise.

This guide defines node metrics, describes common terminology related to such metrics, and provides a configuration example for enabling Prometheus-formatted metrics on a node.

After configuration is complete, you can request metrics from the node on the specified port. The `/metrics` endpoint can be reached at:

```http
http://127.0.0.1:9999/metrics
```

### Terminology

Common terminology related to node metrics is described in the following table.

| Term   | Description                                                                                                                                                                                                                                                                       |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Chunk  | A data blob representing a portion of a long-running SSH, RDP, or Kubernetes interactive session recording.                                                                                                                                                                       |
| Egress | The act of a node making an outbound network connection (called an egress connection) directly to a target resource outside the StrongDM relay network. Of the many relay hops that may make up a route from client to resource, only the last hop creates the egress connection. |
| Link   | A secure network connection between a node and a client, relay, or other node. There is generally only one link between any two entities. A link serves as a tunnel through which streams can flow.                                                                               |
| Query  | A single client request to a resource, such as a SQL query. Long-running SSH, RDP, or Kubernetes interactive sessions count as queries.                                                                                                                                           |
| Stream | A single logical network connection between a client and a resource. One stream can be tunneled through multiple links across multiple nodes. One link can contain multiple streams. There can be multiple simultaneous streams between a client and a resource.                  |

### Metrics

Node metrics are described in the following table.

| Metric name                                     | Metric type | Description                                                                                   | Label(s)                                                                                                                                                                                                                                         |
| ----------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| go\_gc\_duration\_seconds                       | Summary     | Summary of the pause duration of garbage collection cycles                                    |                                                                                                                                                                                                                                                  |
| go\_goroutines                                  | Gauge       | Number of goroutines that currently exist                                                     |                                                                                                                                                                                                                                                  |
| go\_info                                        | Gauge       | Information about the Go environment                                                          |                                                                                                                                                                                                                                                  |
| go\_memstats\_alloc\_bytes                      | Gauge       | Number of bytes allocated and still in use                                                    |                                                                                                                                                                                                                                                  |
| go\_memstats\_alloc\_bytes\_total               | Counter     | Total number of bytes allocated even if freed                                                 |                                                                                                                                                                                                                                                  |
| go\_memstats\_buck\_hash\_sys\_bytes            | Gauge       | Number of bytes used by the profiling bucket hash table                                       |                                                                                                                                                                                                                                                  |
| go\_memstats\_frees\_total                      | Counter     | Total number of frees                                                                         |                                                                                                                                                                                                                                                  |
| go\_memstats\_gc\_sys\_bytes                    | Gauge       | Number of bytes used for garbage collection system metadata                                   |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_alloc\_bytes                | Gauge       | Number of heap bytes allocated and still in use                                               |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_idle\_bytes                 | Gauge       | Number of heap bytes waiting to be used                                                       |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_inuse\_bytes                | Gauge       | Number of heap bytes that are in use                                                          |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_objects                     | Gauge       | Number of allocated objects                                                                   |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_released\_bytes             | Gauge       | Number of heap bytes released to OS                                                           |                                                                                                                                                                                                                                                  |
| go\_memstats\_heap\_sys\_bytes                  | Gauge       | Number of heap bytes obtained from the system                                                 |                                                                                                                                                                                                                                                  |
| go\_memstats\_last\_gc\_time\_seconds           | Gauge       | Number of seconds since 00:00:00 UTC on January 1, 1970 of the last garbage collection        |                                                                                                                                                                                                                                                  |
| go\_memstats\_lookups\_total                    | Counter     | Total number of pointer lookups                                                               |                                                                                                                                                                                                                                                  |
| go\_memstats\_mallocs\_total                    | Counter     | Total number of mallocs                                                                       |                                                                                                                                                                                                                                                  |
| go\_memstats\_mcache\_inuse\_bytes              | Gauge       | Number of bytes in use by mcache structures                                                   |                                                                                                                                                                                                                                                  |
| go\_memstats\_mcache\_sys\_bytes                | Gauge       | Number of bytes used for mcache structures obtained from the system                           |                                                                                                                                                                                                                                                  |
| go\_memstats\_mspan\_inuse\_bytes               | Gauge       | Number of bytes in use by mspan structures                                                    |                                                                                                                                                                                                                                                  |
| go\_memstats\_mspan\_sys\_bytes                 | Gauge       | Number of bytes used for mspan structures obtained from the system                            |                                                                                                                                                                                                                                                  |
| go\_memstats\_next\_gc\_bytes                   | Gauge       | Number of heap bytes when next garbage collection will take place                             |                                                                                                                                                                                                                                                  |
| go\_memstats\_other\_sys\_bytes                 | Gauge       | Number of bytes used for other system allocations                                             |                                                                                                                                                                                                                                                  |
| go\_memstats\_stack\_inuse\_bytes               | Gauge       | Number of bytes in use by the stack allocator                                                 |                                                                                                                                                                                                                                                  |
| go\_memstats\_stack\_sys\_bytes                 | Gauge       | Number of bytes obtained from the system for the stack allocator                              |                                                                                                                                                                                                                                                  |
| go\_memstats\_sys\_bytes                        | Gauge       | Number of bytes obtained from the system                                                      |                                                                                                                                                                                                                                                  |
| go\_threads                                     | Gauge       | Number of OS threads created                                                                  |                                                                                                                                                                                                                                                  |
| promhttp\_metric\_handler\_requests\_in\_flight | Gauge       | Current number of scrapes being served                                                        |                                                                                                                                                                                                                                                  |
| promhttp\_metric\_handler\_requests\_total      | Counter     | Total number of scrapes by HTTP status code                                                   |                                                                                                                                                                                                                                                  |
| sdmcli\_chunk\_completed\_count                 | Counter     | Number of chunks processed by the node                                                        | `type=<RESOURCE_TYPE>` (example: `type=postgres`)                                                                                                                                                                                                |
| sdmcli\_credential\_load\_count                 | Counter     | Total number of times the node has attempted to load credentials for a resource               | <p><code>type=\<RESOURCE\_TYPE></code> (example: <code>type=postgres</code>),<br><code>source=store</code></p>                                                                                                                                   |
| sdmcli\_egress\_count                           | Gauge       | Current number of active egress connections                                                   | `type=<RESOURCE_TYPE>` (example: `type=postgres`)                                                                                                                                                                                                |
| sdmcli\_egress\_attempt                         | Counter     | Total number of times the node has attempted to establish an egress connection to a resource  | <p><code>type=\<RESOURCE\_TYPE></code> (example: <code>type=postgres</code>),<br><code>successful=true</code></p>                                                                                                                                |
| sdmcli\_link\_attempt\_count                    | Counter     | Total number of attempts to establish links with other nodes and listeners                    | `direction=inbound`                                                                                                                                                                                                                              |
| sdmcli\_link\_count                             | Gauge       | Current number of active links                                                                |                                                                                                                                                                                                                                                  |
| sdmcli\_link\_latency                           | Gauge       | Round-trip network latency (in seconds) to a certain node                                     | <p><code>peer\_id=\<UUID\_OF\_GATEWAY></code>,<br><code>peer\_addr=\<HOST:PORT\_OF\_GATEWAY></code></p>                                                                                                                                          |
| sdmcli\_node\_heartbeat\_duration               | Histogram   | Count and duration of each time the node attempts to send a heartbeat to the StrongDM backend |                                                                                                                                                                                                                                                  |
| sdmcli\_node\_heartbeat\_error\_count           | Counter     | Total number of times a heartbeat attempt has failed                                          | `error=invalid operation\|permission denied\|item already exists\|item does not exist\|internal error\|canceled\|deadline exceeded\|unauthenticated\|failed precondition\|aborted\|out of range\|unimplemented\|unavailable\|resource exhausted` |
| sdmcli\_node\_lifecycle\_state\_change\_count   | Counter     | Total number of times the node has changed its lifecycle state                                | `state=verifying_restart\|awaiting_restart\|restarting\|started\|stopped`                                                                                                                                                                        |
| sdmcli\_query\_completed\_count                 | Counter     | Number of queries processed by the node                                                       | `type=<RESOURCE_TYPE>` (example: `type=postgres`)                                                                                                                                                                                                |
| sdmcli\_stream\_count                           | Gauge       | Current number of active streams                                                              |                                                                                                                                                                                                                                                  |
| sdmcli\_upload\_backlog\_bytes                  | Gauge       | Current size of the node's upload backlog in bytes                                            | `type=query_batch\|chunk`                                                                                                                                                                                                                        |
| sdmcli\_upload\_bytes                           | Counter     | Number of bytes the node has attempted to upload                                              | `type=query_batch`                                                                                                                                                                                                                               |
| sdmcli\_upload\_count                           | Counter     | Number of query batches and chunks the node has attempted to upload                           | `type=query_batch`                                                                                                                                                                                                                               |
| sdmcli\_upload\_dropped\_count                  | Counter     | Number of uploads the node has given up retrying                                              | `type=query_batch\|chunk`                                                                                                                                                                                                                        |
| sdmcli\_upload\_retried\_count                  | Counter     | Number of uploads the node has retried                                                        | `type=query_batch\|chunk`                                                                                                                                                                                                                        |

### Prerequisites

Before you begin configuration, ensure that you have the following:

* StrongDM client version 34.96.0 or higher
* A StrongDM account with the Administrator permission level
* A StrongDM node up and running
* Existing accounts and familiarity with the following:
  * A monitoring system and time series database, such as Prometheus
  * A monitoring dashboard, such as Grafana
  * An alerting tool, such as Prometheus Alertmanager or Rapid7

### Configuration Example

You can use the `/metrics` endpoint to request metrics for any monitoring solution. This particular example shows how to enable Prometheus-formatted metrics on a node. Note that the following example steps may differ from yours, and these steps are provided as an example only.

Configuration involves these general steps:

* Enable Prometheus-formatted metrics on your node
* Configure Prometheus
* Set up a monitoring dashboard
* Set up alerts

#### 1. Enable Prometheus-formatted metrics on your node

This section explains the various ways to enable Prometheus-formatted metrics on your node. You need to specify the port and/or IP address for the node to listen on. To do so, set an environment variable with or without IP, or pass a setting in your command-line interface.

Once metrics are enabled, the node starts listening on the specified port.

**Enable metrics using environment variable with port**

Set the `SDM_METRICS_LISTEN_ADDRESS` environment variable in the node's environment on port 9999:

```shell
SDM_METRICS_LISTEN_ADDRESS=:9999
```

**Enable metrics using environment variable with IP and port**

To specify an IP address to listen on, set the variable with the IP address and port 9999, as in the following example:

```shell
SDM_METRICS_LISTEN_ADDRESS=127.0.0.1:9999
```

**Enable metrics using CLI setting**

The following example shows how to pass the metrics setting as a command-line argument:

```shell
sdm relay --prometheus-metrics=:9999
```

#### 2. Configure Prometheus

1. Open your config YAML file for editing.
2. In the `scrape_configs` section, add jobs for each node, as in the following example:

   ```yaml
   scrape_configs:
     - job_name: "StrongDM Relay 01"
       static_configs:
         - targets: ["<RELAY_BOX_URL>:9999"]
   ```

#### 3. Set up your monitoring dashboard

Configure a monitoring dashboard such as Grafana to visualize your Prometheus metrics. For information on creating a Prometheus data source in Grafana, please see the [Prometheus documentation](https://prometheus.io/docs/visualization/grafana/).

#### 4. Set up alerts

Configure your desired alerts on a tool such as Prometheus Alertmanager or Rapid7 in order to ensure reliability and be aware of node performance issues.

You may, for example, wish to set alerts for node health, resource health and reachability, when a new node fails to connect, and when a connected node disconnects.

### How to Request Metrics

After configuration is complete, you can request metrics from the node on the specified port by accessing the `/metrics` endpoint.

For example:

```bash
curl http://127.0.0.1:9999/metrics
```


# Security-Enhanced Linux

If you have SELinux enabled, the StrongDM gateway installation will fail. You'll need to set SELinux in permissive mode on each host before you attempt to deploy a gateway.

### Disable SELinux

Security-Enhanced Linux, or [**SELinux**](https://en.wikipedia.org/wiki/Security-Enhanced_Linux), allows you to set access control through policies.

1. Check the SELinux state: `getenforce` If the output is either Permissive or Disabled, you should be set. If the output is enforcing, continue to the next step.
2. There are two ways that you can disable SELinux - either by editing a config file, or by using the setenforce command
   1. If editing the config file, Open the `/etc/selinux/config` file (in some systems, the `/etc/sysconfig/selinux` file).
   2. Change the line `SELINUX=enforcing` to `SELINUX=permissive`.
   3. Save and close the file.
   4. Reboot your system
3. If using the setenforce simply run the command `sudo setenforce 0`
4. After performing either of the above methods, check again using `getenforce`

   ```bash
   $ getenforce
   Permissive
   ```

### Re-Enable SELinux

Once you've deployed a gateway, you'll want to re-enable SELinux. This is just a reverse of the disabling process..

1. Check the SELinux state: `getenforce` If the output is `Enforcing`, SELinux is already enabled. If the output is Permissive or Disabled, continue to the next step.
2. There are two ways that you can re-enable SELinux - either by editing a config file, or by using the `setenforce` command
   1. If editing the config file, Open the `/etc/selinux/config` file (in some systems, the `/etc/sysconfig/selinux` file).
   2. Change the line `SELINUX=permissive` to `SELINUX=enforcing`.
   3. Save and close the file.
   4. Reboot your system
3. If using the `setenforce`, simply run the command `sudo setenforce 1`.
4. After performing either of the above methods, check again using `getenforce`

   ```bash
   $ getenforce
   Enforcing
   ```


# Resources

### Overview

The Infrastructure section of the Admin UI is where you can add, view, manage, and search all of your organization's resources, including [clouds](/admin/resources/clouds), [clusters](/admin/resources/clusters), [datasources](/admin/resources/datasources), [servers](/admin/resources/servers), and [websites](/admin/resources/websites).

### How to Add Resources

1. In the Admin UI, click **Resources** > **Managed Resources** in the navigation menu.
2. Select the kind of resource you wish to add, and fill in configuration details for it.
3. Click the **Add** button.

{% hint style="info" %}
To prevent being locked out of critical resources during emergency "break-glass" scenarios, we recommend configuring local admin accounts on end resources.
{% endhint %}

### How to Manage Resources

A list (in table format) of existing resources is displayed on the **Resources** > **Managed Resources** page in the Admin UI. You can sort the table of resources in your organization by clicking on column headers. Clicking a column header sorts the table by the values in that column, in ascending order. Clicking again on the same header reverses the sorting direction.

To get more details about, clone, edit, or delete resources, you can click the **Actions** button next to the resource's name, or you can click into the resource's name to view or modify the resource's settings.

Clicking the **Actions** button for a resource displays the actions you can take on the selected resource, without having to go into the resource's details.

#### Healthcheck individual resources

Healthchecks verify that StrongDM can reach the resource, and show the resource as available and healthy in the Admin UI and in the desktop app for users who have access to that resource. To initiate a healthcheck for a specific resource from the CLI, use the following command:

```sh
sdm admin resources healthcheck <RESOURCE_ID>
```

The placeholder `<RESOURCE_ID>` is the ID of your resource, or its exact name. If the name matches more than one resource, the healthcheck will fail. The command does not give a response. It will simply initiate the healthcheck to update that status within StrongDM if it needs to be updated.

#### Healthcheck node/resource pairs

Healthchecks can also be performed across your StrongDM network for every node/resource pair. Each gateway or relay that can reach out to a particular resource constitutes a pair. Both nodes and resources can show up in multiple pairs, because in many network arrangements nodes can connect with multiple resources, and multiple nodes can connect to any given resource. The command for listing healthchecks for all node/resource pairs is:

```sh
sdm admin healthchecks list
```

Running the command returns a list of results, if any match the search filters:

```sh
ResourceName       ResourceID             NodeName          NodeID                 Healthy     Error     Time
testResource01     rs-32e6c4g67392tk0     testGateway_A     n-3950j34d58489ds9     true                  2024-11-04 13:49:36.793649 +0000 UTC
testResource01     rs-32e6c4g67392tk0     testGateway_B     n-9557s22n88047gw5     false                 2024-11-04 07:22:11.568427 +0000 UTC
testResource02     rs-57d7k2o45896ad2     testGateway_A     n-3950j34d58489ds9     true                  2024-11-04 13:37:33.664810 +0000 UTC
testResource03     rs-34h3s4k35288dr9     testGateway_A     n-3950j34d58489ds9     false                 2024-11-03 19:11:16.747920 +0000 UTC
```

In this example, you could make the following assumptions:

* `testResource1` is healthy and `testGateway_A` is healthy, since that pair checks healthy.
* `testGateway_B` is possibly unhealthy, because when paired with `testResource01` that pair was unhealthy. Of course, they were last checked at different times, so further investigation is warranted.
* `testResource02` is healthy.
* `testResource03` is likely unhealthy, because when paired with the gateway we believe is healthy, it was not.

This command can provide a starting point to look for specific problems, which can be hard to identify if your fleet of nodes (gateways, relays, and proxy clusters) and resources often has unhealthy infrastructure in it. Now you can look at the individual entries that include the problematic resource or node. This list also confirms whether your networking setup is functioning as you wish it to, and that particular resources are reachable through the nodes that you intend them to be (such as when using relays in private subnets, or segmenting your network with [Proxy Clusters](/admin/networking/proxy-clusters) or with [Explicit Routing](/admin/networking/gateways-and-relays/explicit-routing)).

The returned list can be filtered, and provides more detail about routing problems. The resource is considered healthy if at least one node can reach it, but seeing the health of all of the pairs that contain that resource might help to narrow down issues with infrastructure.

### Resource Search

The **Search** field allows you to find resources in your organization according to display name, health, resource type, authentication method, and assigned tags. You can either type into the **Search** field or use the filter buttons to quickly find resources by type, health status, assigned tags, and/or their secret stores. The table header displays the number of results returned by the active search and filter query.

#### Free-text search

You can enter any text or string, even partial strings, into the **Search** field. The Admin UI checks against all resource names.

#### Resource search filters

Resource filters display resources according to their type (for example, MySQL is a datasource type), status (healthy or unhealthy), tags (any assigned tags), or configured secret store (StrongDM or a secrets management tool).

You can type or copy/paste the following filters into the Search field, with or without other text. Do not use quotes or tick marks.

| Filter                            | Description                                                                                                                                                                                         | Example Search                                                                                                                                                                   |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `healthy:<TRUE\|FALSE>`           | Shows all resources that are healthy (`true`) or unhealthy (`false`)                                                                                                                                | For any resource, `status:unhealthy` finds all unhealthy resources                                                                                                               |
| `identityEnabled:<TRUE\|FALSE>`   | Shows SSH or Kubernetes resources that use either Identity Aliases (`true`) or leased credentials (`false`) to authenticate                                                                         | For cluster resources, `IdentityEnabled:false` finds all clusters that use the default leased credentials for authentication                                                     |
| `secretStoreId:<SECRET_STORE_ID>` | Shows resources with the specified secret store identifier; you can find identifiers next to secret store names in the Admin UI's **Settings** > **Secrets Management** > **Secret Stores** section | `secretStoreId:se-1b234c56789d012e` finds all resources that store credentials in the secret store with identifier "se-1b234c56789d012e"                                         |
| `tags:title=value`                | Shows resources with the specified tag; supports wildcards (`*`)                                                                                                                                    | `tags:env=prod` or `tags:env=pr*` finds all resources with the **env=prod** tag; tag values containing commas must be inside quotes (for example, `tags:region="useast,uswest"`) |
| `type:<RESOURCE_TYPE>`            | Shows specified types of resources                                                                                                                                                                  | If searching clusters, `type:kubernetes` finds all Kubernetes clusters                                                                                                           |

#### Filter buttons

Alternatively, you may narrow the search results by selecting one or more of the following filter buttons instead of typing it out:

* **Secret Store** automatically populates filters based on secret stores selected for resources.
* **Status** automatically populates filters based on health status.
* **Tags** automatically populates filters based on assigned resource tags.
* **Type** automatically populates filters based on the type of resource.

#### Save your favorite search and filter queries

The parameters of your search and filter queries are reflected in the page URL, allowing you to bookmark your favorite searches and filters in your web browser.

For example, when filtering datasources to find only the MySQL datasource type, the URL becomes `https://app.strongdm.com/app/infrastructure/datasources?type=mysql`.

Note that when filtering resources by secret store, the URL includes the secret store ID parameter instead of the secret store name (for example, `https://app.strongdm.com/app/infrastructure/datasources?secretStoreId=se-1b234c56789d012e`).

### Supported Resource Versions

StrongDM, in most cases, aligns supported resource versions to vendor support, ensuring that the resources benefit from vendor security updates. Versions that are no longer actively maintained by the vendor will generally not be supported by StrongDM.

These unsupported versions may still continue to work with StrongDM, but we encourage customers to upgrade to a supported version in a timely manner. Where a vendor provides different levels of support (for example, Oracle Lifetime Support), StrongDM will align to the supported level that includes security updates.

There may be occasional exceptions to this general support policy, such as vendor-supported versions that StrongDM does not support or EOL versions that StrongDM maintains support for. In such cases, the particular StrongDM documentation page for that resource type should usually contain the specific details for supported versions.

### Related Topics

{% content-ref url="/pages/expYWKjEGcFOlZvsGF4q" %}
[Add Resources with Secret Store Authentication](/admin/resources/add-resources-secret-stores)
{% endcontent-ref %}

{% content-ref url="/pages/cn3ac9yBMw6DU2vnvETZ" %}
[Clouds](/admin/resources/clouds)
{% endcontent-ref %}

{% content-ref url="/pages/1n9RrOvYLYFOYdIqqDhb" %}
[Clusters](/admin/resources/clusters)
{% endcontent-ref %}

{% content-ref url="/pages/qIGd6Zh1Dc7xe5yZEbGn" %}
[Datasources](/admin/resources/datasources)
{% endcontent-ref %}

{% content-ref url="/pages/FPJus7ukM1lLanzd5s8D" %}
[Import Resources](/admin/resources/import-resources)
{% endcontent-ref %}

{% content-ref url="/pages/QEqYuzEJXRIUpUTUIAdy" %}
[Rotate Passwords](/admin/resources/rotate-passwords)
{% endcontent-ref %}


# Clouds

StrongDM integrates with several cloud providers, allowing you to incorporate StrongDM for access management into your existing cloud infrastructure.

StrongDM has a variety of integrations with each of these clouds, including for cloud management, specific resource types, secrets management tools, and user SSO and provisioning.

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Amazon Web Services (AWS)</td><td><a href="/files/v4mrUCXHHMMPWyoaauYL">/files/v4mrUCXHHMMPWyoaauYL</a></td><td><a href="/pages/UUPIKAfYVmUBeMET9SCN">/pages/UUPIKAfYVmUBeMET9SCN</a></td></tr><tr><td>Google Cloud Provider (GCP)</td><td><a href="/files/N3dwdTfx6yrCCxGcyEYE">/files/N3dwdTfx6yrCCxGcyEYE</a></td><td><a href="/pages/DsHGXx583UBuXcKuwaJ5">/pages/DsHGXx583UBuXcKuwaJ5</a></td></tr><tr><td>Microsoft Azure + Entra ID</td><td><a href="/files/TLZbV5KLI2sraWMBUBYX">/files/TLZbV5KLI2sraWMBUBYX</a></td><td><a href="/pages/RT5cL7YdLQOFlgcFOfbO">/pages/RT5cL7YdLQOFlgcFOfbO</a></td></tr><tr><td>Okta</td><td><a href="/files/qful5wdtC78gHxgfRxWZ">/files/qful5wdtC78gHxgfRxWZ</a></td><td></td></tr></tbody></table>

### Cloud Resource Types

These resource types are the specific resources for managing clouds, often access to cloud web consoles or to use the cloud's CLI tool, that StrongDM provides.

* [AWS Management Console](/admin/resources/clouds/aws-console)
* [AWS (Instance Profile)](/admin/resources/clouds/aws-instance-profile)
* [AWS Cloud](/admin/resources/clouds/aws)
* [Azure Cloud](/admin/resources/clouds/azure)
* [GCP (Workforce Identity Federation)](/admin/resources/clouds/gcp-wif)
* [GCP CLI/SDK (Service Account)](/admin/resources/clouds/gcp)
* [Microsoft Entra ID](/admin/resources/clouds/microsoft-entra-id)
* [Okta](/admin/resources/clouds/okta)
* [Snowsight](/admin/resources/clouds/snowsight)


# AWS Management Console

Use StrongDM to securely broker access to the AWS Management Console, whether via IAM role assumption or static key pair.

## Overview

This guide explains what capabilities StrongDM can provide for managing access to AWS Management Console via a service account. It also provides setup and configuration instructions to add AWS Management Console as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your console via a CLI application such as aws. StrongDM users are authenticated with AWS and granted the level of access that you configure on the AWS side.

In addition to access control and auditing, AWS Management Console access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For AWS Management Console clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to AWS using a different service account with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to AWS, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple AWS Management Console cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to AWS resources based on their context can be used to limit availability of your AWS Management Console to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
Note that this is a method by which to set up your AWS Management Console cloud, and manage it with `aws`. If you intend to connect to a specific AWS-hosted resource, that resource needs to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* Due to the limitations of this resource type, StrongDM does not log user interactions after authentication occurs. StrongDM logs activities such as setup or modification of the resource within StrongDM, or authentication of a user to the resource, but StrongDM does not log the queries performed by the user on the resource itself. We recommend the use of [CloudTrail](https://docs.aws.amazon.com/cloudtrail/index.html) for logging further interactions with the resource once a user is authenticated.
* Similarly, some organization-level behaviors are also different for this resource type:
  * Inactivity timeouts set for the organization are not enforced.
  * Current connections to resources are not severed instantly when access is revoked.
  * Note that you can set an expiration field to enforce session timeouts. See **Session Expiry Seconds** in the [AWS Management Console properties](#aws-management-console-cloud-properties).

## AWS Management Console Cloud Properties

AWS Management Console supports the `aws` command-line tool.

## Authentication

To manage access to your AWS Management Console via StrongDM, we support the following authentication modes:

* A static AWS access key, which comprises an Access Key ID and a Secret Access Key
* Environment-loaded credentials, which can be one of the following:
  * AWS access keys in standard AWS [environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) on the gateway
  * AWS access keys configured as a standard AWS profile on the gateway
  * An EC2 instance profile or [ECS profile](https://docs.aws.amazon.com/sdkref/latest/guide/feature-container-credentials.html) linked to the host or container running the gateway
  * An IAM role assumption, which can be used with [Identity Aliases](/admin/principals/identity-alias)

If you use Identity Aliases, the identity selected for any given user does not relate to AWS IAM identities or authorization for that user account. The StrongDM user still only has rights belonging to the AWS Role defined in the resource, or via credentials on the gateway. The [authentication setting](##admin-ui-setup) for the resource only changes what name is used to log requests in AWS CloudTrail and the display name of the logged-in user in the AWS Management Console.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have administrator access to your AWS environment and be familiar with `aws`.
* Have [TLS certificates](##generate-tls-certificates) set up.
* Be aware of [security considerations](##security-considerations).
* Consider [logging](##additional-logging-considerations).

### Generate TLS certificates

You must have TLS certificates set up with StrongDM before adding an AWS Management Console resource. The certificates are usually generated automatically when an StrongDM organization is created, but in some cases, it might be necessary to explicitly create them. To check, go to the **Managed Resources** page in the Admin UI. If the option to generate TLS certificates is displayed, click on the button to generate them.

### Security considerations

Before adding your AWS Management Console as a cloud resource, note the following.

* For your AWS configurations, allow the least amount of privilege possible.
* Keep your authentication type the same when possible. If your organization does not use static keys, do not configure StrongDM to use them.
* Logging:
  * StrongDM doesn't log anything beyond authentication against the resource. If you need more complete log coverage than CloudTrail provides on the AWS side, you can use Identity Aliases and your own CloudTrail logs in AWS. With these, you can create an accurate picture of access.
  * Enable and log AWS Access Analyzer and CloudTrail Management events for the account to configure. When in use, the logging shifts from StrongDM logs to AWS logs. Having unified schemas and transactions ready for this is helpful for your security team.
* If AWS single sign-on (SSO) is being used organization wide, the feature should be configured from the account that provides SSO to your organization.
* Be vigilant of over-applied `sts:assume` in trust relations. For example, if using the trusted entity type of AWS account during role creation, the only condition to assume this role is that you must be assuming the role from the account given. The best practice is to observe least privilege when working with IAM roles.
* StrongDM blocks the use of some actions through StrongDM to prevent unintended privilege escalations, particularly:
  * `AssumeRole`
  * `GetSessionToken`
* Use the AWS managed policy called ReadOnlyAccess when there is possible doubt in the configuration.
* If you are unsure about the configuration, diagram what the plan is and review it with a coworker.

### Additional logging considerations

Before you proceed with configuration, note the following logging information.

* If you use Identity Aliases within StrongDM, your CloudTrail logs are augmented. The logs show the Identity Alias instead of the user email address.
* If Identity Aliases is not enabled, StrongDM includes the user's email in the "assume role" request, which displays in CloudTrail.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set either **AWS Management Console** or **AWS Management Console (Static key pair)**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add awsConsole --help` or `sdm admin clouds add awsConsoleStaticKeyPair --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.
3. Then run `sdm admin clouds add awsConsole|awsConsoleStaticKeyPair <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   # Add AWS Management Console
   $ sdm admin clouds add awsConsole "aws-console-prod"
     --region "us-west-2"
     --role-arn "arn:aws:iam::123456789012:role/StrongDMAccessRole"
     --role-external-id "acme-external-id-2025"
     --http-subdomain "aws-console-prod01"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --session-expiry-seconds 3600
     --enable-environment-variables
     --tags "env=prod,cloud=aws,team=devops"
     --timeout 30

   # Add AWS Management Console (Static key pair)
   $ sdm admin clouds add awsConsoleStaticKeyPair "aws-console-static-prod"
     --region "us-east-1"
     --access-key-id "AKIAIOSFODNN7EXAMPLE"
     --secret-access-key "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
     --role-arn "arn:aws:iam::123456789012:role/StrongDMAccessRole"
     --role-external-id "ext-id-aws-prod-2025"
     --http-subdomain "aws-console-static01"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_abcdef1234567890"
     --secret-store-id "ss_abcdef0123456789"
     --session-expiry-seconds 3600
     --tags "env=prod,cloud=aws,auth=static,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create AWS Management Console
resource "sdm_resource" "aws_console_prod" {
  aws_console {
    # Required
    name           = "aws-console-prod"                                 # <name>
    region         = "us-west-2"                                        # --region
    role_arn       = "arn:aws:iam::123456789012:role/StrongDMAccess"    # --role-arn
    http_subdomain = "aws-console-prod01"                               # --http-subdomain

    # Optional authentication and session settings
    role_external_id             = "ext-id-aws-prod-2025"               # --role-external-id
    enable_environment_variables = true                                 # --enable-environment-variables
    session_expiry_seconds       = 3600                                 # --session-expiry-seconds

    # Common networking options
    bind_interface  = "default"                                         # --bind-interface ("default" | "loopback" | "vnm")
    port_override   = -1                                                # --port-override (-1 = auto-allocate)
    egress_filter   = "field:name tag:env=prod tag:region=us-west"      # --egress-filter

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                           # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                            # --secret-store-id

    # Tags
    tags = {                                                            # --tags
      env   = "prod"
      cloud = "aws"
      auth  = "role"
      team  = "devops"
    }
  }
}

# Create AWS Management Console (Static Key Pair)
resource "sdm_resource" "aws_console_static_prod" {
  aws_console_static_key_pair {
    # Required
    name              = "aws-console-static-prod"                       # <name>
    region            = "us-east-1"                                     # --region
    access_key_id     = "AKIAIOSFODNN7EXAMPLE"                          # --access-key-id (use secret store in prod)
    secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"      # --secret-access-key (use secret store in prod)
    role_arn          = "arn:aws:iam::123456789012:role/StrongDMAccess" # --role-arn
    http_subdomain    = "aws-console-static01"                           # --http-subdomain

    # Optional authentication and session settings
    role_external_id       = "ext-id-aws-prod-2025"                     # --role-external-id
    session_expiry_seconds = 3600                                       # --session-expiry-seconds

    # Common networking options
    bind_interface  = "default"                                         # --bind-interface
    port_override   = -1                                                # --port-override
    egress_filter   = "field:name tag:env=prod tag:region=us-east"      # --egress-filter

    # Optional integrations
    proxy_cluster_id = "plc_abcdef1234567890"                           # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                            # --secret-store-id (recommended for keys)

    # Tags
    tags = {
      env   = "prod"
      cloud = "aws"
      auth  = "static"
      team  = "devops"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

{% tabs %}
{% tab title="AWS Management Console" %}
The **AWS Management Console** cloud type has the following properties.

| Property                         | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| -------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                 | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                | Required    | Select **AWS Management Console** if you are using environment-loaded credentials for authentication                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Proxy Cluster**                | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode**            | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization                                                                                                                                                                                                                                               |
| **IP Address**                   | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                          | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **HTTP Subdomain**               | Required    | What is used as your local DNS address (for example, `app-prod1` turns into `http://app-prod1.<your-org-name>.sdm.network/`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Secret Store**                 | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Enable Environment Variables** | Optional    | When selected, lets you use environment variables to authenticate connection even if EC2 roles are configured                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Region**                       | Required    | AWS region to connect to (for example, `us-west-2`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Assume Role ARN**              | Required    | Amazon Resource Name (ARN) role to assume after login (for example, `arn:aws:iam::000000000000:role/RoleName`); required in order to ensure that multiple relays or gateways do not authenticate using different credentials into the AWS Management Console                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Assume Role External ID**      | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Session Expiry Seconds**       | Optional    | Length of time, in seconds, of AWS Management Console sessions before needing to reauthenticate (for example, `3600`); must be greater than `900` and less than `43200`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Authentication**               | Required    | Select **Leased Credential**, which uses leased credentials to access the cloud, or **Identity Aliases**, which uses the Identity Aliases of StrongDM users to access the cloud                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Identity Set**                 | Required    | Displays if **Authentication** is set to **Identity Aliases**; select an Identity Set name from the list                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Healthcheck Username**         | Required    | If **Authentication** is set to **Identity Aliases**, enter the username that should be used to verify StrongDM's connection to it; the username must already exist in your AWS Management Console                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Use HTTPS**                    | Optional    | Enabled by default; when enabled, StrongDM uses HTTPS for the connection                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Resource Tags**                | Optional    | Enter [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}                     |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="AWS Management Console (Static key pair)" %}
For **AWS Management Console (Static key pair)** cloud type has the following properties.

<table><thead><tr><th width="199.82666015625">Property</th><th width="129.5078125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td>Select <strong>AWS Management Console (Static key pair)</strong> if you are using an AWS static key pair for authentication</td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>HTTP Subdomain</strong></td><td>Required</td><td>What is used as your local DNS address (for example, <code>app-prod1</code> turns into <code>http://app-prod1.&#x3C;your-org-name>.sdm.network/</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>Access Key ID</strong></td><td>Required</td><td>String generated by AWS that comprises half of an access key (for example, <code>AKIAIOSFODNN7EXAMPLE</code>)</td></tr><tr><td><strong>Secret Access Key</strong></td><td>Required</td><td>String generated by AWS that comprises the other half of an access key (for example, <code>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</code>)</td></tr><tr><td><strong>Region</strong></td><td>Required</td><td>AWS region to connect to (for example, <code>us-west-2</code>)</td></tr><tr><td><strong>Assume Role ARN</strong></td><td>Required</td><td>Amazon Resource Name (ARN) role to assume after login (for example, <code>arn:aws:iam::000000000000:role/RoleName</code>); required in order to ensure that multiple relays or gateways do not authenticate using different credentials into the AWS Management Console</td></tr><tr><td><strong>Assume Role External ID</strong></td><td>Optional</td><td>External ID role to assume after login (for example <code>12345</code>)</td></tr><tr><td><strong>Session Expiry Seconds</strong></td><td>Optional</td><td>Length of time, in seconds, the AWS Management Console sessions live before needing to reauthenticate (for example, <code>3600</code>); must be greater than <code>900</code> and less than <code>43200</code></td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Select <strong>Leased Credential</strong>, which uses Leased Credentials to access the cloud, or <strong>Identity Aliases</strong>, which uses the Identity Aliases of StrongDM users to access the cloud</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, enter the username that should be used to verify StrongDM's connection to it; note that the username must already exist in your AWS Management Console</td></tr><tr><td><strong>Use HTTPS</strong></td><td>Optional</td><td>Enabled by default; when enabled, StrongDM uses HTTPS for the connection</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter datasource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

### Configuration notes

How you configure your resource properties depends on how you connect your AWS Management Console.

* For a static key connection, select the static key pair cloud option and fill in the required fields.
* To use an EC2 instance profile or ECS profile, select the **AWS Management Console** cloud type, and leave the **Enable Environment Variables** box unchecked.
* For IAM roles with or without Identity Aliases as a connection, select the **AWS Management Console** cloud type, and leave the **Enable Environment Variables** box unchecked. Use the **Enable Environment Variables** option when you have an AWS user profile configured on the gateway box for the local account running the gateway process (that is, an [EC2 IAM role](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)).
* To use an AWS profile configured on the gateway, select the **AWS Management Console** cloud type, and leave the **Enable Environment Variables** box unchecked.
* To use environment variables, select the **AWS Management Console** cloud type and check the **Enable Environment Variables** box.

### **Credentials-reading order**

During authentication with your AWS resource, the system looks for credentials in the following places in this order:

1. Environment variables (if the Enable Environment Variables box is checked)
2. EC2 role or ECS profile
3. Shared credentials file

As soon as the relay or gateway finds credentials, it stops searching and uses them. Due to this behavior, we recommend that all similar AWS resources with these authentication options use the same method when added to StrongDM.

For example, if you are using environment variables for AWS Management Console and using EC2 role authentication for an EKS cluster, when users attempt to connect to the EKS cluster through the gateway or relay, the environment variables are found and used in an attempt to authenticate with the EKS cluster, which then fails. We recommend using the same type for all such resources to avoid this problem at the gateway or relay level. Alternatively, you can segment your network by creating subnets with their own relays and sets of resources, so that the relays can be configured to work correctly with just those resources.

## Logs

For logs of access to an AWS Management Console cloud resource, in the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of users connected through StrongDM. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the AWS Management Console cloud resource via StrongDM, users need to install the following:

* StrongDM Desktop application
* Latest version of the StrongDM CLI; if already installed, you can run `sdm update` in the CLI to update it, or open the desktop app and click the **Upgrade** button
* AWS CLI; both v1 and v2 are supported but we encourage the use of v2

After installation, users must set up or update the AWS CLI configuration file to include a region, as explained in the [AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). Once that is done, exit and restart the StrongDM desktop app, and then select the AWS Management Console cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use `aws` through StrongDM at their terminal, with the base syntax of `sdm aws` instead of the usual `aws`.

You can use `sdm aws --help` to view example usage and command options:

```shell
NAME:
   sdm aws - aws commands

USAGE:
   sdm aws command [command options] [arguments...]

COMMANDS:
   cli        Execute an AWS CLI Command.
   env        Print environment variables required to access an AWS resource.
   run        Execute an external command with environment variables configured for AWS.
   terraform  Execute terraform commands with a SDM AWS proxy.

OPTIONS:
   --name value     The name of the AWS resource to access. By default if there is only one connected AWS resource, that resource is used. [$SDM_AWS_NAME]
   --help, -h  show help
```

### aws cli

The `aws cli` command is followed by an AWS CLI command that you wish to run against your connected AWS Management Console resource. For more information about gcloud CLI commands, see the [AWS CLI documentation](https://docs.aws.amazon.com/cli/latest/).

### aws env

The `aws env` command outputs the environment variables that are required in order to access an AWS resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to AWS.

### aws run

The `aws run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `aws run` would be if you have a pre-existing script for managing AWS resources that uses `aws` commands. Instead of altering the script to work with StrongDM, you could use `aws run shellscript.sh` and run the script.

### --name

If your organization has multiple AWS Management Console cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm aws --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single AWS Management Console cloud resource connected.

## Error Cases

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# AWS (Instance Profile)

Learn how to configure a StrongDM AWS Instance Profile resource to connect using IAM Instance Profile credentials.

## Overview

This guide explains what capabilities StrongDM can provide for managing command line access to the AWS cloud. It also provides setup and configuration instructions to add AWS as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your cloud via the AWS CLI. StrongDM users are authenticated with AWS and granted the level of access that you configure on the AWS side.

In addition to access control and auditing, AWS access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For AWS clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to AWS using a different set of credentials with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to AWS, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple AWS (Instance Profile) cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to AWS cloud resources based on their context can be used to limit availability of your AWS CLI to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
This resource type is nearly the same as the AWS cloud resource type, except that it does not support static keys for authentication. The authentication modes supported are environment-loaded credentials. Please see [Configure AWS](/admin/resources/clouds/aws) if you wish to use static keys to manage access to your AWS cloud environment via StrongDM.

This is the method by which to set up your AWS cloud and manage it with the AWS CLI. If you intend to connect to a specific AWS-hosted resource, such as Athena or an EC2 instance, those resources need to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* Note that `sdm aws cli ssm start-session` is not currently supported when using the AWS CLI via StrongDM due to an AWS technical limitation. If you wish to use `ssm` sessions, you can set up the [AWS Console](/admin/resources/clouds/aws-console) resource type and use the web interface to initiate a session with `ssm`.
* The AWS driver does nothing to limit privilege escalation. It is the responsibility of the resource creator not to provide credentials that can be used to create more credentials.

## AWS Cloud Properties

The AWS (Instance Profile) resource type supports environment-loaded credentials, which can be one of the following:

* AWS access keys in standard AWS [environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html) on the node(s) (gateways or relays)
* AWS access keys configured as a standard AWS profile on the node(s)
* An EC2 instance profile or [ECS profile](https://docs.aws.amazon.com/sdkref/latest/guide/feature-container-credentials.html) linked to the host or container running the node(s)

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* To manage access to your AWS cloud environment via StrongDM, you must have an AWS key pair (Access Key ID and AWS Secret Access Key) prepared. The scope of this key determines which AWS CLI commands your users can execute through StrongDM, so consider that when generating the key. Once you have your AWS key, you can set up a cloud resource in the StrongDM Admin UI.
* Your nodes must be running at least version 31.10 to support usage of the AWS CLI to administer your AWS cloud.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set **AWS (Instance Profile)**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add awsinstanceprofile --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.\\

   ```
   NAME:
      sdm admin clouds add awsinstanceprofile - create AWS (Instance Profile) cloud

   USAGE:
      sdm admin clouds add awsinstanceprofile [command options] <name>

   OPTIONS:
      --bind-interface value                     IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --egress-filter value                      apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --enable-environment-variables             Prefer environment variables to authenticate connection even if EC2 roles are configured.
      --port-override value                      Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                   proxy cluster id
      --region value                             The AWS region to connect to. (required)
      --role-arn value                           The role to assume after logging in. (secret)
      --role-external-id value                   (secret)
      --secret-store-id value                    secret store id
      --subdomain value, --bind-subdomain value  DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                               tags e.g. 'key=value,...'
      --template, -t                             display a JSON template
      --timeout value                            set time limit for command
   ```
3. Then run `sdm admin clouds add awsConsole|awsinstanceprofile <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clouds add awsinstanceprofile "aws-instance-profile-prod"
     --region "us-west-2"
     --role-arn "arn:aws:iam::123456789012:role/StrongDMAccessRole"
     --role-external-id "acme-instanceprofile-2025"
     --bind-interface "default"
     --port-override -1
     --subdomain "aws-instance-profile-prod01"
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --enable-environment-variables
     --tags "env=prod,cloud=aws,auth=instance-profile,team=infra"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create AWS (Instance Profile)
resource "sdm_resource" "aws_instance_profile_prod" {
  aws_instance_profile {
    # Required
    name   = "aws-instance-profile-prod"                 # <name>
    region = "us-west-2"                                 # --region

    # Optional role to assume after using instance profile creds
    role_arn         = "arn:aws:iam::123456789012:role/StrongDMAccessRole"  # --role-arn (optional)
    role_external_id = "ext-id-aws-ip-2025"                                  # --role-external-id

    # Common networking options
    bind_interface = "default"                             # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                    # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-west"  # --egress-filter
    subdomain      = "aws-instance-profile-prod01"         # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"              # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"               # --secret-store-id

    # Prefer environment variables even if EC2 role metadata is available
    enable_environment_variables = true                    # --enable-environment-variables

    # Tags
    tags = {                                               # --tags
      env   = "prod"
      cloud = "aws"
      auth  = "instance-profile"
      team  = "infra"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **AWS (Instance Profile)** cloud type has the following properties.

<table><thead><tr><th width="199.7528076171875">Property</th><th width="129.617919921875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td><strong>AWS (Instance Profile)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>Enable Environment Variables</strong></td><td>Optional</td><td>When selected, lets you use environment variables to authenticate connection even if EC2 roles are configured</td></tr><tr><td><strong>Assume Role ARN</strong></td><td>Optional</td><td>Amazon Resource Name (ARN) role to assume after login (for example, <code>arn:aws:iam::000000000000:role/RoleName</code>)</td></tr><tr><td><strong>Region</strong></td><td>Required</td><td>AWS region to connect to (for example, <code>us-west-2</code>)</td></tr><tr><td><strong>Assume Role External ID</strong></td><td>Optional</td><td>External ID role to assume after login (for example <code>12345</code>)</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Secret Store options**

By default, resource credentials are stored with StrongDM in your resource configuration. However, these credentials also can be saved in a secret store.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Logs

For logs of access to an AWS cloud resource, in the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of users connected through StrongDM. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

For AWS Web Console resources, access is logged, but further activities on the Web Console are not logged by StrongDM. Consult your AWS logs for further information on user activity.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the AWS cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the GUI and click the **Upgrade** button.
* The AWS CLI. We support both v1 and v2 but encourage the use of v2.

After installation, users must set up or update the AWS CLI configuration file to include a region, as explained in the [AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). Once that is done, exit and restart the StrongDM desktop app, and then select the AWS cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use `aws` through StrongDM at their terminal, with the base syntax of `sdm aws` instead of the usual `aws`.

You can use `sdm aws --help` to view example usage and command options:

```shell
NAME:
   sdm aws - aws commands

USAGE:
   sdm aws command [command options] [arguments...]

COMMANDS:
   cli        Execute an AWS CLI Command.
   env        Print environment variables required to access an AWS resource.
   run        Execute an external command with environment variables configured for AWS.
   terraform  Execute terraform commands with a SDM AWS proxy.

OPTIONS:
   --name value     The name of the AWS resource to access. By default if there is only one connected AWS resource, that resource is used. [$SDM_AWS_NAME]
   --help, -h  show help
```

### aws cli

The `aws cli` command is followed by an AWS CLI command that you wish to run against your connected AWS resource. For more information about gcloud CLI commands, see the [AWS CLI documentation](https://docs.aws.amazon.com/cli/latest/).

### aws env

The `aws env` command outputs the environment variables that are required in order to access an AWS resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to AWS.

### aws run

The `aws run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `aws run` would be if you have a pre-existing script for managing AWS resources that uses `aws` commands. Shell scripts using the non-StrongDM `aws` CLI can be run with `sdm aws run` (for example, `sdm aws run shell-script-using-aws-cli.sh`), which has the same effect as changing the shell script to use `sdm aws cli` in place of `aws`.

### --name

If your organization has multiple AWS cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm aws --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single AWS cloud resource connected.

## Error Cases

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# AWS Cloud

Learn how to configure and manage AWS cloud resources in StrongDM.

## Overview

This guide explains what capabilities StrongDM can provide for managing command line access to the AWS cloud. It also provides setup and configuration instructions to add AWS as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your cloud via the AWS CLI. StrongDM users are authenticated with AWS and granted the level of access that you configure on the AWS side.

In addition to access control and auditing, AWS access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For AWS clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to AWS using a different set of credentials with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to AWS, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple AWS cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to AWS cloud resources based on their context can be used to limit availability of your AWS CLI to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
This resource type is nearly the same as the AWS (Instance Profile) cloud resource type, except that it supports only static keys for authentication. Please see [Configure AWS (Instance Profile)](/admin/resources/clouds/aws-instance-profile) if you wish to use other default authentication methods to manage access to your AWS cloud environment via StrongDM.

Note that this is the method by which to set up your AWS cloud as a resource in StrongDM and manage it with AWS CLI. If you intend to connect to a specific AWS-hosted resource, such as Athena or an EC2 instance, those resources need to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* Note that `sdm aws cli ssm start-session` is not currently supported when using the AWS CLI via StrongDM due to an AWS technical limitation. If you wish to use `ssm` sessions, you can set up the [AWS Console](/admin/resources/clouds/aws-console) resource type and use the web interface to initiate a session with `ssm`.
* The AWS driver does nothing to limit privilege escalation. It is the responsibility of the resource creator not to provide credentials that can be used to create more credentials.

## Prerequisites

* In StrongDM, you must have the Admin \[permission level].
* To manage access to your AWS cloud environment via StrongDM, you must have an AWS key pair (Access Key ID and AWS Secret Access Key) prepared. The scope of this key determines which AWS CLI commands your users can execute through StrongDM, so consider that when generating the key. Once you have your AWS key, you can set up a cloud resource in the StrongDM Admin UI.
* Your gateways or relays must be running at least version 31.10 to support usage of the AWS CLI to administer your AWS cloud.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**.
3. For **Resource Type**, set **AWS Cloud**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add aws --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```
   NAME:
      sdm admin clouds add aws - create AWS cloud

   USAGE:
      sdm admin clouds add aws [command options] <name>

   OPTIONS:
      --access-key-id value       (required, secret)
      --bind-interface value      bind interface (default: "127.0.0.1")
      --egress-filter value       apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --healthcheck-region value  Enter the AWS region healthcheck requests should attempt to connect to. (required)
      --port-override value       port profile override (default: -1)
      --proxy-cluster-id value    proxy cluster id
      --role-arn value            The role to assume after logging in. (secret)
      --role-external-id value    (secret)
      --secret-access-key value   (required, secret)
      --secret-store-id value     secret store id
      --subdomain value, --bind-subdomain value           DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                tags e.g. 'key=value,...'
      --template, -t              display a JSON template
      --timeout value             set time limit for command
   ```
3. Then run `sdm admin clouds add aws <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   $ sdm admin clouds add aws "aws-cloud-prod"
     --access-key-id "AKIAIOSFODNN7EXAMPLE"
     --secret-access-key "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
     --role-arn "arn:aws:iam::123456789012:role/StrongDMAccessRole"
     --role-external-id "ext-id-aws-prod-2025"
     --healthcheck-region "us-west-2"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "aws-cloud-prod01"
     --tags "env=prod,cloud=aws,auth=static,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create AWS cloud resource
resource "sdm_resource" "aws_cloud_prod" {
  aws {
    # Required
    name               = "aws-cloud-prod"                                # <name>
    access_key_id      = "AKIAIOSFODNN7EXAMPLE"                          # --access-key-id (use secret store in prod)
    secret_access_key  = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"      # --secret-access-key (use secret store in prod)
    healthcheck_region = "us-west-2"                                     # --healthcheck-region (region used for health checks)

    # Optional authentication
    role_arn          = "arn:aws:iam::123456789012:role/StrongDMAccess"  # --role-arn (optional)
    role_external_id  = "ext-id-aws-prod-2025"                           # --role-external-id

    # Common networking options
    bind_interface = "default"                                           # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                                  # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-west"        # --egress-filter
    subdomain      = "aws-cloud-prod01"                                  # --subdomain / --bind-subdomain (optional, for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                            # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                             # --secret-store-id (recommended for credentials)

    # Tags
    tags = {                                                             # --tags
      env   = "prod"
      cloud = "aws"
      auth  = "static"
      team  = "devops"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](/admin)​                                          | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​ | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​ | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​             | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                 |                                                                          |                                                                                   |
| {% endtabs %} |                                                                 |                                                                          |                                                                                   |

## Resource Properties

The **AWS** cloud type has the following properties.

<table><thead><tr><th width="200.20025634765625">Property</th><th width="130.1270751953125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td><strong>AWS</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>Access Key ID</strong></td><td>Required</td><td>Access key ID, such as <code>AKIAIOSFODNN7EXAMPLE</code>, from your AWS key pair</td></tr><tr><td><strong>Secret Access Key</strong></td><td>Required</td><td>Secret access key, such as <code>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</code>, from your AWS key pair</td></tr><tr><td><strong>Assume Role ARN</strong></td><td>Optional</td><td>Amazon Resource Name (ARN) role to assume after login (for example, <code>arn:aws:iam::000000000000:role/RoleName</code>)</td></tr><tr><td><strong>Healthcheck Region</strong></td><td>Required</td><td>AWS region that healthchecks should attempt to connect to (for example, <code>us-west-2</code>)</td></tr><tr><td><strong>Assume Role External ID</strong></td><td>Optional</td><td>External ID role to assume after login (for example <code>12345</code>)</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

## Logs

For logs of access to an AWS cloud resource, in the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of users connected through StrongDM. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the AWS cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the desktop app and click the **Upgrade** button.
* The AWS CLI. We support both v1 and v2 but encourage the use of v2.

After installation, users must set up or update the AWS CLI configuration file to include a region, as explained in the [AWS documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html). Once that is done, exit and restart the StrongDM desktop app, and then select the AWS cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use `aws` through StrongDM at their terminal, with the base syntax of `sdm aws` instead of the usual `aws`.

You can use `sdm aws --help` to view example usage and command options:

```shell
NAME:
   sdm aws - aws commands

USAGE:
   sdm aws command [command options] [arguments...]

COMMANDS:
   cli        Execute an AWS CLI Command.
   env        Print environment variables required to access an AWS resource.
   run        Execute an external command with environment variables configured for AWS.
   terraform  Execute terraform commands with a SDM AWS proxy.

OPTIONS:
   --name value     The name of the AWS resource to access. By default if there is only one connected AWS resource, that resource is used. [$SDM_AWS_NAME]
   --help, -h  show help
```

### aws cli

The `aws cli` command is followed by an AWS CLI command that you wish to run against your connected AWS resource. For more information about gcloud CLI commands, see the [AWS CLI documentation](https://docs.aws.amazon.com/cli/latest/).

### aws env

The `aws env` command outputs the environment variables that are required in order to access an AWS resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to AWS.

### aws run

The `aws run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `aws run` would be if you have a pre-existing script for managing AWS resources that uses `aws` commands. Instead of altering the script to work with StrongDM, you could use `aws run shellscript.sh` and run the script.

### --name

If your organization has multiple AWS cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm aws --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single AWS cloud resource connected.

## Error Cases

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# Azure Cloud

Configure and manage Microsoft Azure cloud resources in StrongDM.

## Overview

This guide explains what capabilities StrongDM can provide for managing command line access to the Azure cloud. It also provides setup and configuration instructions to add Azure as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your cloud via the Azure CLI. StrongDM users are authenticated with Azure and granted the level of access that you configure on the Azure side.

In addition to access control and auditing, Azure access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For Azure clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to Azure using a different set of credentials with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to Azure, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple Azure cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to Azure cloud resources based on their context can be used to limit availability of your Azure CLI to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
Note that this is the method by which to set up your Azure cloud as a resource in StrongDM, and manage it with the Azure CLI utility. If you intend to connect to a specific Azure-hosted resource, that resource needs to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

The Azure driver does nothing to limit privilege escalation. It is the responsibility of the resource creator not to provide credentials that can be used to create more credentials.

## Azure Cloud Properties

Azure resources support the Azure CLI (`az`).

In StrongDM, there are two types of Azure cloud resources: **Azure**, which is configured to accept a password; and **AzureCertificate**, which is configured to accept a certificate file.

Both **Azure** and **AzureCertificate** cloud types always bind to port 65113.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have administrator access to your Azure cloud environment and be familiar with the Azure CLI (`az`).
* Your Azure Active Directory account must have permission to create a service principal.
* You must have the Azure CLI [downloaded and installed](https://docs.microsoft.com/en-us/cli/azure/).

## Resource Configuration in Azure

### Generate credentials

1. Log in to Azure (`az login`).
2. In the Azure CLI, create an Azure service principal with the `az ad sp create-for-rbac` command.
3. Decide which type of sign-in authentication the service principal should use (password-based or certificate-based authentication), and follow the instructions provided.

#### **Create a service principal with a password**

1. Use the following command, being sure to replace the placeholders with the actual values:

   ```shell
   az ad sp create-for-rbac --name $<SERVICE_PRINCIPAL_NAME> --role $<ROLE_NAME> --scopes $SCOPES
   ```

   For example, your command may look like this:

   ```shell
   az ad sp create-for-rbac --name ExampleName --role Contributor --scopes /subscriptions/jynb88ey-kqrd-8wqv-fh24-9m9sb05jmb9b
   ```
2. From the output, copy the `appId`, `tenant`, and `password` values. You need them later when setting up the **Azure** cloud type in StrongDM. Note that you can reset the `password` key if you forget it, but you cannot retrieve it later.

   Your example output may look similar to this:

   ```json
   {
   "appId": "myAppId",
   "displayName": "myDisplayName",
   "name": "http://myName",
   "password": "generatedPassword",
   "tenant": "myTenantId"
   }
   ```

#### **Create a service principal with a self-signed certificate**

1. Use the following command with the `--create-cert` argument, being sure to replace the placeholders with the actual values:

   ```shell
   az ad sp create-for-rbac --name $<SERVICE_PRINCIPAL_NAME> --role $<ROLE_NAME> --create-cert
   ```

   For example, your command may look like this:

   ```shell
   az ad sp create-for-rbac --name ExampleName --role Contributor --create-cert
   ```
2. From the output, copy the `appId` and `tenant`. From the PEM file, copy the entirety of the file, which includes the private key and certificate values. You need them later when setting up the **AzureCertificate** cloud type in StrongDM.

   Your example output may look similar to this:

   ```json
   {
   "appId": "myAppId",
   "displayName": "myDisplayName",
   "name": "http://myName",
   "fileWithCertAndPrivateKey": "C:\\myPath\\myNewFile.pem",
   "password": null,
   "tenant": "myTenantId"
   }
   ```

   Example contents of the new PEM file:

   ```shell
   -----BEGIN PRIVATE KEY-----
   MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD0l6E0MVSYnEXD...
   -----END PRIVATE KEY-----
   -----BEGIN CERTIFICATE-----
   MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD0l6E0MVSYnEXD...
   -----END CERTIFICATE-----
   ```

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**.
3. For **Resource Type**, set either **Azure (Password)** (if you are using password-based authentication) or **Azure (Certificate)** (if you are using certificate-based authentication).
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add azure --help` or `sdm admin clouds add azurecert --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```
   $ sdm admin clouds add azure --help
   NAME:
      sdm admin clouds add azure - create Azure (Password) cloud

   USAGE:
      sdm admin clouds add azure [command options] <name>

   OPTIONS:
      --app-id value                             the application ID to authenticate with (required, secret)
      --bind-interface value                     IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --egress-filter value                      apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --password value                           service principal password (required, secret)
      --port-override value                      Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                   proxy cluster id
      --secret-store-id value                    secret store id
      --subdomain value, --bind-subdomain value  DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                               tags e.g. 'key=value,...'
      --template, -t                             display a JSON template
      --tenant-id value                          the tenant ID to authenticate to (required, secret)
      --timeout value                            set time limit for command

   $ sdm admin clouds add azurecert --help
   NAME:
      sdm admin clouds add azurecert - create Azure (Certificate) cloud

   USAGE:
      sdm admin clouds add azurecert [command options] <name>

   OPTIONS:
      --app-id value                             the application ID to authenticate with (required, secret)
      --bind-interface value                     IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate value                        service Principal certificate file, both private and public key (required, secret)
      --egress-filter value                      apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --port-override value                      Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                   proxy cluster id
      --secret-store-id value                    secret store id
      --subdomain value, --bind-subdomain value  DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                               tags e.g. 'key=value,...'
      --template, -t                             display a JSON template
      --tenant-id value                          the tenant ID to authenticate to (required, secret)
      --timeout value                            set time limit for command
   ```
3. Then run `sdm admin clouds add azure|azurecert <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   # Add an Azure (Password) cloud
   $ sdm admin clouds add azure "azure-cloud-prod"
     --app-id "6d3e9e32-2b7c-4ac8-bd61-6f1a0b123abc"
     --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47"
     --password "SuperSecretServicePrincipalPassword!"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_abcdef1234567890"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "azure-cloud-prod01"
     --tags "env=prod,cloud=azure,auth=service-principal,team=platform"
     --timeout 30

   # Add an Azure (certificate) cloud
   $ sdm admin clouds add azurecert "azure-cert-prod"
     --app-id "d10b2c41-5e32-4a89-98f6-45c11f123abc"
     --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47"
     --certificate "/etc/strongdm/certs/azure_sp_cert.pfx"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_abcdef1234567890"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "azure-cert-prod01"
     --tags "env=prod,cloud=azure,auth=certificate,team=platform"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Azure (Password) cloud
resource "sdm_resource" "azure_cloud_prod" {
  azure {
    # Required
    name       = "azure-cloud-prod"                         # <name>
    app_id     = "6d3e9e32-2b7c-4ac8-bd61-6f1a0b123abc"     # --app-id (Service Principal Application/Client ID)
    tenant_id  = "72f988bf-86f1-41af-91ab-2d7cd011db47"     # --tenant-id (Directory/Tenant ID)
    password   = "SuperSecretServicePrincipalPassword!"      # --password (use secret store in production)

    # Common networking options
    bind_interface = "default"                               # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                      # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-east"  # --egress-filter
    subdomain      = "azure-cloud-prod01"                    # --subdomain / --bind-subdomain (optional, VN/HTTP-only)

    # Optional integrations
    proxy_cluster_id = "plc_abcdef1234567890"                # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                 # --secret-store-id (recommended for secrets)

    # Tags
    tags = {                                                 # --tags
      env   = "prod"
      cloud = "azure"
      auth  = "service-principal"
      team  = "platform"
    }
  }
}

# Create Azure (Certificate) cloud
resource "sdm_resource" "azure_cert_cloud_prod" {
  azure_cert {
    # Required
    name        = "azure-cert-prod"                          # <name>
    app_id      = "d10b2c41-5e32-4a89-98f6-45c11f123abc"     # --app-id
    tenant_id   = "72f988bf-86f1-41af-91ab-2d7cd011db47"     # --tenant-id
    certificate = file("/etc/strongdm/certs/azure_sp_cert.pfx")  # --certificate (private + public key)

    # Common networking options
    bind_interface = "default"                               # --bind-interface
    port_override  = -1                                      # --port-override
    egress_filter  = "field:name tag:env=prod tag:region=us-east"  # --egress-filter
    subdomain      = "azure-cert-prod01"                     # --subdomain / --bind-subdomain (optional)

    # Optional integrations
    proxy_cluster_id = "plc_abcdef1234567890"                # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                 # --secret-store-id (recommended for certs)

    # Tags
    tags = {
      env   = "prod"
      cloud = "azure"
      auth  = "certificate"
      team  = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource Properties

{% tabs %}
{% tab title="Azure (Password)" %}
The **Azure (Password)** cloud type has the following properties.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Enter a meaningful name for this resource; this name displays throughout StrongDM; do not include special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Resource Type**     | Required    | **Azure (Password)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **App ID**            | Required    | Set the `appID` copied from the password-based service principal output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Password**          | Required    | Set the `password` key copied from the password-based service principal output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **TenantID**          | Required    | Set the `tenant` copied from the service principal output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Azure (Certificate)" %}
The **Azure (Certificate)** cloud type has the following properties.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Enter a meaningful name for this resource; this name displays throughout StrongDM; do not include special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Resource Type**     | Required    | **Azure (Certificate)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **App ID**            | Required    | Set the `appID` copied from the password-based service principal output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Certificate**       | Required    | Paste the entirety of the PEM file of the service principal with a self-signed certificate, which contains the private key and certificate values                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **TenantID**          | Required    | Set the `tenant` copied from the service principal output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtabs %}         |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

## Logs

For logs of access to an Azure cloud resource, in the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of users connected through StrongDM. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the Azure cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the desktop app and click the **Upgrade** button.
* The `gcloud` command-line tool

After installation, users must exit and restart the desktop app, and then select the Azure cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use the Azure CLI through StrongDM at their terminal, with the base syntax of `sdm az cli` or `sdm azure cli`.

You can use `sdm az --help` (or `sdm azure --help`) to view example usage and command options:

```shell
NAME:
   sdm azure - azure commands

USAGE:
   sdm azure command [command options] [arguments...]

COMMANDS:
   cli  Execute an Azure CLI Command.
   env  Print environment variables required to access an Azure resource.
   run  Execute an external command with environment variables configured to access an Azure resource.

OPTIONS:
   --name value     The name of the Azure resource to access. By default if there is only one connected Azure resource, that resource is used. [$SDM_AZURE_NAME]
   --help, -h  show help
```

### az cli

The `az cli` command is followed by an Azure CLI command that you wish to run against your connected Azure resource. For more information about Azure CLI commands, see the [Azure CLI documentation](https://learn.microsoft.com/en-us/cli/azure/reference-index?view=azure-cli-latest).

### az env

The `az env` command outputs the environment variables that are required in order to access a Azure resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to Azure.

### az run

The `az run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `az run` would be if you have a pre-existing script for managing Azure resources that uses `az` commands. Instead of altering the script to work with StrongDM, you could use `az run shellscript.sh` and run the script.

### --name

If your organization has multiple Azure cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm az --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single Azure cloud resource connected.

### Configuration directories

You should use a unique configuration directory for each Azure resource (`$SDM_HOME/azure-config/<resource-id>` instead of `$SDM_HOME/azure-config`), to isolate the configuration for different resources (and the default configuration), allowing commands against different resources to be safely run concurrently.

## Error Cases

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# GCP (Workforce Identity Federation)

Set up and manage StrongDM resource type for Google Cloud’s Workload Identity Federation (WIF). Enable secure, auditable access using external identities without static service account keys.

## Overview

This guide explains what capabilities StrongDM can provide for managing access to the Google Cloud Platform (GCP) Cloud Console via Workforce Identity Federation (WIF). It also provides setup and configuration instructions to add GCP as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your GCP console via the web browser or through a CLI application such as gcloud. StrongDM users are authenticated with GCP through SAML and granted the level of access that you configure on the GCP side.

In addition to access control and auditing, GCP access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For the two GCP resource types that are powered by WIF, GCP Web Console (Workforce Identity Federation) and GCP CLI/SDK (Workforce Identity Federation), least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource can be tagged with a particular tag that, during the SAML authentication process, lets GCP know what access to grant that user. For more details, see the [Configuration](#configuration) section of this guide.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to GCP, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple GCP cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to GCP resources based on their context can be used to limit availability of your GCP console to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
Note that this is a method by which to set up your GCP cloud, and manage it with `gcloud`. If you intend to connect to a specific Google-hosted resource, that resource needs to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* The GCP drivers do nothing to limit privilege escalation within the platform. It is the responsibility of the resource creator to verify that the roles and permissions that are being assigned during IAM setup are the desired ones.
* Like other web browser console resource types, the logging for "GCP Web Console (Workforce Identity Federation)" resources in StrongDM does not continue beyond authentication when the user is using the web interface of the GCP console. The logs provided by GCP should be used to audit user actions performed while using the GCP console.

## GCP Cloud Properties

GCP supports the `gcloud` command-line tool.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have sufficient privileges in Google Cloud Console to create and manage Workforce Identity pools and providers, and to grant IAM access to new principals.

## Resource Configuration in Google

### GCP setup

1. Prior to GCP setup, in the StrongDM Admin UI, go to **Settings** > **Secrets Management** > **Certificate Authorities** tab. Open your **StrongDM SAML Certificate Authority** and select **Download SAML IDP Metadata**, which downloads an XML file containing the keys you need when setting up your provider in a later step.
2. You need a Workforce Identity pool in Google Cloud to proceed. Go to the Google Cloud Console, and at the organization level, select the **IAM and Admin** section, and then select **Workforce Identity Federation**. If you do not already have a pool you intend to use, create a new Workforce Identity pool by selecting **Create Pool**. Pool names are global to GCP, so you need a unique name for each pool.

{% hint style="info" %}
For more detail on the steps taken within the Google Cloud Console to set up Workforce Identity Federation, see Google's [Workforce Identity Federation](https://cloud.google.com/iam/docs/workforce-identity-federation) documentation.
{% endhint %}

3. Select your pool in the list and then select **Add Provider**. Provider names are only unique within their pool. Add a description if you wish, and upload the XML file you downloaded from StrongDM here.
4. Next you are asked to configure provider mapping. Map the SAML assertions sent from StrongDM to attributes in GCP. The three attributes that need to be mapped are as follows:
   * `google.subject` maps to `assertion.subject`, where the `subject` is the user's email in StrongDM by default, or their Identity Alias if your resource is using Identity Aliases. This is the identifier that is attributed in GCP logs for the user's actions while in the console.
   * `google.display_name` maps to `assertion.attributes.display_name[0]`, where the `display_name` is the display name of the user in StrongDM, in the format "Firstname Lastname".
   * The third attribute that can be mapped is optional, and is a tag and value that is passed in from your StrongDM resource configuration. You can create multiple resources within StrongDM that all represent different levels of access to the same GCP cloud. In order to determine what level of access to give to users connecting through your configured provider, tag the resource that is being used in StrongDM, and then map that tag to an attribute in GCP. Lastly, use that attribute to determine access level for users of that resource. The [Example Scenario](#example-scenario) covers this in more detail. This attribute is in the format `attribute.<VALUE>` and maps to `assertion.attributes.sdm_resource_tag_<TAG>[0]`, where `<TAG>` is the name of the tag you are tagging resources with in StrongDM. You may name the attribute in GCP anything you wish. Naming it identically to the tag is one way to keep the correlation clear but is not required. When you are done, save the provider.

{% hint style="info" %}
The array notation `[0]` in these assertions is required, and the attribute mapping does not function correctly without it.
{% endhint %}

5. Click on the details of your Workforce Identity pool and copy the value of **IAM Principal** from your pool details before you continue.
6. Select **IAM** in the sidebar, and then click **Grant Access**. This is where you grant access to users connecting via your StrongDM resource and being mapped to your provider.
7. In the **New Principals** field, paste the **IAM Principal** value you just copied from your pool. If you are not granting different levels of access based on a tag, this line looks similar to this format: `principalSet://iam.googleapis.com/locations/global/workforcePools/exampleco-test-pool/*`. That is all that is required for this step. If, however, you wish to use multiple resources in StrongDM for this GCP console, each with a differing level of access provided, you should modify this line to include the third attribute that you mapped in step 4. At the end of that value, instead of the `*` after your pool name, type the `<TAG>` that you intend to use for this mapping followed by the value that you are setting up access for right now, such as `/attribute.gcp_role/admin`. See the [Example Scenario](#example-scenario) for more details.
8. Now you can search within the **Select a role** field and find the level of access you wish to map to this StrongDM resource and save the principal. These steps can be repeated any number of times desired to add multiple principals to an individual grant.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set **GCP Web Console (Workforce Identity Federation)**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add gcpConsole --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.\\

   ```
   NAME:
      sdm admin clouds add gcpConsole - create GCP Web Console (Workforce Identity Federation) cloud

   USAGE:
      sdm admin clouds add gcpConsole [command options] <name>

   OPTIONS:
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --http-subdomain value                       This will be used as your local DNS address. (e.g. app-prod1 would turn into http://app-prod1.<your-org-name>.sdm.network/) (required)
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --session-expiry-seconds value               The length of time in seconds console sessions will live before needing to reauthenticate. (default: 0)
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
      --workforce-pool-id value                    The ID of the Workforce Identity Pool in GCP to use for federated SAML authentication. (required)
      --workforce-provider-id value                The ID of the Workforce Identity Provider in GCP to use for federated SAML authentication. (required)

   ```
3. Then run `sdm admin clouds add gcpConsole <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clouds add gcpConsole "gcp-console-wif-prod"
     --http-subdomain "gcp-console-prod01"
     --workforce-pool-id "acme-wif-pool"
     --workforce-provider-id "okta-saml"
     --session-expiry-seconds 3600
     --identity-set-name "GCP WIF Users"
     --identity-alias-healthcheck-username "svc_gcp_health"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-central'
     --proxy-cluster-id "plc_0123456789abcdef"
     --tags "env=prod,cloud=gcp,auth=wif,team=platform"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create GCP Web Console (Workforce Identity Federation)
resource "sdm_resource" "gcp_console_wif_prod" {
  gcp_console {
    # Required
    name                   = "gcp-console-wif-prod"             # <name>
    http_subdomain          = "gcp-console-prod01"              # --http-subdomain
    workforce_pool_id       = "acme-wif-pool"                   # --workforce-pool-id
    workforce_provider_id   = "okta-saml"                       # --workforce-provider-id

    # Optional authentication & session configuration
    session_expiry_seconds  = 3600                              # --session-expiry-seconds
    identity_set_name       = "GCP WIF Users"                   # --identity-set-name
    identity_alias_healthcheck_username = "svc_gcp_health"      # --identity-alias-healthcheck-username (conditional)

    # Common networking options
    bind_interface  = "default"                                 # --bind-interface ("default" | "loopback" | "vnm")
    port_override   = -1                                        # --port-override (-1 = auto-allocate)
    egress_filter   = "field:name tag:env=prod tag:region=us-central"  # --egress-filter

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                   # --proxy-cluster-id

    # Tags
    tags = {                                                    # --tags
      env   = "prod"
      cloud = "gcp"
      auth  = "wif"
      team  = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **GCP Web Console (Workforce Identity Federation)** cloud type has the following properties.

<table><thead><tr><th width="199.83807373046875">Property</th><th width="130.306884765625">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td><strong>GCP Web Console (Workforce Identity Federation)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>HTTP Subdomain</strong></td><td>Required</td><td>What is used as your local DNS address (for example, <code>app-prod1</code> turns into <code>https://app-prod1.&#x3C;your-org-name>.sdm.network/</code>)</td></tr><tr><td><strong>Scopes</strong></td><td>Required</td><td>For the "GCP (Workforce Identity Federation)" resource type only; space-separated scopes that this login should assume into when authenticating (for example, <code>https://www.googleapis.com/auth/cloud-platform</code>)</td></tr><tr><td><strong>Workforce Identity Pool ID</strong></td><td>Required</td><td>ID of the Workforce Identity Pool for GCP to use for federated SAML authentication (such as <code>exampleco-test-pool</code>)</td></tr><tr><td><strong>Workforce Identity Provider ID</strong></td><td>Required</td><td>ID of the Workforce Identity Provider for GCP to use for federated SAML authentication (such as <code>sdm-test-provider</code>)</td></tr><tr><td><strong>Session Expiry Seconds</strong></td><td>Optional</td><td>Length of time, in seconds, of GCP sessions before needing to reauthenticate (for example, <code>3600</code>); must be greater than <code>900</code> and less than <code>43200</code></td></tr><tr><td><strong>Project ID</strong></td><td>Optional</td><td>For the "GCP CLI/SDK (Workforce Identity Federation)" resource type only; the ID of the project that should be forced</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Select <strong>Leased Credentials</strong> to use the user's email when logging their actions within GCP, or <strong>Identity Aliases</strong>, to use Identity Aliases of StrongDM users for log events within GCP</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, enter the username that should be used to verify StrongDM's connection to it</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

{% hint style="warning" %}
While the **Resource Tags** field for any resource is optional, in order to map users of this StrongDM resource to the correct access within your GCP Web Console, you need to add a tag with a value that corresponds to a principal you set up in your GCP Cloud Console's IAM settings. In the [Example Scenario](#example-scenario) section of this guide, the tag used is called `gcp_role`, and one value of it is `admin`, so the tag needed for the resource in that situation is `gcp_role=admin`.
{% endhint %}

## Example Scenario

The organization ExampleCo wishes to provide three levels of access to their GCP Web Console. The names they have chosen for these levels of access are `auditor`, `developer`, and `admin`. They would also like to provide their developers access to the GCP console via the gcloud CLI.

In StrongDM, ExampleCo has three different "GCP Web Console (Workforce Identity Federation)" resources created, all with identical configuration information except for their tags. ExampleCo has chosen to use the tag `gcp_role` to indicate what level of access the users of this resource should have within GCP. When mapping SAML assertions to GCP attributes, their third attribute is `attribute.gcp_role`, mapped to `assertion.attributes.sdm_resource_tag_gcp_role[0]`. Their GCP resources in StrongDM are tagged with `gcp_role=admin`, `gcp_role=developer`, and `gcp_role=auditor` respectively. They also have one GCP (Workforce Identity Federation) resource created and tagged with `gcp_role=developer` to provide developers with gcloud CLI access as well.

In the GCP Web Console, under **IAM** > **Grant Access**, they have three corresponding principals. The string used for each principal is in the format of `principalSet://iam.googleapis.com/locations/global/workforcePools/<POOL_ID>/<TAG>/<TAG_VALUE>`. The three principals that ExampleCo needs are:

* `principalSet://iam.googleapis.com/locations/global/workforcePools/exampleco-test-pool/attribute.gcp_role/admin`
* `principalSet://iam.googleapis.com/locations/global/workforcePools/exampleco-test-pool/attribute.gcp_role/developer`
* `principalSet://iam.googleapis.com/locations/global/workforcePools/exampleco-test-pool/attribute.gcp_role/auditor`

When a user is granted access in StrongDM to a resource, the tag on that resource dictates which principal that user is mapped to, and thus, what access they have while interacting with the GCP Web Console.

In addition to granting access to all of the principals within a pool, or, as in this scenario, all of the principals within the pool that have a particular matching attribute, you may also grant access to particular principals based on their `google.subject`. You can review the Google Cloud documentation on [Principal Identifiers](https://cloud.google.com/iam/docs/principal-identifiers) for more details.

## Logs

For logs of access to a GCP CLI/SDK resource, in the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of users connected through StrongDM. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

For GCP Web Console resources, access is logged, but further activities on the Web Console are not logged by StrongDM. Consult your GCP logs for further information on user activity.

## GCP Web Console Usage

In order for your organization's users to access the GCP Web Console resource via StrongDM, users need to install the following:

* StrongDM Desktop application

Once the user has clicked to connect to the resource in the desktop app, or once the user has run `sdm connect <RESOURCE>` in the CLI, they can connect to the console in any of three ways:

* Click the button in the desktop app to open the resource, and it will open in the web browser.
* Enter the resource's local URL into a web browser. This is `localhost:port` as with other resource types. The port is shown in the desktop app.
* Enter the resource's `*.sdm.network` URL into a web browser. If you are not using the desktop app, you can obtain this URL by running `sdm status` at the command line while logged in to StrongDM.

## GCP CLI/SDK Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the GCP cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the desktop app and click the **Upgrade** button.
* The `gcloud` command-line tool

After installation, users must exit and restart the desktop app, and then select the GCP cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use `gcloud` through StrongDM at their terminal, with the base syntax of `sdm gcp` or `sdm gcloud` instead of the usual `gcloud`.

You can use `sdm gcp --help` (or `sdm gcloud --help`) to view example usage and command options:

```shell
NAME:
   sdm gcp - gcp commands

USAGE:
   sdm gcp command [command options] [arguments...]

COMMANDS:
   cli  Execute a gcloud CLI command against a GCP resource.
   env  Print environment variables required to access a GCP resource.
   run  Execute an external command with environment variables configured to access a GCP resource.

OPTIONS:
   --name value     The name of the GCP resource to access. By default if there is only one connected GCP resource, that resource is used. [$SDM_GCP_NAME]
   --project value  The ID of the GCP project to access for project commands. By default, the project configured in the GCP resource is used. (default: "strongdm") [$SDM_GCP_PROJECT]
   --help, -h       show help
```

### gcp cli

The `gcp cli` command is followed by a gcloud CLI command that you wish to run against your connected GCP resource. For more information about gcloud CLI commands, see the [Google Cloud CLI documentation](https://cloud.google.com/sdk/gcloud/reference).

### gcp env

The `gcp env` command outputs the environment variables that are required in order to access a GCP resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to GCP.

### gcp run

The `gcp run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `gcp run` would be if you have a pre-existing script for managing GCP resources that uses `gcloud` commands. Instead of altering the script to work with StrongDM, you could use `gcp run shellscript.sh` and run the script.

### --name

If your organization has multiple GCP cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm gcp --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single GCP cloud resource connected.

### --project

As a convenience to users, administrators can set a GCP **Project ID** on a resource during configuration. This enables users to skip the `--project` flag when running commands against a GCP CLI/SDK (Workforce Identity Federation) resource. If the **Project ID** field is not filled out during resource configuration, users still need to specify a project in the situations that they normally would when running GCP commands. Either the project number (`95464132584`) or an actual Project ID (`example-favorite-project-1411`) can be used, but Google recommends the Project ID for most cases as the best practice.

## Error cases

Should you attempt to use a cloud resource without the client running, you encounter an error such as the following:

```shell
ERROR: gcloud crashed (TransportError): HTTPSConnectionPool(host='oauth2.googleapis.com', port=443): Max retries exceeded with url: /token (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10c7c9d30>: Failed to establish a new connection: [Errno 61] Connection refused')))
```

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# GCP CLI/SDK (Service Account)

Configure and manage Google Cloud (GCP) resources in StrongDM, including service account key, workload identity federation, and console access workflows.

## Overview

This guide explains what capabilities StrongDM can provide for managing access to the Google Cloud Platform (GCP) Cloud Console via a service account. It also provides setup and configuration instructions to add GCP as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your GCP console via a CLI application such as gcloud. StrongDM users are authenticated with GCP and granted the level of access that you configure on the GCP side.

In addition to access control and auditing, GCP access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For GCP CLI/SDK (Service Account) clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to GCP using a different service account with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to GCP, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple GCP cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to GCP resources based on their context can be used to limit availability of your GCP console to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
Note that this is a method by which to set up your GCP cloud, and manage it with `gcloud`. If you intend to connect to a specific Google-hosted resource, that resource needs to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* There is no SDK, Terraform, Ansible, or other such support for GCP.
* The GCP driver does nothing to limit privilege escalation. It is the responsibility of the resource creator not to provide credentials that can be used to create more credentials.

## GCP Cloud Properties

GCP supports the `gcloud` command-line tool.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have administrator access to your GCP environment and be familiar with `gcloud`.

## Resource Configuration in Google

### Generate credentials

1. In the Google cloud console, [create a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts).
2. Create a service account key (JSON key file) and save it.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set **GCP CLI/SDK (Service Account)**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add gcp --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.\\

   ```
   NAME:
      sdm admin clouds add gcp - create GCP CLI/SDK (Service Account) cloud

   USAGE:
      sdm admin clouds add gcp [command options] <name>

   OPTIONS:
      --bind-interface value                     IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --egress-filter value                      apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --port-override value                      Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                   proxy cluster id
      --scopes value                             Space separated scopes that this login should assume into when authenticating (required)
      --secret-store-id value                    secret store id
      --subdomain value, --bind-subdomain value  DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --svc-keyfile value                        The service account keyfile to authenticate with (required, secret)
      --tags value                               tags e.g. 'key=value,...'
      --template, -t                             display a JSON template
      --timeout value                            set time limit for command
   ```
3. Then run `sdm admin clouds add gcp <RESOURCE_NAME>` and set all required properties with their values. For example:

   <pre><code><strong>$ sdm admin clouds add gcp "gcp-cli-sdk-prod"
   </strong>  --svc-keyfile "/etc/strongdm/keys/gcp-service-account.json"
     --scopes "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-central'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "gcp-cli-prod01"
     --tags "env=prod,cloud=gcp,auth=service-account,team=platform"
     --timeout 30
   </code></pre>
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create GCP CLI/SDK (Service Account) cloud
resource "sdm_resource" "gcp_cli_sdk_prod" {
  gcp {
    # Required
    name         = "gcp-cli-sdk-prod"                            # <name>
    svc_keyfile  = file("/etc/strongdm/keys/gcp-service-account.json")  # --svc-keyfile (use secret store in production)
    scopes       = "https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/userinfo.email"  # --scopes

    # Common networking options
    bind_interface = "default"                                   # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                          # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-central"  # --egress-filter
    subdomain      = "gcp-cli-prod01"                            # --subdomain / --bind-subdomain (optional, VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                    # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                     # --secret-store-id (recommended for keyfiles)

    # Tags
    tags = {                                                     # --tags
      env   = "prod"
      cloud = "gcp"
      auth  = "service-account"
      team  = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource Properties

The **GCP CLI/SDK (Service Account)** cloud type has the following properties.

<table><thead><tr><th width="200.1505126953125">Property</th><th width="129.8856201171875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Enter a meaningful name for this resource; this name displays throughout StrongDM; do not include special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td><strong>GCP CLI/SDK (Service Account)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>Service Account Keyfile (JSON)</strong></td><td>Required</td><td>Either paste the contents of the service account key file (JSON) that you saved when you created the Google Cloud service account, or import the key file</td></tr><tr><td><strong>Scopes</strong></td><td>Required</td><td>Enter the access scope(s) (for example, <code>https://www.googleapis.com/auth/cloud-platform</code>) to allow authentication to Google cloud APIs. If setting multiple scopes, separate them with a space</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

## Logs

In the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of the users who accessed the GCP resource. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the GCP cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the desktop app and click the **Upgrade** button.
* The `gcloud` command-line tool

After installation, users must exit and restart the desktop app, and then select the GCP cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI. Once connected, users can use `gcloud` through StrongDM at their terminal, with the base syntax of `sdm gcp` or `sdm gcloud` instead of the usual `gcloud`.

You can use `sdm gcp --help` (or `sdm gcloud --help`) to view example usage and command options:

```shell
NAME:
   sdm gcp - gcp commands

USAGE:
   sdm gcp command [command options] [arguments...]

COMMANDS:
   cli  Execute a gcloud CLI command against a GCP resource.
   env  Print environment variables required to access a GCP resource.
   run  Execute an external command with environment variables configured to access a GCP resource.

OPTIONS:
   --name value     The name of the GCP resource to access. By default if there is only one connected GCP resource, that resource is used. [$SDM_GCP_NAME]
   --project value  The ID of the GCP project to access for project commands. By default, the project configured in the GCP resource is used. (default: "strongdm") [$SDM_GCP_PROJECT]
   --help, -h       show help
```

### gcp cli

The `gcp cli` command is followed by a gcloud CLI command that you wish to run against your connected GCP resource. For more information about gcloud CLI commands, see the [Google Cloud CLI documentation](https://cloud.google.com/sdk/gcloud/reference).

### gcp env

The `gcp env` command outputs the environment variables that are required in order to access a GCP resource. This output is a similar format of the output of the standard `env` command, but only contains the relevant environment variables for connecting to GCP.

### gcp run

The `gcp run` command is followed by a command that you wish to run against the connected resource, which is sent along with the necessary environment variables. An example of a use for `gcp run` would be if you have a pre-existing script for managing GCP resources that uses `gcloud` commands. Instead of altering the script to work with StrongDM, you could use `gcp run shellscript.sh` and run the script.

### --name

If your organization has multiple GCP cloud resources, and you are connected to more than one at once, you may specify a `--name` value in commands in order to specify which you intend to execute the command on. For example, `sdm gcp --name <RESOURCE_NAME> cli`. The flag must come before the `cli` portion of the command in order to preserve the ability to use the command as normal with a single GCP cloud resource connected.

### --project

As a convenience to users, administrators can set a GCP **Project ID** on a resource during configuration. This enables users to skip the `--project` flag when running commands against a GCP CLI/SDK (Workforce Identity Federation) resource. If the **Project ID** field is not filled out during resource configuration, users still need to specify a project in the situations that they normally would when running GCP commands. Either the project number (`95464132584`) or an actual Project ID (`example-favorite-project-1411`) can be used, but Google recommends the Project ID for most cases as the best practice.

## Error Cases

Should you attempt to use a cloud resource without the client running, you encounter an error such as the following:

```shell
ERROR: gcloud crashed (TransportError): HTTPSConnectionPool(host='oauth2.googleapis.com', port=443): Max retries exceeded with url: /token (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10c7c9d30>: Failed to establish a new connection: [Errno 61] Connection refused')))
```

Should you attempt to use a cloud resource when you are not connected to it, StrongDM's CLI commands warn you. You can get around this warning in some contexts (for example, by setting environment variables in your terminal). In these cases, you may encounter SSL errors, and nothing happens when you run commands.


# Microsoft Entra ID

Set up and manage StrongDM cloud resources for Microsoft Entra ID (Azure AD). Enable centralized access, session auditing, and various auth flows for Microsoft cloud services.

{% hint style="info" %}
This feature is part of the Enterprise plan. If it is not enabled for your organization, please contact StrongDM at the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).
{% endhint %}

## Overview

This guide explains what capabilities StrongDM can provide for the management of privileges in Microsoft Entra ID. It also provides setup and configuration instructions to add a Microsoft Entra ID cloud resource in StrongDM and begin using StrongDM to manage Entra ID groups for your StrongDM users. StrongDM users in your organization can be granted privilege levels for a Microsoft Entra ID resource. Those privilege levels add them to Entra ID groups, so that when the users use Entra ID to authenticate to services as normal, their access is elevated based on those groups for a limited period of time.

Microsoft Entra ID resources in StrongDM can be used to support the use case of Just-in-Time access. Admins have the choice between providing temporary access directly to particular users within the StrongDM organization, or granting JIT access through access workflows. StrongDM users are able to use these access workflows set up by an admin to request various levels of access that correspond to Entra ID group membership. For more details on how Access Workflows function, see the [Access Workflows](/admin/access/access-workflows) section.

## Limitations

* The Microsoft Entra ID resource type is unique. No end user connections are facilitated for Microsoft Entra ID resources. Instead, users can be directly added to or can request to be added to Entra ID groups via StrongDM’s privilege levels. They can then authenticate to services using Entra ID as they normally do, but with elevated permissions provided by the Entra ID groups.
* Currently, Microsoft Entra ID privilege levels cannot be used in policies.
* Currently, Microsoft Entra ID resources cannot be added to access rules within roles or dynamic access rules in workflows.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have administrator access to your Microsoft Entra Admin Center.
* Your StrongDM organization must have Enterprise capabilities.

## Privilege Levels

Privilege levels for the Microsoft Entra ID resource type are slightly different than the [Kubernetes privilege levels](/admin/resources/clusters/kubernetes-management) offered by StrongDM. The functionality is the same for the day-to-day admin of StrongDM, selecting privilege levels to assign to users who access the resource, or approving and denying requests for access to the resource. However, for Microsoft Entra ID resource types, privilege levels represent Entra ID groups that the user is added to (or removed from) within Entra ID.

Privilege levels are required in order for the Microsoft Entra ID resource to be useful, as StrongDM is not facilitating user authentication and connection with Azure. StrongDM privilege levels assign the user within Entra ID with groups, which an administrator can use to provide further privileges to the user through Entra ID groups.

## Node Configuration

You must configure your node to be able to authenticate to Microsoft Entra ID and assign Entra ID groups to your resources. This can be done either using a node hosted on an Azure VM, or by creating an enterprise application to connect your node hosted elsewhere to the Azure portal. If you wish to perform IAM discovery using the Microsoft Management API, you should also grant those permissions.

Configure your node using one of these:

* [Configure your Azure VM node (hosted in Azure)](#configure-your-azure-vm-node)
* [Configure your node with an enterprise application (hosted elsewhere)](#configure-your-node-with-an-enterprise-application)

If you intend to use IAM discovery to help manage groups, follow these steps as well:

* [Microsoft Management API permissions for discovery of IAM](#microsoft-management-api-permissions-for-discovery-of-iam)

### Configure your Azure VM node

You can use managed identities to attach permissions to your Azure VM node.

1. In the Azure portal, go to the **Overview** blade of your node, and then go to **Security > Identity**.
2. Switch the status of the **System Assigned** identity to **On** and wait for it to provision.
3. Azure does not allow you to directly set permissions on a managed identity via the Admin portal, so you will need to run a powershell script to grant the relevant permissions:
   * Microsoft Graph `Directory.Read.All`: This permission allows your node to get all of the groups needed by name.
   * Microsoft Graph `GroupMember.ReadWrite.All`: This permission allows your node to put your users into (and remove them from) the groups found.
   * **(optional)** Microsoft Graph `RoleManagement.ReadWrite.Directory`: This permission allows your node to manage role-assignable groups. This permission is necessary if you are planning on managing role-assignable groups.
4. Run the following powershell script, replacing `<NODE_VM_NAME>` with the name of the Azure VM running your node.

   ```powershell
   Connect-AzureAD

   $GraphAppId = "00000003-0000-0000-c000-000000000000"
   $VMName = "<NODE_VM_NAME>"
   $AppPermissions = "Directory.Read.All","GroupMember.ReadWrite.All","RoleManagement.ReadWrite.Directory"

   $GraphApp = Get-AzureADServicePrincipal -Filter "appId eq '$GraphAppId'"
   $ManagedIdentity = Get-AzureADServicePrincipal -Filter "displayName eq '$VMName'"

   foreach ($AppPermission in $AppPermissions)
   {
      $Role = $GraphApp.AppRoles | Where-Object {$_.Value -eq $AppPermission}
      $AppRoleAssignment = New-AzureADServiceAppRoleAssignment -ObjectId $ManagedIdentity.ObjectId -PrincipalId $ManagedIdentity.ObjectId -ResourceId $GraphApp.ObjectId -Id $Role.Id
      $AppRoleAssignment
   }
   ```
5. Search for "tenant" in the top bar, go to the **Tenant Properties** view, and copy your **Tenant ID**.

You should then [set up your Microsoft Entra ID resource in StrongDM](#set-up-the-resource-in-strongdm).

### Configure your node with an enterprise application

You can also use a node that is not an Azure VM by adding it as an enterprise application in the Azure portal and using credentials to authenticate.

1. In the Azure portal, go to **Enterprise Applications** > **New application** > **Create your own application**.
2. In the dialog, for the **What's the name of your app?** field, enter a useful name. For **What are you looking to do with your application?**, select **Register an application to integrate with Microsoft Entra ID**. Then, select **Create**.
3. The **Name** field is populated with what you wrote in the previous view. You can choose who can use the application and a **Redirect URI** based on your needs, and then select **Register**.
4. Back in the **Enterprise Applications** view, you should be able to search for your new application name and open it.
5. Under **Security** > **Permissions**, select **Application Registration** in the **Permissions** section.
6. Select **Add a permission**, and in the dialog, choose **Microsoft Graph** and then choose **Application permissions**.
7. Search for and add the read and write permissions that you need:
   * Microsoft Graph `Directory.Read.All`: This permission allows your node to get all of the groups needed by name.
   * Microsoft Graph `GroupMember.ReadWrite.All`: This permission allows your node to put your users into (and remove them from) the groups found.
   * **(optional)** Microsoft Graph `RoleManagement.ReadWrite.Directory`: This permission allows your node to manage role-assignable groups. This permission is necessary if you are planning on managing role-assignable groups.
8. After adding your permissions, you must check the box that says **Grant admin consent for** and confirm with **Yes**.
9. Still in the **Application Registration**, go to **Certificates and secrets** in the sidebar and in the **Client secrets** tab, select **New client secret**.
10. In the dialog, enter a **Description** and **Expires** date for your credential as desired.
11. Copy and record safely the **Value**, which you will need later.
12. Return to your application overview for the enterprise application and copy the **Application ID**.
13. Search for "tenant" and go to the **Tenant Properties** view to copy your **Tenant ID**.
14. Leaving Azure, connect to your node and set the following environment variables with the corresponding values that you copied (retain the Tenant ID for StrongDM configuration as well):

* `AZURE_TENANT_ID=<TENANT_ID>`: The **Tenant ID** you copied previously
* `AZURE_CLIENT_ID=<APPLICATION_ID>`: The **Application ID** you copied previously
* `AZURE_CLIENT_SECRET=<CLIENT_SECRET_VALUE>`: The client secret **Value** you copied previously

You should then [set up your Microsoft Entra ID resource in StrongDM](#set-up-the-resource-in-strongdm).

### Microsoft Management API permissions for discovery of IAM

Microsoft Management API permissions are only required if you would also like to discover your tenant's IAM structure to aid in selecting groups to provision. These will only be used when the resource in StrongDM is marked `Discovery Enabled`.

Management API permissions are granted via role assignments. In order for discovery to function, these will need to be assigned at the **tenant root management group level**. You should be able to find either your Application or Managed Identity when searching for members to assign.

It is recommended to create a custom role with just these permissions to allow for least-privilege access, but if you would like to use a Built In Role `Security Reader` contains all the necessary permissions.

The required permissions are:

```json
"permissions": [
    {
        "actions": [
            "Microsoft.Authorization/roleAssignments/read",
            "Microsoft.Management/managementGroups/read",
            "Microsoft.Resources/subscriptions/resourceGroups/read",
            "Microsoft.Authorization/roleDefinitions/read"
        ],
        "notActions": [],
        "dataActions": [],
        "notDataActions": []
    }
]
```

## Set up Microsoft Entra ID in StrongDM

### Verify the node is reachable

If you look at the Microsoft Entra ID resource in the Admin UI, under **Diagnostics**, since your gateway is running with credentials the healthcheck should already be successful. The nodes in the diagnostics list that are healthy are the ones with access.

If you have set up a proxy cluster to communicate with Azure, the healthcheck should be successful as long as you have assigned the proxy cluster to the resource.

You can also tag your nodes with the tag `sdm admin nodes update <NODE_ID> --tags sdm__azure_tenant=<TENANT_ID>` (note the two underscores between `sdm` and `azure`). This forces StrongDM to use this node (and any other node tagged in this manner) to connect, regardless of the health status of it or any other node that has been configured to access Azure.

### Set up Identity Aliases

1. Set up an Identity Set for use with your Microsoft Entra ID resource in the Admin UI at **Principals** > **Identity Sets** > **Add set**. See the [Identity Alias](/admin/principals/identity-alias) section for more information on Identity Sets.
2. Open the **Principals** > **Users** page, find a user you wish to add to this Identity Set, open the user’s details page, and choose the **Identity Aliases** tab.
3. Select **Add Alias**, and then fill out the alias as the user’s exact Microsoft User principal name, such as `alice.glick@example.onmicrosoft.com`.

When you set up the Microsoft Entra ID resource with StrongDM and select this Identity Set, the StrongDM user can be added to this resource with various privilege levels to manage the groups of the corresponding user in Entra ID.

### Add the Resource in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set **Microsoft Entra ID**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add entraID --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.\\

   ```
   NAME:
      sdm admin clouds add entraID - create Microsoft Entra ID cloud

   USAGE:
      sdm admin clouds add entraID [command options] <name>

   OPTIONS:
      --discovery-enabled          Enable discovery for the tenant.
      --egress-filter value        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --group-names value          Enter one or more group names to match. Use commas to separate multiple names. Supports wildcards (e.g., M365 Admin*). Only groups with matching names will be discovered.
      --identity-set-id value      (required)
      --identity-set-name value    set the identity set by name
      --management-group-id value  Restrict discovery to groups associated with this management group. Useful for multi-subscription organizations with a shared hierarchy.
      --privilege-levels value     comma separated list of Entra Group Names (conditional)
      --proxy-cluster-id value     proxy cluster id
      --resource-group-id value    Restrict discovery to groups associated with a resource group.
      --subscription-id value      Restrict discovery to groups linked to this Azure subscription. Use this if you only want groups associated with a specific subscription.
      --tags value                 tags e.g. 'key=value,...'
      --template, -t               display a JSON template
      --tenant-id value            the tenant to authenticate with (required)
      --timeout value              set time limit for command
   ```
3. Then run `sdm admin clouds add entraID <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clouds add entraID "entra-id-prod"
     --tenant-id "72f988bf-86f1-41af-91ab-2d7cd011db47"
     --identity-set-name "Entra ID Admins"
     --discovery-enabled
     --group-names "M365 Admins,AzureOps,Finance*"
     --management-group-id "mg-1234abcd5678efgh"
     --subscription-id "sub-01234567-89ab-cdef-0123-456789abcdef"
     --resource-group-id "rg-prod-core"
     --privilege-levels "Entra Admins,Helpdesk Support"
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_abcdef0123456789"
     --tags "env=prod,cloud=azure,auth=entra-id,team=platform"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Microsoft Entra ID cloud
resource "sdm_resource" "entra_id_prod" {
  entra_id {
    # Required
    name             = "entra-id-prod"                           # <name>
    tenant_id        = "72f988bf-86f1-41af-91ab-2d7cd011db47"    # --tenant-id
    identity_set_name = "Entra ID Admins"                        # --identity-set-name (or use identity_set_id)

    # Optional discovery configuration
    discovery_enabled   = true                                   # --discovery-enabled
    group_names         = "M365 Admins,AzureOps,Finance*"        # --group-names (comma-separated, supports wildcards)
    privilege_levels    = "Entra Admins,Helpdesk Support"        # --privilege-levels (conditional)
    management_group_id = "mg-1234abcd5678efgh"                  # --management-group-id (optional)
    subscription_id     = "sub-01234567-89ab-cdef-0123-456789abcdef"  # --subscription-id (optional)
    resource_group_id   = "rg-prod-core"                         # --resource-group-id (optional)

    # Common networking options
    egress_filter   = "field:name tag:env=prod tag:region=us-east" # --egress-filter
    proxy_cluster_id = "plc_abcdef0123456789"                      # --proxy-cluster-id

    # Tags
    tags = {                                                     # --tags
      env   = "prod"
      cloud = "azure"
      auth  = "entra-id"
      team  = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

#### Resource properties

The **Microsoft Entra ID** cloud type has the following properties.

<table><thead><tr><th width="200.1363525390625">Property</th><th width="130.4183349609375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>A meaningful name for this resource; displays throughout StrongDM; no special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cloud Type</strong></td><td>Required</td><td><strong>Microsoft Entra ID</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to “None (use gateways)”; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to be used for Entra ID group manipulation</td></tr><tr><td><strong>Discovery Enabled</strong></td><td>Optional</td><td>Enable discovery for this resource</td></tr><tr><td><strong>Tenant ID</strong></td><td>Required</td><td>Azure Tenant ID</td></tr><tr><td><strong>Subscription ID</strong></td><td>Optional</td><td>Subscription ID restricts available discovered groups to those within a subscription; appears when discovery is enabled</td></tr><tr><td><strong>Management Group ID</strong></td><td>Optional</td><td>Management Group ID restricts available discovered groups to those within a management group; appears when discovery is enabled</td></tr><tr><td><strong>Resource Group ID</strong></td><td>Optional</td><td>Resource Group ID restricts available discovered groups to those within a resource group; appears when discovery is enabled</td></tr><tr><td><strong>Group Names</strong></td><td>Optional</td><td>Filter string(s) that restrict available discovered groups, comma separated; supports wildcards such as "M365 Admin*"; appears when discovery is enabled</td></tr><tr><td><strong>Privilege Levels</strong></td><td>Required</td><td>Exact names of the Entra ID groups that you want to provision access to, comma separated, such as <code>sdm_group1,sdm_group2</code>; appears when discovery is not enabled</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Identity Set to map to use to map StrongDM users to Entra ID users</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">tags</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

## Manage Entra ID Group Membership With StrongDM

There are currently two ways to grant privileges to StrongDM users on an Microsoft Entra ID resource. You can grant temporary access in the Admin UI by going to **Principals** > **Users** and selecting the user, and then navigating to the **Entitlements** tab and selecting **Grant Temporary Access**.

Alternatively, you can create an [access workflow](/admin/access/access-workflows) that facilitates JIT access for users using a static access rule that specifies the Microsoft Entra ID resource. Users can then request various privilege levels for the resource and be approved or denied by configured approvers.

At this time, granting and revoking privilege levels via dynamic access rules or directly through StrongDM roles is not available.

StrongDM periodically verifies that the user is still a member of the relevant Entra ID group(s), and re-adds them if necessary, until the access grant in StrongDM expires or is revoked.

### Verifying group membership additions or revocations

Once a user has been granted a privilege level, you can verify this by checking your Entra ID group membership directly and see that the user is now in the corresponding group.

If they are removed from the privilege level in StrongDM, they are also removed from the group in Entra ID. Note that revocations also work when the group was originally granted outside of StrongDM.

For example, if Alice was added to the group `engineers1` directly in Entra ID and then later was given a privilege level in StrongDM that corresponds to the `engineers1` group as well, when her access in StrongDM is revoked, she is removed from the Entra ID group.

### Connection through CLI

When a user requests access to an Microsoft Entra ID resource via an access workflow through the CLI, they need to append a `--entraGroup` option to their command:

```sh
sdm access to <RESOURCE_ID> --duration 10m --reason "example reason for request" --entraGroup sdmGroup1
```

## Logs

When a user is given a privilege level for a Microsoft Entra ID resource, StrongDM Activity logs reflect this with events that say `User external grant provisioned`.

Activity log events when a user privilege level for a Microsoft Entra ID resource is revoked in StrongDM say `User external grant revoked`.

No user actions against Microsoft Entra ID resources are logged, since StrongDM does not facilitate connections or authentication for users.

## Connect to Microsoft Entra ID

In summary, before users can connect to the Entra ID services with the groups that are provided through privilege levels, the following things must occur:

* The node is given correct Azure permissions.
* An Identity Set is configured and Identity Aliases are added to users.
* The Microsoft Entra ID resource is configured in StrongDM, using the Identity Set and with configured privilege levels that correspond to existing Entra ID groups.
* Temporary access is granted to user(s) or an access workflow is set up to allow requests for access.

Once the resource is configured correctly, and once the user is assigned privilege levels within StrongDM or requests and is granted them, the user should be able to authenticate and connect as normal, now with escalated privileges via the additional Entra ID groups.

Using the StrongDM Desktop application or CLI to launch the resource is not necessary, as the user was directly added to Entra ID groups. The user can simply go to authenticate to various services using Entra ID as normal.

## Troubleshooting

* Healthchecks for this resource type get and check the Azure token for permissions, so any error messages or failed routes through nodes should appear in the Diagnostics tab in the Admin UI.
* If you’re having intermittent errors converging, try tagging nodes that you are certain are healthy with `sdm__azure_tenant=<TENANT_ID>`. This forces those healthy nodes to be selected, and you can see if your connections work when using only the healthy nodes.
* If your users are failing to be provisioned or revoked, check the activity logs for any “user external grant provision failed” or “user external grant revocation failed” logs.


# Okta

Set up and manage StrongDM cloud resources for Okta Administrator Console. Enable centralized access, session auditing, and various auth flows for Okta Administrator Console users.

{% hint style="info" %}
This feature is part of the Enterprise plan. If it is not enabled for your organization, please contact StrongDM at the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).
{% endhint %}

## Overview

This guide explains what capabilities StrongDM can provide for the management of privileges in Okta's Administrator Console. It also provides setup and configuration instructions to add an Okta Groups resource in StrongDM and begin using StrongDM to manage groups within Okta for your StrongDM users. StrongDM users in your organization can be granted privilege levels in StrongDM for an Okta Groups resource. Those StrongDM privilege levels add them directly to the corresponding groups in Okta, so that when the users use Okta Administrator Console or apps federated through Okta, their access is elevated based on those groups for a limited period of time. This allows StrongDM admins to manage access to Okta Admin Console or Okta-authenticated SaaS apps by adding and removing Okta groups from users using StrongDM.

Okta resources in StrongDM can be used to support the use case of Just-in-Time access. Admins have the choice between providing temporary access directly to particular users within the StrongDM organization, or granting JIT access through access workflows. StrongDM users are able to use these access workflows set up by an admin to request various levels of access that correspond to Okta group membership. For more details on how Access Workflows function, see the [Access Workflows](/admin/access/access-workflows) section.

## Limitations

* The Okta Groups resource type does not require users to go through a StrongDM proxy (a gateway, relay, or proxy worker) to get access to Okta, the groups within Okta, or downstream apps federated through Okta. Instead, the users' network and authentication path to Okta remains unchanged. Instead, their groups within Okta are manipulated to allow them more or less access as required. This proxy-less approach allows you to use StrongDM to grant or revoke access to privileged resources controlled by Okta without disrupting current authentication paths."
* Currently, Okta Groups privilege levels cannot be used in policies.
* Currently, Okta Groups resources cannot be added to access rules within roles or dynamic access rules in workflows.
* Privilege levels must be configured on the Okta Groups resource in order for it to work.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have Super Administrator access to your Okta Administrator Console.
* Your StrongDM organization must have the Enterprise plan enabled.

## Privilege Levels

You must configure privilege levels in your Okta Groups resources before you can grant temporary access and before users can request access to Okta groups. This is because StrongDM does not grant access to your entire Okta tenant, but to specific groups within Okta. StrongDM privilege levels correspond to Okta groups. When a user in StrongDM is granted a privilege level on the Okta Groups resource, their Okta user is added to that corresponding group, giving them whatever access that Okta group provides in your organization.

This allows admins to manipulate access, using Okta groups, through StrongDM, and provides a framework for users to request particular Okta groups for limited periods of time through the use of [Access Workflows](/admin/access/access-workflows) in a flow that looks like this:

1. Set up Okta.
2. Set up the Okta Groups resource in StrongDM and map privilege levels in StrongDM to groups in Okta.
3. Set up a StrongDM Access Workflow, select the Okta Groups resource, and choose which privilege levels (mapped to groups) you'd like to make available for users to request access to.

Additionally, admins can create standing access roles including the Okta Groups resource and choose particular privilege levels to assign to the role, as well.

## Set up Okta and Nodes

There are two options for setup: Okta API service application or API key. The Okta API service integration is the more secure option and does not depend on a user account's existence or permissions. The API key method is simpler to set up, but breaks if the user who created it ceases to exist in the organization.

### Okta API service setup

1. In the Okta Admin Console, navigate to **Applications** in the sidebar and then select **Create App Integration**.
2. Choose "API Services" for the sign-in method, then click next.
3. Name the integration and save it.
4. In the app integration configuration screen, scroll down to the **General settings** section and select **Edit**.
5. Disable **Require Demonstrating Proof of Possession (DPoP) header in token requests** and then select **Save** in the section's settings.
6. In the **Public keys** section select **Edit**.
7. Select **Add public key**, generate a new key, and copy the PEM value to your clipboard. Select **Done** and then **Save** the section's settings. Keep the key in your clipboard or save it somewhere secure.
8. In the **Client Credentials** section, select **Edit**.
9. Switch from "Client secret" to "Public key / Private key", and then **Save** the section's settings.

{% hint style="info" %}
The Client ID at the top of this screen is needed in future steps. Save it somewhere easily accessible, or keep the tab open. The organization URL is also be needed. This is your organization's subdomain at Okta. In the Admin Console, it can be found in the address bar, and by removing `-admin`. For example, if the bar reads `https://example-co-admin.okta.com` the actual value is `https://example-co.okta.com`.
{% endhint %}

10. Next, go to the **Admin roles** tab and grant the **Super Administrator** role. The abilities of the integration are limited by the scopes set in the next step.

{% hint style="info" %}
The scopes assigned in the next step reduce the scope of the effective privileges StrongDM is granted through this Super Administrator role, allowing only the permissions needed to read groups, roles, and apps and to manage groups so that users get JIT access as configured by the StrongDM admin.
{% endhint %}

11. Go to the **Okta API Scopes** tab and grant the following scopes:

* `okta.groups.manage`
* `okta.users.read`
* `okta.apps.read`
* `okta.roles.read`

12. Next, log in to the StrongDM node (proxy worker, gateway, or relay) you intend to use to connect to the Okta Groups resource. Open the file that you use to set StrongDM environment variables. This is often `/etc/sysconfig/sdm-proxy` (or `sdm-worker` if it is a proxy worker).
13. Set the following environment variables on the node:

```sh
OKTA_CLIENT_ORGURL="https://<OKTA_DOMAIN>"
OKTA_CLIENT_CLIENTID="<CLIENT_ID>"
OKTA_CLIENT_PRIVATEKEY="<PRIVATE_KEY>"
```

For example:

```sh
OKTA_CLIENT_ORGURL="https://example-co.okta.com"
OKTA_CLIENT_CLIENTID="12345678"
OKTA_CLIENT_PRIVATEKEY="-----BEGIN RSA PRIVATE KEY-----
MIIBOgIBAAJBALk9Z2Z0c2FtcGxlZmFrZWtleWRhdGEwMDAwMDAwMDAwMDAw
MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw
AgMBAAECQFZha2VwZW1rZXlmb3Jkb2N1bWVudGF0aW9ub25seQ==
-----END RSA PRIVATE KEY-----"
```

{% hint style="info" %}
If your Okta API Service integration has multiple keys listed in the **Public keys** section, you also need to add a key ID environment variable to differentiate which key is being used. The value can be obtained in the **Public keys** section of the Okta integration config screen.

```sh
OKTA_CLIENT_PRIVATEKEYID="<KEY_ID>"
```

{% endhint %}

14. Add an `okta.yaml` file on the node at the standard `~/.okta/okta.yaml` location.

```yaml
okta:
  client:
    connectionTimeout: 30 # seconds
    authorizationMode: "PrivateKey"
    scopes:
    - okta.groups.manage
    - okta.users.read
    - okta.apps.read
    - okta.roles.read
    rateLimit:
      maxRetries: 4
```

{% hint style="info" %}
The values for timeout and retries are suggested starting values and can be adjusted based on your organization's needs. For example, if you use the Okta Groups discovery feature and want to discover many groups, you may want to raise the number of retries if StrongDM doesn't discover all of your groups successfully. Additionally, if you have many groups, consider adding name filters in the Okta discovery feature to reduce the size of the response required from Okta and avoid Okta API throttling.
{% endhint %}

Your Okta Admin Console and node should be configured successfully.

### API key setup

API key setup is simpler, requiring you to generate and save a token from your Admin Console user account, and set three environment variables on your node(s).

1. Log in to the Okta Admin Console as the user whose key you would like to use, and navigate to **Security** > **API** and to the **Tokens** tab.
2. Select the **Create token** button, and fill in a name.
3. For origins, choose the value that makes the most sense to your setup. **Any IP** is the broadest, but if you know the IP or range of your node(s) you can choose a more granular value.
4. Copy the API key presented.
5. Next, log in to the node (proxy worker, gateway, or relay) you intend to use to connect to the Okta Groups resource. Open the file that you use to set StrongDM environment variables. This is often `/etc/sysconfig/sdm-proxy` (or `sdm-worker` if it is a proxy worker).
6. Set the following environment variables on the node:

```sh
OKTA_CLIENT_ORGURL="https://<OKTA_DOMAIN>"
OKTA_CLIENT_AUTHORIZATIONMODE="SSWS"
OKTA_CLIENT_TOKEN="<API_TOKEN>"
```

For example:

```sh
OKTA_CLIENT_ORGURL="https://example-co.okta.com"
OKTA_CLIENT_AUTHORIZATIONMODE="SSWS"
OKTA_CLIENT_TOKEN="00fakeOktaApiToken_9XKpLQmR7dA2CwYH"
```

{% hint style="info" %}
The organization URL is your organization's subdomain at Okta. In the Admin Console, it can be found in the address bar, and by removing `-admin`. For example, if the bar reads `https://example-co-admin.okta.com` the actual value is `https://example-co.okta.com`.
{% endhint %}

Your Okta Admin Console and node should be configured successfully.

## Configure the Okta Groups Resource in StrongDM

### Verify the node is reachable

If you look at the Okta Groups resource in the Admin UI, under **Diagnostics**, since your node is running with credentials the healthcheck should already be successful. The nodes in the diagnostics list that are healthy are the ones with access.

If you have set up a proxy cluster to communicate with Okta, the healthcheck should be successful as long as you have assigned the proxy cluster to the resource.

You can also tag your nodes with a tag `sdm admin nodes update <NODE_ID> --tags sdm__okta_orgurl=<OKTA_DOMAIN>` (note the two underscores between `sdm` and `okta`). This forces StrongDM to use this node (and any other node tagged in this manner) to connect, regardless of the health status of it or any other node that has been configured to access Okta.

### Set up Identity Aliases

{% hint style="info" %}
The default "email" Identity Set is available for use if your StrongDM user emails match your Okta user emails perfectly. If they don't match, you will want to create an Identity Set so that you can add the email used in Okta to each user's profile in StrongDM, in order to map them correctly.
{% endhint %}

1. Set up an Identity Set for use with your Okta Groups resource in the Admin UI at **Principals** > **Identity Sets** > **Add set**. See the [Identity Alias](/admin/principals/identity-alias) section for more information on Identity Sets.
2. Open the **Principals** > **Users** page, find a user you wish to add to this Identity Set, open the user’s details page, and choose the **Identity Aliases** tab.
3. Select **Add Alias**, and then fill out the alias as the user’s exact Okta User email, such as `alice.glick@example.com`.

When you set up the Okta Groups resource with StrongDM and select this Identity Set, the StrongDM user can be added to this resource with various privilege levels to manage the groups of the corresponding user in Okta.

### Add the Resource in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**.
3. For **Resource Type**, set **Okta Groups**.
4. Set all other required [resource properties](#resource-properties). If you choose to use discovery, the integration attempts to discover Okta groups in your organization and provide those as privilege level options in StrongDM. You can limit the number of groups discovered by StrongDM by providing name filters. For every filter string you provide, StrongDM fetches groups with names that contain that string. You can use asterisks as wildcards, letting you find the group "SuperAdminStrongDM" by providing the string "Admin". You can provide multiple name strings separated by commas. If you do not choose to enable discovery, you can provide a comma separated list of existing Okta groups you would like to provide as privilege levels in StrongDM.
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the resource is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add oktaGroups --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.
3. Then run `sdm admin clouds add oktaGroups <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clouds add oktaGroups "okta-groups-prod"
     --discovery-enabled
     --domain "exampleco.okta.com"
     --identity-set-name "Okta Admins"
     --proxy-cluster-id "plc_abcdef0123456789"
     --tags "env=prod"
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Okta Groups cloud
resource "sdm_resource" "okta_groups_prod" {
  okta_groups {
    # Required
    name             = "okta-groups-prod"                           # <name>
    domain        = "exampleco.okta.com"    # --domain
    identity_set_id = "ig-a1b2c3d4"                        # --identity-set-id

    # Optional discovery configuration
    discovery_enabled   = true                                   # --discovery-enabled
    group_names         = "Okta Admins,OktaOps,Finance*"        # --group-names (comma-separated, supports wildcards)
    privilege_levels    = "Okta Admins,Helpdesk Support"        # --privilege-levels (conditional)

    # Common networking options
    egress_filter   = "field:name tag:env=prod tag:region=us-east" # --egress-filter
    proxy_cluster_id = "plc_abcdef0123456789"                      # --proxy-cluster-id

    # Tags
    tags = {                                                     # --tags
      env   = "prod"
      cloud = "okta"
      auth  = "okta"
      team  = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

#### Resource properties

The **Okta Groups** resource type has the following properties.

<table><thead><tr><th width="200.1363525390625">Property</th><th width="130.4183349609375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>A meaningful name for this resource; displays throughout StrongDM; no special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Resource Type</strong></td><td>Required</td><td><strong>Okta Groups</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to “None (use gateways)”; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to be used for group manipulation</td></tr><tr><td><strong>Okta Domain Name</strong></td><td>Required</td><td>The organization domain URL saved previously</td></tr><tr><td><strong>Discovery Enabled</strong></td><td>Optional</td><td>Enable discovery for this resource; Discovered data displayed in the **Discovery** tab</td></tr><tr><td><strong>Group Names</strong></td><td>Optional</td><td>Names of the discovered Okta groups that you want to appear as privilege level options in StrongDM; Supports wildcard characters such as `*` and are matched case-insensitively; should be comma separated, such as: <code>sdm_group1,sdm_group2</code>; this field appears when discovery is enabled</td></tr><tr><td><strong>Privilege Levels</strong></td><td>Required</td><td>Exact names of the Okta groups that you want to provision access to, comma separated, such as <code>sdm_group1,sdm_group2</code>; this field appears when discovery is not enabled</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Identity Set to map to use to map StrongDM users to Okta users</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Enter <a href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">tags</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

## Manage Okta Group Membership With StrongDM

There are currently two ways to grant privileges to StrongDM users on an Okta Groups resource. You can grant temporary access in the Admin UI by going to **Principals** > **Users** and selecting the user, and then navigating to the **Entitlements** tab and selecting **Grant Temporary Access**.

Alternatively, you can create an [access workflow](/admin/access/access-workflows) that facilitates JIT access for users using a static access rule that specifies the Okta Groups resource. In the access workflow configuration, when adding an Okta Groups resource to the workflow, admins are presented with a **Okta Groups privileges** field, where they can select the privilege levels (Okta groups) previously configured on the resource that they wish to make available to users of this workflow. Users can then request any of the specified privilege levels and be approved or denied by configured approvers.

At this time, granting and revoking privilege levels via dynamic access rules or directly through StrongDM roles is not available.

StrongDM periodically verifies that the user is still a member of the relevant Okta group(s), and re-adds them if necessary, until the access grant in StrongDM expires or is revoked. After a grant expires or is revoked, StrongDM removes the user from the Okta group to remove their elevated level of privilege.

### Verifying group membership additions or revocations

Once a user has been granted a privilege level, you can verify this by checking your Okta group membership directly and see that the user is now in the corresponding group.

If they are removed from the privilege level in StrongDM, they are also removed from the group in Okta. Note that revocations also work when the group was originally granted outside of StrongDM.

For example, if Alice was added to the group `engineers1` directly in Okta and then later was given a privilege level in StrongDM that corresponds to the `engineers1` group as well, when her access in StrongDM is revoked, she is removed from the Okta group.

### Connection through CLI

When a user requests access to an Okta Groups resource via an access workflow through the CLI, they need to append a `--oktaGroup` option to their command:

```sh
sdm access to <RESOURCE_ID> --duration 10m --reason "example reason for request" --oktaGroup sdmGroup1
```

## Logs

When a user is given a privilege level for an Okta Groups resource, StrongDM Activity logs reflect this with events that say `User external grant provisioned`.

Activity log events when a user privilege level for an Okta Groups resource is revoked in StrongDM say `User external grant revoked`.

No user actions against Okta Groups resources are logged, since StrongDM does not facilitate connections or authentication for users.

## Connect to Okta

In summary, before users can connect to Okta Administrator Console with the groups that are provided through privilege levels, the following things must occur:

* Your node(s) must be set up to access Okta. Either an Okta API service integration has been created and environment variables and an Okta configuration file set up on the node, or a user API key has been generated and environment variables set on the node.
* An Identity Set is configured and Identity Aliases are added to users, if not using the default email set.
* The Okta Groups resource is configured in StrongDM, using the Identity Set and with configured privilege levels that correspond to existing Okta groups.
* Temporary access is granted to user(s) or an access workflow is set up to allow requests for access.

Once the resource is configured correctly, and once the user is assigned privilege levels within StrongDM or requests and is granted them, the user should be able to authenticate and connect as normal, now with escalated privileges via the additional Okta groups.

Using the StrongDM Desktop application or CLI to launch the Okta Groups resource is not necessary, as the user was directly added to Okta groups. The user can simply go to authenticate to various services using Okta as normal.

## Troubleshooting

* Healthchecks for this resource type attempt to list Okta users from the resource, so any error messages or failed routes through nodes should appear in the Diagnostics tab in the Admin UI.
* If you’re having intermittent errors converging, try tagging nodes that you are certain are healthy with `sdm__okta_orgurl=<OKTA_DOMAIN>`. This forces those healthy nodes to be selected, and you can see if your connections work when using only the healthy nodes.
* If your users are failing to be provisioned or revoked, check the activity logs for any “user external grant provision failed” or “user external grant revocation failed” logs.


# Snowsight

Configure and manage Snowsight resources in StrongDM. Enable secure, auditable access to Snowflake’s web interface using centralized access controls.

## Overview

This guide explains what capabilities StrongDM can provide for managing access to Snowsight, Snowflake's administrative user interface. It also provides setup and configuration instructions to add Snowsight as a resource in StrongDM and begin using StrongDM to control access for users who wish to access your Snowsight console. StrongDM users are authenticated with Snowsight and granted the level of access that you configure on the Snowsight side.

In addition to access control and auditing, Snowsight access through StrongDM can be a part of a variety of use cases and access control methodologies:

* **Least Privilege**: For Snowsight (Snowflake Web Console) clouds, least privilege can be accomplished by setting up multiple instances of the console as StrongDM resources. Each resource would connect to Snowsight using a different service account with different permissions granted to it.
* **Just-in-Time Access**: StrongDM users are able to use any access workflows you set up to request access to Snowsight, allowing you the choice between granting Just-in-Time (JIT) access with requests, or providing standing access to particular users or roles within your StrongDM organization. For more details, see the [Access Workflows](/admin/access/access-workflows) section.

{% hint style="info" %}
To avoid confusion during access requests, if there are multiple Snowsight cloud resources in StrongDM, it may be useful to name them in such a way that indicates the level of access, so that users know the name of the resource to request.
{% endhint %}

* **Context-Based Policy**: StrongDM policies that restrict or enable users' ability to connect to Snowsight resources based on their context can be used to limit availability of your Snowsight console to users in particular geographic locations or with good device trust scores. Policies can also be used to provide an MFA challenge prior to connection, and help solve for many more use cases. For more details, see the [Policies](/admin/access/policies) section.

{% hint style="info" %}
Note that this is a method by which to set up your Snowsight cloud. If you intend to connect to a specific Snowsight-hosted resource, that resource needs to be set up separately in the appropriate areas of the Admin UI.
{% endhint %}

## Limitations

* For the configuration to work, you must be able to connect to your Snowflake interface via SnowSQL. An admin or web interface does not work.
* Due to the limitations of this resource type, StrongDM does not log user interactions after authentication occurs. StrongDM logs activities such as setup or modification of the resource within StrongDM, or authentication of a user to the resource, but StrongDM does not log the queries performed by the user on the resource itself. We recommend the use of the Snowsight [Activity area](https://docs.snowflake.com/en/user-guide/ui-snowsight-activity.html) for logging further interactions with the resource once a user is authenticated.
* Similarly, some organization-level behaviors are also different for this resource type:
  * Inactivity timeouts are not enforced.
  * Current connections to resources are not severed instantly when access is revoked.
* StrongDM must be the only identity provider (IdP) configured for authentication to this resource.

## Prerequisites

* In StrongDM, you must have the Admin [permission level](/admin/access/permission-level).
* You must have administrator access to your Snowsight environment.
* Before enabling this resource, ensure the Login Name for each Snowflake user (that is, not Username or Email) is set to match a StrongDM email. An email address serves as the ID StrongDM sends to Snowflake to log in a user. The following process disables identity provider (IdP) logins via any other method. Password logins still work.
* We recommend that you reach out to Snowflake support and request that users are not allowed to change their own passwords. Otherwise, once a user logs in to Snowflake via StrongDM, they may change their password and retain access to Snowflake even after their access is revoked in StrongDM.

{% hint style="info" %}
You can use StrongDM to proxy Snowflake SQL connections instead of connecting to Snowflake directly.
{% endhint %}

## Configuration

### Get StrongDM's IdP metadata

StrongDM's IdP metadata is required for creating an integration account with Snowsight.

1. Go to `app.strongdm.com/saml/idp_metadata`. This is a public URL that returns a XML blob. Within this output, note the value of the **X509Certificate**. The value is present twice. Both instances should have the same value.
2. Copy the certificate value. You will need it to create a StrongDM integration account.

### Create a StrongDM integration account

This integration account sets StrongDM information, including the IdP certificate.

1. Note your Snowflake account identifier, which identifies your Snowflake account within your organization, Snowflake-supported cloud platforms, and cloud regions. The account identifier may consist of your Snowflake organization name and account name, in the format `<ORGANIZATION_NAME>-<ACCOUNT_NAME>` (for example, `myorg-account123`). Alternatively, the account identifier may consist of your account locator, region ID, and cloud, and be in the format `<ACCOUNT_LOCATOR>.<CLOUD_REGION_ID>.<CLOUD>` (for example, `xy12345.us-east-2.aws`). The account identifier makes up part of your Snowflake base URL (for example, `https://myorg-account123.snowflakecomputing.com` or `https://xy12345.us-east-2.aws.snowflakecomputing.com`).
2. In SnowSQL, execute the following command, being sure to replace the placeholders with your own values.

   ```sql
   create security integration strongdm_idp
     type = saml2
     enabled = true
     saml2_issuer = 'https://app.strongdm.com/saml/idp_metadata'
     saml2_sso_url = '<ANY_STRING_IN_URL_FORMAT>'
     saml2_provider = 'Custom'
     saml2_x509_cert='<STRONGDM_IDP_X509_CERTIFICATE>'
     saml2_sp_initiated_login_page_label = '<ANY_STRING>'
     saml2_enable_sp_initiated = true
     saml2_force_authn = false
     saml2_requested_nameid_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified'
     saml2_snowflake_issuer_url = 'https://<ACCOUNT_IDENTIFIER>.snowflakecomputing.com'
     saml2_snowflake_acs_url = 'https://<ACCOUNT_IDENTIFIER>.snowflakecomputing.com/fed/login';
   ```

{% hint style="info" %}
The value of `saml2_sso_url` and `saml2_sp_initiated_login_page_label` can be any URL or string, respectively. Note that the URL entered for `saml2_sso_url` becomes a hot link that users can click when accessing the resource. If clicked, the user is taken away from the resource they intend to access.
{% endhint %}

3. Ensure that the metadata matches your base URL (for example, `https://<ACCOUNT_IDENTIFIER>.snowflakecomputing.com`). If you run into 403 errors when adding Snowsight as a cloud resource, it is likely because the wrong URLs were set. If the URLs are wrong, Snowflake could generate metadata with an incorrect URL.

### Get the Snowsight metadata XML blob

The Snowsight metadata XML blob allows connection to StrongDM.

1. Run `desc security integration strongdm_idp;` in SnowSQL.
2. Copy the `SAML2_SNOWFLAKE_METADATA` value. You will need it to configure the Snowsight cloud resource.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**. Note that there are two types and they have different properties.
3. For **Resource Type**, set **GCP Web Console (Workforce Identity Federation)**.
4. Set all other required [resource properties](#resource-properties).
5. Click **create** to save the resource.
6. Click the resource name to view status, diagnostic information, and setting details. After the server is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clouds add snowsight --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.\\

   ```
   NAME:
      sdm admin clouds add snowsight - create Snowsight (Snowflake Web Console) cloud

   USAGE:
      sdm admin clouds add snowsight [command options] <name>

   OPTIONS:
      --bind-interface value        IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --connect-to-default-acs      If left unchecked, the first ACS that appears in SAML Metadata will be used.
      --egress-filter value         apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --healthcheck_username value  The StrongDM user email to use for healthchecks (required)
      --port-override value         Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value      proxy cluster id
      --saml-metadata value         The Metadata for your snowflake IDP integration (required, secret)
      --secret-store-id value       secret store id
      --subdomain value             (required)
      --tags value                  tags e.g. 'key=value,...'
      --template, -t                display a JSON template
      --timeout value               set time limit for command
      --tls-required                sdm must use TLS to connect
   ```
3. Then run `sdm admin clouds add snowsight <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clouds add snowsight "snowsight-prod"
     --subdomain "snowsight-prod01"
     --saml-metadata "/etc/strongdm/saml/snowflake_metadata.xml"
     --healthcheck_username "strongdm-healthcheck@acme.com"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --tls-required
     --connect-to-default-acs
     --tags "env=prod,cloud=snowflake,auth=saml,team=data"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clouds list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Snowsight (Snowflake Web Console) cloud
resource "sdm_resource" "snowsight_prod" {
  snowsight {
    # Required
    name                  = "snowsight-prod"                             # <name>
    subdomain             = "snowsight-prod01"                           # --subdomain
    saml_metadata         = file("/etc/strongdm/saml/snowflake_metadata.xml")  # --saml-metadata (recommended: use secret store)
    healthcheck_username  = "strongdm-healthcheck@acme.com"              # --healthcheck_username

    # Common networking options
    bind_interface  = "default"                                          # --bind-interface ("default" | "loopback" | "vnm")
    port_override   = -1                                                 # --port-override (-1 = auto-allocate)
    egress_filter   = "field:name tag:env=prod tag:region=us-west"       # --egress-filter

    # Optional configuration
    tls_required           = true                                        # --tls-required
    connect_to_default_acs = true                                        # --connect-to-default-acs

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                            # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                             # --secret-store-id (recommended for metadata)

    # Tags
    tags = {                                                             # --tags
      env   = "prod"
      cloud = "snowflake"
      auth  = "saml"
      team  = "data"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **Snowsight (Snowflake Web Console)** cloud type has the following properties.

<table><thead><tr><th width="199.6214599609375">Property</th><th width="130.2073974609375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Datasource Type</strong></td><td>Required</td><td><strong>Snowsight (Snowflake Web Console)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Subdomain</strong></td><td>Required</td><td>What is used as your local DNS address (for example, <code>app-prod1</code> turns into <code>http://app-prod1.&#x3C;your-org-name>.sdm.network/</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>SAML Metadata</strong></td><td>Required</td><td>Metadata XML blob from your Snowflake IdP integration</td></tr><tr><td><strong>Connect to the Default ACS</strong></td><td>Optional</td><td>For orgs that have multiple ACSs in their SAML metadata, StrongDM default behavior is to connect to the first one; check this to indicate in the metadata which should be the default</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>In order for healthchecks to be successful, must be the email of a StrongDM user who has access to this resource, and must also match your Snowflake Login Name (that is, not Username or Email)</td></tr><tr><td><strong>Use HTTPS</strong></td><td>Optional</td><td>Enabled by default; when enabled, StrongDM uses HTTPS for the connection</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Datasource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

{% hint style="info" %}
Depending on the web browser, users that connect to Snowsight via StrongDM may see a **Continue** button during connection. They must click this button to continue.
{% endhint %}

{% hint style="info" %}
After configuration is complete, you can access a Snowsight resource using StrongDM. Note that when you do, you must use the Snowsight web interface, not the Snowflake classic web interface. You cannot switch to the Snowflake classic web interface.

Moreover, the first time that you access this resource, you may be presented with an option to use either Snowsight or the Snowflake classic web interface. You must choose Snowsight or else you won't be able to switch to Snowsight later without admin help.
{% endhint %}

## Logs

In the **Cloud logs** section of the Admin UI (**Logs** > **Cloud**), you can find all of the activities of the users who accessed the Snowsight resource. Note that StrongDM makes an attempt to drop the Authorization header of logs for display in the Admin UI. Note that any secrets displayed in the cloud logs are placeholder values. No actual keys or secrets are ever exposed in plaintext in the Admin UI.

## CLI Usage

When the resource is created and configured, you are ready for users to connect to the resource. In order for your organization's users to access the Snowsight cloud resource via StrongDM, users need to install the following:

* The StrongDM Desktop application
* The latest version of the StrongDM CLI. If the CLI is already installed, you can run `sdm update` in the CLI to update it. Alternatively, if any updates are available, you can open the desktop app and click the **Upgrade** button.
* The `snow` command-line tool

After installation, users must exit and restart the desktop app, and then select the Snowsight cloud resource to connect to.

Click to connect to the resource in the desktop app, or run `sdm connect <RESOURCE>` in the CLI.


# Clusters

{% hint style="info" %}
You can add a Kubernetes cluster as a resource in StrongDM without manual setup in StrongDM by using Helm. Use the Helm chart to install a StrongDM node (relay, gateway, or proxy worker) within your Kubernetes cluster and auto-register it as a resource. See the [Helm chart on GitHub](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay) for more details, or read this guide for more details about options for Kubernetes cluster resources at StrongDM.
{% endhint %}

## Introduction

StrongDM provides a variety of tools to manage Kubernetes clusters. StrongDM supports standard Kubernetes as well as the managed distributions provided by Amazon (EKS), Google (GKE), and Microsoft (AKS). This guide will explain the Kubernetes features available through StrongDM and help you to make decisions about how you want to manage access to your Kubernetes clusters.

## Kubernetes Management Options

When you configure a Kubernetes cluster with StrongDM, you must provide a credential for StrongDM to use to connect your users to the cluster. In this guide, we refer to that credential as a "base credential". By default, StrongDM effectively leases the base credential to users, without the users ever having or seeing the credential. As a result, all actions by users appear in native Kubernetes logging as having been performed by that base credential. Optionally (and recommended), you can configure the resource such that users adopt Identity Aliases. StrongDM [impersonates](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#user-impersonation) these aliases, such that users are then differentiable in native logging. This allows for proper native logging in Kubernetes of what is happening in your cluster, leading to a better audit trail. The user also gains any privileges granted via native RBAC to their Identity Alias. See the [Identity Aliases](/admin/resources/clusters/kubernetes-identity-alias) page for more information.

In both the case of **Leased Credentials** (default behavior) and **Identity Aliases**, the users never see or possess the base credential that is used to connect to the cluster.

We also recommend the use of automatic resource discovery, which allows your StrongDM admins to see the groups, roles, bindings, and so forth in the cluster from the StrongDM Admin UI. They can use that information to construct privilege levels, which allow users to request escalated levels of access within the cluster. This privileged access can be configured through roles, access workflows, and approval workflows. Furthermore, access can be permanent or temporary and be automatically or manually approved. This access is also always logged. See the [Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) page for more information.

If your organization does not need these features, you can configure your clusters to use only Identity Aliases for the native logging benefits, or even connect only your cluster with the base credential and provide users with a set level of access within the cluster.

### Configure a Kubernetes Resource with Leased Credentials

When a cluster is configured in StrongDM with only a base credential, the general sequence of events from configuration to user action is as follows:

1. The admin configures the cluster with StrongDM using the **Authentication** option called **Leased Credentials**, and then provides a base credential for connection to the cluster.
2. The user is assigned access to the cluster in one of three ways:
   1. The admin assigns the user a role that grants standing access to the cluster.
   2. The admin assigns the user temporary access to the cluster.
   3. The user requests temporary access via an access workflow, and the request is reviewed and approved by a designated approver for that workflow.
3. The user attempts to connect to the cluster using the StrongDM desktop or CLI.
4. One of the organization's StrongDM nodes (gateway, relay, or proxy cluster) authenticates the user's traffic to the resource using the base credential.
5. The user accesses the cluster with only the privileges granted to the base credential. They never see or possess the credential.
6. The user's actions are natively logged on the cluster as the base credential user.

{% hint style="info" %}
If you use your native Kubernetes logs for auditing, this is typically not an optimal outcome since all users of this resource will share the same credential, making it difficult to ascertain which StrongDM user performed any given action.
{% endhint %}

<figure><img src="/files/NnTZyaWRBlG9L4QTSKMu" alt="" width="375"><figcaption></figcaption></figure>

### Configure a Kubernetes Resource with Identity Aliases

Use Identity Aliases to give specific access to particular users and to ensure that your Kubernetes logs attribute actions to the user performing them. This makes log entries auditable by user, rather than all actions by StrongDM users appearing to be the same base credential that is used by StrongDM to access the cluster.

When you configure your cluster with StrongDM using Identity Aliases, the general sequence of events from configuration to user action is as follows:

1. The admin configures the cluster with StrongDM using Identity Sets. They provide the base credential that is used for connection to the cluster, and they also choose an Identity Set to use with this resource.
2. The admin configures StrongDM user accounts with individual Identity Aliases that tie to the Identity Set.
3. The user is either assigned access to the cluster in one of three ways:
   1. The admin assigns the user a role that grants standing access to the cluster.
   2. The admin assigns the user temporary access to the cluster.
   3. The user requests temporary access via an access workflow, and the request is reviewed and approved by a designated approver for that workflow.
4. The user attempts to connect to the cluster using the StrongDM Desktop application or CLI.
5. Your StrongDM node (gateway, relay, or proxy cluster) authenticates the user's traffic to the resource using the base credential.
6. The user accesses the cluster with the privileges granted to the base credential, as well as any privileges granted via native RBAC to their Identity Alias. They never see or possess the base credential.
7. User actions on the cluster are natively logged on the cluster as the Identity Alias of the user, rather than as the base credential. This provides usable native Kubernetes logs for audit purposes.

<figure><img src="/files/tIQM8mxQrVPob7QcOuWi" alt="" width="375"><figcaption></figcaption></figure>

### Configure a Kubernetes Resource with Leased Credentials and Privilege Levels

Privilege levels allow you to grant and manage multiple tiers of access to the same cluster using a single StrongDM resource. Without them, you’d need to create separate resources, each with different privilege levels, to represent each level of access. With privilege levels, you can define all those levels within one resource and assign the appropriate level to each user or group as needed, simplifying access management and reducing resource sprawl.

1. The admin configures the cluster with StrongDM, choosing **Leased Credentials** for the **Authentication** value. They also enable Resource Discovery on the cluster, which will provide a set of information within StrongDM about the groups, roles, and bindings that are present in the cluster.
2. The admin configures privilege levels for the cluster in StrongDM using groups discovered in the cluster. Each privilege level is mapped to a single group.
3. The user is assigned access to the cluster in one of three ways:
   1. The admin assigns the user a role that grants standing access to the cluster and particular privilege levels.
   2. The admin assigns the user temporary access to the cluster and assigns particular privilege levels.
   3. The user requests temporary access via an access workflow, including particular privilege levels, and the request is reviewed and approved by a designated approver for that workflow.
4. The user attempts to connect to the cluster using the StrongDM desktop or CLI.
5. Your StrongDM node (gateway, relay, or proxy cluster) authenticates the user's traffic to the resource using the base credential.
6. The user accesses the cluster with the privileges granted to the base credential. They also gain any groups that have been mapped to the privilege levels they were granted in StrongDM, giving them additional privileges. They never see or possess the base credential.
7. User actions are natively logged and attributed to the shared base credential user.

<figure><img src="/files/flSwFiqNwU4EUSG0XVZP" alt="" width="375"><figcaption></figcaption></figure>

### Configure a Kubernetes Resource with Identity Aliases and Privilege Levels

Identity Aliases and privilege levels can be used together, as well.

Use Identity Aliases to give specific access to particular users and to ensure that your Kubernetes logs attribute actions to the user performing them, rather than to the base credential that you configure for StrongDM to access the cluster.

Use privilege levels to grant varying levels of access to the cluster to different groups of users and to allow users to request varying levels of access to the cluster. To do this without privilege levels, you need to set up separate StrongDM resources that all resolve to the same cluster but with credentials that provide different levels of access, as is shown in the following example sequence of events. With privilege levels configured, for example, if you have five different types of access you'd like to give different groups of users within your cluster, you can do that with a single resource, giving the users the privilege level on that resource that they require when they require it.

1. The admin configures the cluster with StrongDM and chooses an Identity Set to draw aliases for users from. They also enable Resource Discovery on the cluster, which will provide a set of information within StrongDM about the groups, roles, and bindings that are present in the cluster. The admin configures StrongDM user accounts with individual Identity Aliases that tie to the Identity Set.
2. The admin configures privilege levels for the cluster in StrongDM using groups discovered in the cluster. Each privilege level is mapped to a single group.
3. The user is assigned access to the cluster in one of three ways:
   1. The admin assigns the user a role that grants standing access to the cluster and particular privilege levels.
   2. The admin assigns the user temporary access to the cluster and assigns particular privilege levels.
   3. The user requests temporary access via an access workflow, including particular privilege levels, and the request is reviewed and approved by a designated approver for that workflow.
4. The user attempts to connect to the cluster using the StrongDM Desktop application or CLI.
5. Your StrongDM proxy (gateway, relay, or proxy cluster) authenticates the user's traffic to the resource using the base credential.
6. The user accesses the cluster with the privileges granted to the base credential, as well as any privileges granted via native RBAC to their Identity Alias. They also gain any groups that have been mapped to the privilege levels they were granted in StrongDM, giving them additional privileges. They never see or possess the base credential.
7. User actions on the cluster are natively logged on the cluster as the Identity Alias of the user, rather than as the base credential. This provides usable native Kubernetes logs for audit purposes.

<figure><img src="/files/2xpzHKVZff2qlpT58u8M" alt="" width="375"><figcaption></figcaption></figure>

## Pod Identity

The Kubernetes (Pod Identity) resource type is a unique resource type designed to work with clusters that already have a StrongDM node (relay, gateway, or proxy cluster) running inside a pod on the cluster. The Pod Identity resource type has two primary use cases compared to other cluster types:

1. The cluster can be onboarded to, and accessed from, StrongDM without sharing any base credentials.
2. The cluster can be onboarded to StrongDM by a Helm chart without any manual configuration. The Helm chart deploys a StrongDM node within the cluster, auto-registers the node with StrongDM, and then uses the node to also auto-register the cluster as a resource in StrongDM.

If neither of these use cases are relevant to your organization's needs, the other Kubernetes resource types are better options. See the [Kubernetes (Pod Identity)](/admin/resources/clusters/kubernetes-podidentity) page, or look at the [Helm chart](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay), for more detailed information.

## Select a Resource Type

Once you've determined how you'd like to manage your cluster, you can pick a StrongDM resource type and get started. Keep these things in mind:

* If you want to use Identity Aliases with your cluster, you should read about setup for [Identity Aliases](/admin/resources/clusters/kubernetes-identity-alias) first here. Then, be sure to attach an Identity Set to your cluster using the configuration option **Identity Set** sometime during setup, or after you have it configured and connected.
* If you want to use Privilege Levels with your cluster, you should enable **Automatic Discovery** during configuration of the resource. Then, once the resource is connected, you can set up Privilege Levels for it. You can read more about this in the [Privilege Levels](/admin/resources/clusters/kubernetes-management) page.

### What resource type is for you?

* If you want to auto-register your cluster using Helm, check out the [Kubernetes (Pod Identity)](/admin/resources/clusters/kubernetes-podidentity) guide and the [Helm chart](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay).
* If you want to set up a cluster without needing to share cluster credentials with StrongDM, read the [Kubernetes (Pod Identity)](/admin/resources/clusters/kubernetes-podidentity) guide.
* If you do not intend to use auto-registration, choose your deployment type:
  * **Amazon (EKS)**: If you're using EKS, how do you want to connect your EKS cluster to StrongDM?
    * Use standard credentials to connect to StrongDM ([EKS](/admin/resources/clusters/eks) guide).
    * Use an attached IAM role (Instance Profile) to connect to StrongDM ([EKS (Instance Profile)](/admin/resources/clusters/eks-instance-profile) guide).
  * **Azure (AKS)**: See the [AKS](/admin/resources/clusters/aks) guide.
  * **Google (GKE)**: See the [GKE](/admin/resources/clusters/gke) guide.
  * **Kubernetes**: If you're using standard Kubernetes, how do you want to connect your cluster to StrongDM?
    * Use standard credentials to connect with StrongDM ([Kubernetes](/admin/resources/clusters/kubernetes) guide).
    * Use a Kubernetes service account to connect with StrongDM ([Kubernetes (Service Account)](/admin/resources/clusters/kubernetes-service-account) guide).


# Kubernetes (Pod Identity)

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to a Kubernetes (Pod Identity) cluster via the StrongDM Admin UI. This process involves creating and configuring a new cluster in the Admin UI and checking the connection to your Kubernetes API server.

If you'd like to add a Kubernetes cluster to StrongDM by installing a node (relay, gateway, or proxy cluster) within your Kubernetes cluster and auto-registering it (with no manual setup within StrongDM), see the [Helm chart on GitHub](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay).

The Kubernetes (Pod Identity) resource type is a unique resource type that can be added to and accessed using StrongDM without exposing the underlying cluster's private keys outside the cluster. Pod Identity works by running a StrongDM node in a pod within your cluster. Once the node and the cluster are registered with StrongDM, whether automatically by using the StrongDM node [Helm chart](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay) or manually (such as with the Admin UI), the node can then access the hosting cluster directly.

Note that because the node sits within the cluster, from any node's perspective, the address of any hosting cluster is always `kubernetes.default.svc`. In order for StrongDM to differentiate between different Pod Identity clusters, the CA certificate of the cluster must be provided.

{% hint style="info" %}
Kubectl 1.30 or higher defaults to using websockets, which the StrongDM client did not support before version 45.35.0. You can remedy this by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

### Set up With the Helm Chart

The preferred way to set up a Kubernetes (Pod Identity) resource in StrongDM is to use the Helm chart to automatically create and register a StrongDM node within your cluster, and then in turn, to automatically register the cluster as a resource with StrongDM. To set up your node and register your cluster using the Helm chart, follow these steps:

1. Use the StrongDM relay [Helm chart](https://github.com/strongdm/charts/tree/main/deployments/sdm-relay) to install a node in a pod within your cluster.
2. Verify the node's registration with StrongDM using the Admin UI by going to **Networking** > **Relays** or using the CLI by running `sdm admin nodes list`. This step is optional, but suggested while testing this configuration.
3. The Kubernetes (Pod Identity) resource in StrongDM should also be created by the Helm chart. You can verify this resource has been registered using the Admin UI by going to **Resources** > **Managed Resources** or using the CLI by running `sdm admin clusters list`. Again, verifying this manually is just for the purposes of this test.
4. Grant access to the new resource to your StrongDM account via a role or temporary access grant and test access. Doing so grants you the same level of Kubernetes access as the pod that the node sits in. This step can be automated by using roles that have [dynamic access rules](/admin/access/roles#dynamic-access-rules) that can give the users in a role access to newly created resources based on their type or tag.

#### Set up With the Admin UI

To set up your cluster using the Admin UI, follow these steps:

1. Install a StrongDM node (a [relay or gateway](/admin/networking/gateways-and-relays)), or a [proxy cluster](/admin/networking/proxy-clusters) within a pod in the Kubernetes cluster and register it with StrongDM.
2. Verify the node's registration with StrongDM using the Admin UI by going to **Networking** > **Relays** or using the CLI by running`sdm admin nodes list` to ensure that it is reachable and healthy. This step is optional, but suggested while testing this configuration.
3. Create the Kubernetes (Pod Identity) resource in the StrongDM Admin UI by going to **Resources** > **Managed Resources** or using the CLI by running `sdm admin clusters add`, being sure to provide the [Server CA](#server-ca) as an argument, as that is how the node and the cluster will be connected.
4. Grant access to the new resource to your StrongDM account via a role or temporary access grant and test access. Doing so grants you the same level of Kubernetes access as the pod that the node sits in. This step can be automated by using roles that have [dynamic access rules](/admin/access/roles#dynamic-access-rules) that can give the users in a role access to newly created resources based on their type or tag.

### Managing Your Kubernetes Cluster in the StrongDM Admin UI

You can manage your cluster in the Admin UI. Log in to the StrongDM Admin UI and go to **Infrastructure > Clusters**. Here you can see a list of all of your clusters.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If the state is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.

You can select your Kubernetes (Pod Identity) cluster to edit its configuration.

#### Resource properties

Configuration properties are visible when you add a **Resource Type** or when you click to view the cluster's settings. The following table describes the settings available for your Kubernetes cluster.

| Property                  | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**          | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**         | Required    | Select **Kubernetes (Pod Identity)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Proxy Cluster**         | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode**     | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**            | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**         | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                   | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**          | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see the [Secret Store](#secret-store) section                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Server CA**             | Required    | Pasted server certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the server certificate on the API server or get it in Base64 format from your existing [Kubernetes configuration (kubeconfig) file](#server-ca)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Healthcheck Namespace** | Optional    | If enabled for your organization, the namespace used for the resource healthcheck; defaults to `default` if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: `get pods`, `get deployments`, or `describe namespace`                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**         | Optional    | Resource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

**Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

**Client credentials**

When your users connect to this cluster via StrongDM, they initially have exactly the same rights to the cluster as the pod that the node sits in. Be sure to consider this prior to setup.

**Server CA**

How to get the **Server CA** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- cluster`, copy the `certificate-authority-data` value. That is the server certificate in Base64 encoding.

```yaml
  - cluster:
    certificate-authority-data: ... SERVER CERT BASE64 ...
```

**Secret Store**

By default, server credentials are stored in StrongDM. Alternatively, save these credentials in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** **Credential Management**. When you select another Secret Store type, it displays its unique properties. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).


# Identity Alias for Kubernetes

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

You can use an [Identity Alias](/admin/principals/identity-alias), instead of a leased credential. Each user in your organization may be assigned an Identity Alias from an Identity Set. When a user connects to a cluster configured to use Identity Alias, their requests are executed while [impersonating](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#user-impersonation) their assigned Identity Alias name. As a result, the user is granted whatever permissions that alias has within the cluster, and Kubernetes' native logging records requests and sessions under that alias.

The initial connection is made to the Kubernetes endpoint using the leased identity. The request also includes headers containing the individual user's Identity Alias username and role(s). These details appear in the cluster audit logs in the `Impersonation` section. If the Identity Alias username or role matches an RBAC User or RBAC Group, the calling user is allowed to perform operations in the cluster as defined by the RBAC User or Group bound to their account, rather than the level of access defined by the leased credential.

For example, the following YML binds the Role `remote_reader` to User `alice_glick` and Group `developers`.

```yml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: default
subjects:
- kind: User
  name: alice_glick
  apiGroup: rbac.authorization.k8s.io
- kind: Group
  name: developers
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: remote_reader
  apiGroup: rbac.authorization.k8s.io
```

The example RoleBinding allows a StrongDM user to use the Identity Alias username `alice_glick` to authenticate to the cluster. It also allows a StrongDM user to use the Identity Alias role `developers` (with some other Identity Alias username) to authenticate to the cluster.

In Alice's [StrongDM user profile](#set-your-rbac-rules-for-individual-users), Alice's Identity Alias username should be configured with the exact value `alice_glick`. When Alice accesses the cluster resource via StrongDM, Alice has the permissions defined in the RBAC Role `remote_reader`.

Other users that are assigned the Identity Alias role `developers` will also have the permissions defined in the RBAC Role `remote_reader`, regardless of their Identity Alias username.

The option to authenticate with Identity Aliases is available for the following Kubernetes cluster types:

* AKS
* AKS (Service Account)
* Elastic Kubernetes Service
* Elastic Kubernetes Service (instance profile)
* Google Kubernetes Engine
* Kubernetes
* Kubernetes (Service Account)

{% hint style="info" %}
If you are using AKS, you must ensure that RBAC is enabled on your cluster. You can check the status of this setting from the cluster overview page. If RBAC is not enabled in your cluster’s configuration, AKS does not adhere to RBAC rules, so you need to recreate the cluster with RBAC enabled before using Identity Aliases.
{% endhint %}

## Set Up Identity Aliases

### Set your RBAC rules for the cluster

1. Create your cluster if you do not have one already.
2. Create or identify an RBAC Role that StrongDM can use to check the health of your cluster. This Role should have at least one of the following rights in the namespace of your choosing:

   * `get pods <HEALTHCHECK_NAMESPACE>`
   * `get namespaces`
   * `get deployments -n <HEALTHCHECK_NAMESPACE>`
   * `describe namespace <HEALTHCHECK_NAMESPACE>`

   In the following example YAML file, the Role rules allow users with that role to get, watch, and list the specified cluster resource:

   ```yaml
   apiVersion: rbac.authorization.k8s.io/v1
   kind: Role
   metadata:
     namespace: default
     name: sdm-health
   rules:
   - apiGroups: [""]
     resources: ["pods"]
     verbs: ["get", "watch", "list"]
   ```
3. Bind a Kubernetes User object to that Role. We recommend using a dedicated RBAC User for the healthcheck. In the following example YAML file, the RoleBinding binds the `sdm-health` Role to an RBAC User named `sdm-health`.

   ```yaml
   apiVersion: rbac.authorization.k8s.io/v1
   kind: RoleBinding
   metadata:
     name: sdm-health-binding
     namespace: default
   subjects:
   - kind: User
     name: sdm-health # Use as the Identity Alias Healthcheck Username
     apiGroup: rbac.authorization.k8s.io
   roleRef:
     kind: Role
     name: sdm-health
     apiGroup: rbac.authorization.k8s.io
   ```
4. Create or identify an RBAC ClusterRole that StrongDM can use to impersonate Identity Aliases in your Identity Set, as well as the aforementioned `sdm-health` user.

   ```yaml
   apiVersion: rbac.authorization.k8s.io/v1
   kind: ClusterRole
   metadata:
     namespace: default
     name: sdm-user-impersonator
   rules:
   - apiGroups: [""]
     resources: ["users"]
     verbs: ["impersonate"]
   ```
5. Bind that `sdm-user-impersonator` ClusterRole to the Kubernetes User or Service Account you used to add the cluster to StrongDM using a ClusterRoleBinding.

   ```yaml
   apiVersion: rbac.authorization.k8s.io/v1
   kind: ClusterRoleBinding
   metadata:
     name: sdm-user-impersonator-binding
     namespace: default
   subjects:
   # Set one of the following, either User or ServiceAccount
   - kind: User
     name: <STRONGDM_ADMIN_USER>
     apiGroup: rbac.authorization.k8s.io
   - kind: ServiceAccount
     name: <STRONGDM_ADMIN_SERVICEACCOUNT>
     namespace: <STRONGDM_ADMIN_SERVICEACCOUNT_NAMESPACE>
   roleRef:
     kind: ClusterRole
     name: sdm-user-impersonator
     apiGroup: rbac.authorization.k8s.io
   ```
6. Create a YAML file with all of the Role and RoleBinding details.
7. If you have enabled [Resource Discovery](/admin/resources/clusters/kubernetes-management#configure-clusters-to-discover-resources), be sure to repeat steps 2 and 3, creating roles and users for the Discovery Username.
8. Run `kubectl apply -f filename.yaml` to upload these objects to the cluster. Note that you must be an administrator of the cluster with direct access to it (rather than through StrongDM) in order to apply the resources.

### Set up logging

1. Configure your cluster to enable audit logs. For example, in AKS, edit your cluster and go to **Configuration** > **Logs** and enable **Audit**.
2. In the Admin UI, assign the new resource to the intended user(s).
3. As one of the users assigned to your new resource, in your local StrongDM Desktop, select the **Update kubectl configuration** option.
4. Run commands you want to try as examples.
5. Access your logs and search for the term “impersonatedUser” or your Identity Alias. For example, in AWS, go to **Cloudwatch** > **Log Groups**, search for your cluster name, and then search for your Identity Alias. You should see audit records similar to the following:

```json
    {
      "kind": "Event",
      "apiVersion": "audit.k8s.io/v1",
      "level": "Request",
      "auditID": "8cadb874-1ec0-4670-9996-38dc0371fdca",
      "stage": "ResponseComplete",
      "requestURI": "/api/v1/namespaces/default/pods?limit=500",
      "verb": "list",
      "user": {
          "username": "kubectl-access-user",
          "uid": "aws-iam-authenticator:000000000000:ARRRRRRRRRRRRRRRRRRR",
          "groups": [
              "system:masters",
              "system:authenticated"
          ],
          "extra": {
              "accessKeyId": [
                  "ARRRRRRRRRRRRRRRRRRR"
              ],
              "arn": [
                  "arn:aws:sts::000000000000:assumed-role/terraform-sdm-eks-user-strongdm/1632846062627469349"
              ],
              "canonicalArn": [
                  "arn:aws:iam::000000000000:role/terraform-sdm-eks-user-strongdm"
              ],
              "sessionName": [
                  "1632846062627469349"
              ]
          }
      },
      "impersonatedUser": {
          "username": "alice_glick",
          "groups": [
              "system:authenticated"
          ]
      }
      ...
    }
```

### Add the Identity Set in StrongDM

1. In the Admin UI, create the Identity Set by going to **Principals** > **Identity Sets** and clicking **Add set**.
2. For **Name**, enter a unique name for the Identity Set.
3. Click **Create identity set**.

### Add the resource in StrongDM

1. In the Admin UI, create the resource by going to **Resources** > **Managed Resources** and clicking **Add Resource**.
2. Choose the cluster type you are using.
3. Set the remaining [Kubernetes cluster properties](/admin/resources/clusters/kubernetes).
   * For **Authentication**, set **Identity Aliases**.
   * For **Identity Set**, select the Identity Set that you just created.
   * For **Healthcheck Username**, set the RBAC User name (for example, `sdm-health`) from the RoleBinding created in the [previous step](#set-your-rbac-rules-for-the-cluster).
   * For **Healthcheck Namespace**, set the Namespace name chosen when defining the healthcheck Role (for example, `sdm-reader`) created in the [previous step](#set-your-rbac-rules-for-the-cluster).
4. After you have set all the required properties, click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.

### Set your RBAC rules for individual users

1. In your cluster, create bindings for individual users. These bindings should be similar to those that you created earlier in this procedure.
2. In the Admin UI, go to **Principals** > **Users** and select the user who is going to use an Identity Alias.
3. In that user's Identity Alias settings, for **Username**, enter the same username that matches the name specified in the cluster bindings. This name is used when connecting to the Identity Alias-enabled cluster.
4. For **Roles**, assign the group(s) to be used when connecting to an Identity Alias-enabled cluster.

Configuration is now complete. You may now start using Identity Aliases to authenticate with your Kubernetes resource.


# Kubernetes Discovery and Privilege Levels

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

Automatic resource discovery and privilege levels for Kubernetes allow you to present StrongDM admins with a list of groups discovered within the cluster and arrange for users of your cluster to get the right amount of access through those groups at the right time. This can be used in several ways:

* You can give different users various levels of standing access to the same resource through adding privilege levels to StrongDM [roles](/admin/access/roles).
* You can give users the ability to request various levels of temporary access to a resource through adding privilege levels to [access workflows](/admin/access/access-workflows), which users can then select from when requesting access via the Admin UI, CLI, or integrations with apps such as Slack.
* You can assign various privilege levels to users connecting to the cluster through [policies](/admin/access/policies), based on their contextual situation.

These features solve the problem of having to add multiple resources to StrongDM using different credentials, in order to provide varying levels of access to the same cluster. They also provide a convenient way to escalate and de-escalate access within the cluster with StrongDM roles, Just-in-Time access with access workflows, and policies that allow or forbid access based on privilege levels, or are used to grant them.

This guide introduces the concept of automatic resource discovery and how to implement privilege levels when providing access to your clusters.

## Kubernetes Resource Discovery

If a Kubernetes resource is added to StrongDM and configured with resource discovery enabled, StrongDM continuously discovers information about that Kubernetes cluster. When a user visits the **Discovery** tab for that cluster in the Admin UI, the latest available information is displayed.

The following items are discovered within the cluster:

* Subjects (users, groups, and service accounts)
* RoleBindings and ClusterRoleBindings
* Namespaces
* Roles and ClusterRoles
* Rules (including Labels and annotations)

This information is made available to admins in the Admin UI, by visiting **Managed Resources** and clicking the particular resource, then the **Discovery** tab. In the **Discovery** tab, admins are able to view a list of subjects that is searchable by name and kind. When a subject is selected, the panel to the right displays a list of Roles and ClusterRoles that are associated with the subject, and the details of each Role, including an option to view rules associated with that Role as well.

Discovery is very quick, usually within moments of changes being made within the cluster. If the connection to the cluster is lost due to networking issues, the discovery information is lost within a few hours, but is reacquired when the cluster becomes available again.

## Configure clusters to discover resources

When a Kubernetes cluster is added as a resource to your StrongDM organization, an option can be enabled called **Enable Resource Discovery**. Checking this box in the Admin UI is all that is required to begin automatic discovery within the cluster. If your cluster is configured in StrongDM to use Identity Sets, you also need to add a **Discovery Username** to the configuration settings, which is the Kubernetes user that you wish automatic discovery to occur with. For clusters set up with leased credentials, the leased credentials are used.

Discovery also requires that you set up a ClusterRole and apply it to the Kubernetes user that is used for discovery, with the following rules:

```yaml
rules:
  - apiGroups: [""]
    resources: ["namespaces", "serviceaccounts"]
    verbs: ["list", "get", "watch"]
  - apiGroups: ["rbac.authorization.k8s.io"]
    resources: ["roles", "rolebindings", "clusterroles", "clusterrolebindings"]
    verbs: ["list", "get", "watch"]
```

These rules are the minimum needed for discoverability across the cluster and could be adjusted further based on the discretion of the Kubernetes admin to add further permissions, narrow the scope to particular namespaces, or make other similar alterations.

{% hint style="info" %}
To add a cluster to StrongDM, or update an existing cluster, go to the [Clusters](/admin/resources/clusters) page to see a listing of the cluster types supported at StrongDM. Select the one you need and follow the configuration guide to set up the cluster in your StrongDM organization.
{% endhint %}

### Kubernetes discovery information

In the Admin UI, under **Resources** > **Managed Resources** and in the details view for the cluster you created, you can see that there is a **Discovery** tab. The information presented in that tab is what was able to be discovered about your cluster given the connection information and credentials for the cluster, and the discovery username you provided. In the left panel there is a list of subjects (users, groups, and service accounts). If the list of subjects is long, it can be filtered by type or searching for strings in the subject names.

When you select a subject, the Kubernetes Roles associated with that subject are presented on the right. If the list of Roles associated with that subject is too long, it can also be searched or filtered by namespace. Each Role listed has a **View Rules** button, which expands a table of information about Rules from the selected Role.

## Privilege Levels

When a Kubernetes resource is added to StrongDM, users of that resource have exactly the privileges afforded to the Kubernetes credential used to add the resource to StrongDM. If Identity Aliases are in use, they also have any privileges granted via native RBAC to their Identity Alias. However, this arrangement would typically require multiple resources to be added to StrongDM if you wish to provide users with multiple options of privileges to request.

Privilege levels offer a more practical solution. During discovery, clusters are scanned for Kubernetes groups and those groups are selectable when creating roles, access workflows, access requests, and policies. The administrator chooses the privilege levels to be granted to a role or be made available upon request. The user is then able to access the cluster with the permissions offered by the credentials used to configure the cluster in StrongDM and any provided by mapping their Identity Alias (if used), plus any extra access that granted privilege levels provide.

### How privilege levels work

When a user is granted a privilege level "alpha" on a cluster, all requests that user makes to that cluster are implicitly modified to impersonate the Kubernetes group "alpha" within that cluster. Accordingly, you must create Roles, ClusterRoles, RoleBindings and ClusterRoleBindings on your cluster to both define the permissions the privilege level "alpha" grants, as well as to allow StrongDM to impersonate that group on the user's behalf.

```mermaid
---
title: Architecture of Privilege Levels
---
graph LR;
id1[<b>Scenario</b><br>Admin wants to configure a new privilege level called Engineering, which allows users to get pod A in a particular cluster.]
    style id1 fill:#ffffff
    style A fill:#ffffff
    style B fill:#ffffff, text-align:left
    style E fill:#eaeded, text-align:left
    style F fill:#ffffff, text-align:left
    style G fill:#eaeded, text-align:left
    style H fill:#ffffff, text-align:left
    style I text-align:left
    style J text-align:left
    style K text-align:left
    style L text-align:left
    style M fill:#eaeded, text-align:left
    A((<b>StrongDM<br>User</b>)) --> M(<b>whoami: none</b><br>kubectl get pod A) --> B@{ shape: subproc, label: "<b>StrongDM</b><br>Assign Identity Alice<br>Assign Privilege Engineering" };
    B --- E
    subgraph C[<b>Kubernetes Cluster</b>]
      direction LR
        E(<b>whoami: StrongDM</b><br>kubectl get pod A<br> --as Alice<br>--as-group Engineering)--> F
        F[<b>kube-apiserver</b>] --> G
        G(<b>whoami: Alice, Engineering</b><br>kubectl get pod A)--> H
        H[<b>pod A</b>]
    end
    subgraph C
        I@{ shape: doc, label: "kind: RoleBinding<br>name: strongdm-binding<br>subject: user StrongDM<br>roleRef: impersonate-role" } ~~~ J
        J@{ shape: doc, label: "kind: Role<br>name: impersonate-role<br>action: impersonate<br>resource: user Alice<br>resource: group Engineering" } ~~~ K
        K@{ shape: doc, label: "kind: RoleBinding<br>name: engineering-binding<br>subject: group Engineering<br>roleRef: pod-get-role" } ~~~ L
        L@{ shape: doc, label: "kind: Role<br>name: pod-get-role<br>action: get<br>resource: pod A" }
    end
```

## Configure Clusters to Use Privilege Levels

In order to correctly leverage privilege levels, you must set up RBAC resources on your cluster to map your Leased Credentials or Identity Aliases to Kubernetes Roles or ClusterRoles. Go through the following steps, creating the appropriate Kubernetes objects as you see fit, or confirming that you have objects to fulfill the intended purpose.

1. Define the permissions for the privilege level:

   To define what exactly granting a privilege level `engineering` enables a user to do in your cluster, create a Role/ClusterRole. In the following example, we wish to let users watch, get, or list pods when they are granted the privilege level `engineering`:

   ```yaml
   # engineering role
   apiVersion: rbac.authorization.k8s.io/v1
   kind: Role
   metadata:
     namespace: default
     name: engineering
   rules:
   - apiGroups: [""] # "" indicates the core API group
     resources: ["pods"]
     verbs: ["watch","get","list"]
   ```
2. Associate the Role with the Kubernetes group matching your privilege level:

   Create a RoleBinding or ClusterRoleBinding, associating the Role or ClusterRole to the group `engineering`:

   ```yaml
   # engineering role binding
   apiVersion: rbac.authorization.k8s.io/v1
   kind: RoleBinding
   metadata:
     name: engineering
     namespace: default
   subjects:
   # You can specify more than one "subject"
   - kind: Group
     name: engineering # "name" is case sensitive
     apiGroup: rbac.authorization.k8s.io
   roleRef:
     kind: Role
     apiGroup: rbac.authorization.k8s.io
     name: engineering
     namespace: default
   ```
3. Allow StrongDM to impersonate the group `engineering`:

   Create another ClusterRole, granting permission to impersonate the group `engineering`. If you are using privilege levels alongside [Identity Aliases](/admin/resources/clusters/kubernetes-identity-alias), you likely need to grant permission to impersonate all users. The following example grants permission to impersonate all users, groups, and service accounts:

   ```yaml
   # impersonator minimal permissions 
   # needed to elevate privileges.
   apiVersion: rbac.authorization.k8s.io/v1
   kind: ClusterRole
   metadata:
     name: sdm-impersonator
   rules:
   # impersonate all users, groups, and service accounts
   # needed for Identity Aliases to work.
   - apiGroups: [""] # "" indicates the core API group
     resources: ["users", "groups", "serviceaccounts"]
     verbs: ["impersonate"]
   ```
4. Associate the `impersonator` ClusterRole with the Kubernetes User or Service Account whose credentials you intend to use to add the cluster resource to StrongDM:

   ```yaml
   apiVersion: rbac.authorization.k8s.io/v1
   kind: ClusterRoleBinding
   metadata:
     name: sdm-impersonator-binding
   subjects:
   # Specify the Kubernetes User or ServiceAccount whose credentials you are using in StrongDM
   - kind: User
     name: <STRONGDM_USER> # "name" is case sensitive
     apiGroup: rbac.authorization.k8s.io
   - kind: ServiceAccount
     name: <STRONGDM_SERVICEACCOUNT_NAME> # "name" is case sensitive
     namespace: <STRONGDM_SERVICEACCOUNT_NAMESPACE>
   roleRef:
     kind: ClusterRole
     name: impersonator
     apiGroup: rbac.authorization.k8s.io
   ```
5. If using Identity Aliases, make sure that your cluster is also set up with a healthcheck user, as detailed in [Identity Aliases](/admin/resources/clusters/kubernetes-identity-alias#set-your-rbac-rules-for-the-cluster).

## Privilege Levels and Access Workflows

Privilege levels can be used with workflows and requests to allow users to request particular levels of access to the cluster for a set duration of time.

![](/files/aTyx0AJ5aFa0sLrHZa1u)

When creating an access workflow, resource discovery provides a list of available Kubernetes groups to use as privilege levels. You can also add your own options if your configuration requires that, or if you are not using discovery. Adding privilege levels allows users to request different levels of access within the resource.

{% hint style="info" %}
The discovery list presents only suggestions based on what was discovered inside the cluster. You can manually enter other values for privilege levels, if perhaps you anticipate the available groups in the cluster to change in the future. However, these manually added values do not persist in the discovery list in other places in StrongDM once added; they are only present in the place where you added them. If you add the value "extra-privilege-group" to clusters that are available through Workflow A, and then go to edit Workflow B, "extra-privilege-group" is not available in the discovery list (but could be typed in there, too, if desired).
{% endhint %}

If there is ever a situation where the user could request access to a resource through multiple access rules, and one stipulates the use of privilege levels and the other does not, the privilege levels are optional.

### **Access requests**

![](/files/6mi0xQjq6s4dHzJYLHrl)

When making access requests using this workflow, users are able to select from the provided list of privilege levels as options (or choose none to request the standard level of access they are granted without privilege levels). Multiple privilege levels can be requested at once. If the user does not select privilege levels when they are required by the access rule, the user is notified of that in the resulting error message.

Once their request is approved, the user has access to the cluster(s) they requested through StrongDM. When they land in the cluster, they have the Kubernetes groups that were assigned via privilege levels.

In addition to the Admin UI, users can make requests involving privilege levels in Slack, Teams, or Jira (if any of those integrations are used by your organization) as well as the StrongDM CLI.

When viewing the catalog of StrongDM resources in the CLI (`sdm access catalog`) users are able to see the privileges that are available to them for a cluster. When making an access request at the CLI, with `sdm access to` users can append a `--k8sGroup=foo` flag to request a specific privilege level with their request.

{% hint style="info" %}
Multiple `-k8sGroup` flags can be added to a request made using the CLI to request multiple privilege levels.
{% endhint %}

## Privilege Levels and Roles

Privilege levels can be used with roles to provide different sets of users with different levels of standing access to the same cluster resource.

![](/files/eTbQ8glgE0nQ5i60jnLv)

When creating a StrongDM role to provide users with standing access to resources, resource discovery provides a list of available Kubernetes groups to use as privilege levels. You can also add your own options if your configuration requires that, or if you are not using discovery. Adding privilege levels allows different roles to have different standing access privileges on the same resource.

For example, if you have a cluster called "k8s-test-cluster", you might create it using Kubernetes credentials that don't give much access within the cluster at all. Then, you could create three different roles in StrongDM to give to users that grant access to this cluster: "Service", `engineering`, and "Admin". Each of these StrongDM roles could then have access rules that grant users one or more corresponding groups within your cluster, providing the access those users need in the cluster. Now, The roles can be assigned to users and service accounts to give them various levels of standing access to the same cluster.

When creating the access rules for the role, upon selecting Kubernetes resources (or rules that would include Kubernetes resources) you have the option to add privilege levels and be presented with the discovery list. So for your `engineering` StrongDM role, perhaps you might decide to use a rule to grant access to all development and staging Kubernetes clusters, and add the privilege levels "foo" and "bar". Now, you can assign engineers to the `engineering` StrongDM role, and they are able to access all development/staging clusters through StrongDM. When they land in the cluster, they have the groups "foo" and "bar".

## Privilege Levels and Policy

Privilege levels can also be added or limited with [policies](/admin/access/policies). See the following examples for more details.

{% hint style="info" %}
The `action` statements used in policies pertaining to Kubernetes resources should be appropriately scoped. Typically, you should specify an action (`action == "foo"`) rather than leaving it open-ended (`action,`), particularly if they include annotations that interrupt the user, such as `@justify()`. If not, every new action results in a new challenge, which can be disruptive.
{% endhint %}

### **Add privilege levels with policy**

This example would permit a specified role to perform a specified action against a particular resource, with the added privilege levels "foo" and "bar".

```cedar
@k8s_impersonate_groups("foo, bar")
permit (
  principal in StrongDM::Role::"r-1caa595464152e78",
  action == K8s::Action::"fetchPrivileges",
  resource in StrongDM::Resource::"rs-123c12d5654743g66"
);
```

### **Forbid based on privilege levels present**

Forbid the "impersonate" action if the user's privilege levels do not contain "devops", "qa", or "marketing".

```cedar
@error("invalid group")
forbid(
  principal,
  action == K8s::Action::"impersonate"
  resource
) when {
  context has k8s && !["devops","qa","marketing"].containsAll(context.k8s.groups)
};
```

## Privilege Level Limitations

* If you use an access rule to provide access to a group of five AKS clusters, and you select the `engineering` privilege level as one of your options, but one of the five clusters does not actually have a corresponding Kubernetes group for `engineering`, nothing happens. When the user connects to any of these clusters, they are dropped in with the `engineering` group attached, and if that doesn't exist on the particular cluster they're connecting to, they just won't get the expected privileges. Conversely, if an admin at some point adds the `engineering` group to that fifth cluster, such an access rule automatically grants the same users that privilege level when connecting to the cluster, resulting in the potential for unplanned privilege escalation if the Kubernetes administrator and the StrongDM administrator are not in sync.
* All Kubernetes resource types that StrongDM supports support discovery and privilege levels except for the "User Impersonation" resource types.
* If privilege levels are selected in an access rule as part of an access workflow, the user is required to choose one of those privilege levels, unless there is a second access rule that applies to the same resource for which the admin did not select any privilege levels. When the admin chooses privilege levels for a resource or group of resources, they are requiring that the user make a choice from those options.


# AKS

Learn how to add and manage an Azure Kubernetes Service (AKS) cluster in StrongDM.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to an Azure Kubernetes Service (AKS) cluster via the StrongDM Admin UI. This process involves creating and configuring a new cluster in the Admin UI and checking the connection to your Azure-managed API server.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Ensure that the API server you intend to add to StrongDM is accessible from your StrongDM gateways or relays. See our guide on [Gateways](/admin/networking/gateways-and-relays) for more information.

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Infrastructure > Clusters**.
2. Click the **Add Resource** button.
3. Select **AKS** as the **Resource Type** and set other [resource properties](#resource-properties) to configure how the StrongDM relay connects.
4. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add aks --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```sh
   NAME:
      sdm admin clusters add aks - create AKS cluster

   USAGE:
      sdm admin clusters add aks [command options] <name>

   OPTIONS:
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate-authority value                (secret)
      --client-certificate value                   (secret)
      --client-key value                           (secret)
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --hostname value                             (required)
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port value                                 (required) (default: 443)
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --secret-store-id value                      secret store id
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
   ```
3. Then run `sdm admin clusters add aks`` ``<RESOURCE_NAME>` and set all required properties with their values. For example:

   ```
   sdm admin clusters add aks "aks-cluster-prod"
     --hostname "aks-prod01.acme.internal"
     --port 443
     --certificate-authority "/etc/strongdm/certs/aks-ca.crt"
     --client-certificate "/etc/strongdm/certs/aks-client.crt"
     --client-key "/etc/strongdm/certs/aks-client.key"
     --identity-set-name "AKS Cluster Admins"
     --identity-alias-healthcheck-username "svc_aks_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "aks-prod01"
     --tags "env=prod,cloud=azure,platform=kubernetes,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# ----------------------------
# Create AKS (Kubernetes) cluster
# ----------------------------
resource "sdm_resource" "aks_cluster_prod" {
  aks {
    # Required
    name       = "aks-cluster-prod"                              # <name>
    hostname   = "aks-prod01.acme.internal"                      # --hostname
    port       = 443                                             # --port (default 443)

    # Authentication materials (recommended: use secret store)
    certificate_authority = file("/etc/strongdm/certs/aks-ca.crt")     # --certificate-authority
    client_certificate     = file("/etc/strongdm/certs/aks-client.crt")# --client-certificate
    client_key             = file("/etc/strongdm/certs/aks-client.key")# --client-key

    # Identity and discovery configuration
    identity_set_name                     = "AKS Cluster Admins"       # --identity-set-name
    identity_alias_healthcheck_username   = "svc_aks_health"           # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                     = true                       # --discovery-enabled
    discovery_username                    = "sdm-discovery"            # --discovery-username
    healthcheck_namespace                 = "default"                  # --healthcheck-namespace

    # Common networking options
    bind_interface  = "default"                                       # --bind-interface ("default" | "loopback" | "vnm")
    port_override   = -1                                              # --port-override (-1 = auto-allocate)
    egress_filter   = "field:name tag:env=prod tag:region=us-east"    # --egress-filter
    subdomain       = "aks-prod01"                                   # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id =
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **AKS** cluster type has the following properties.

<table><thead><tr><th width="200.3707275390625">Property</th><th width="129.89990234375">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cluster Type</strong></td><td>Required</td><td><strong>AKS</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Hostname</strong></td><td>Required</td><td>Hostname or IP address of the API server, such as <code>api.aks.example.com</code>; relay server should be able to <a href="#prerequisites">connect to your target server</a> or hostname</td></tr><tr><td><strong>Port</strong></td><td>Required</td><td>Port to connect to the API server; default port value <strong>443</strong></td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see <a href="#secret-store">Secret Store options</a></td></tr><tr><td><strong>Server CA</strong></td><td>Optional</td><td>Pasted server certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the server certificate on the API server or get it in Base64 format from your existing <a href="#server-ca">Kubernetes configuration (kubeconfig) file</a></td></tr><tr><td><strong>Client Certificate</strong></td><td>Optional</td><td>Pasted client certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the client certificate on the API server or get it in Base64 format from your existing <a href="#client-certificate">Kubernetes configuration (kubeconfig) file</a></td></tr><tr><td><strong>Client Key</strong></td><td>Optional</td><td>Pasted client key (plaintext or Base64-encoded) or imported PEM file; you can either generate the client key on the API server or get it in Base64 format from your existing <a href="#client-key">Kubernetes configuration (kubeconfig) file</a></td></tr><tr><td><strong>Healthcheck Namespace</strong></td><td>Optional</td><td>If enabled for your organization, the namespace used for the resource healthcheck; defaults to <code>default</code> if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: <code>get pods</code>, <code>get deployments</code>, or <code>describe namespace</code></td></tr><tr><td><strong>Enable Resource Discovery</strong></td><td>Optional</td><td>Enables <a href="/pages/WUl2uuFXmKkTGW2HpN4t#resource-discovery">automatic discovery</a> within this cluster</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Authentication method to access the cluster; select either <strong>Leased Credential</strong> (default) or <strong>Identity Aliases</strong> (to use the Identity Aliases of StrongDM users to access the cluster)</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Resource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **Client credentials**

When your users connect to this cluster via StrongDM, they have exactly the same rights as the user associated with these keys. Make sure to consider this prior to setup.

### **Server CA**

How to get the **Server CA** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- cluster`, copy the `certificate-authority-data` value. That is the server certificate in Base64 encoding.

```yaml
  - cluster:
    certificate-authority-data: ... SERVER CERT BASE64 ...
```

### **Client certificate**

How to get the **Client Certificate** from your kubeconfig file:

1. From the CLI, type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- name`, copy the `client-certificate-data` value. That is the client certificate in Base64 encoding.

```yaml
  - name: clusterUser_StrongDM_example
    user:
    client-certificate-data: ... CLIENT CERT BASE64...
```

### **Client key**

How to get the **Client Key** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the file.
2. In the file, under `- name`, copy the `client-key-data` value. That is the client private key in Base64 encoding.

```yaml
  - name: clusterUser_StrongDM_example
    user:
    client-key-data: ... CLIENT PRIVATE KEY BASE64...
```

### **Secret Store**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating your AKS cluster resource in StrongDM, check the health status in the Admin UI. A *green* indicator means the StrongDM relay or proxy could reach the Kubernetes API server and credentials are valid.
2. From a user machine with the StrongDM Desktop App (or CLI) installed, connect to the cluster (for example: `kubectl get nodes`) via StrongDM. Confirm that a successful response is returned and your Kubernetes API calls behave as expected.
3. If you enabled Discovery, navigate to the **Discovery** tab for your cluster in the Admin UI. Verify that namespaces, roles, and subjects are being populated. This confirms StrongDM’s ability to query the cluster’s metadata.
4. If the health indicator is yellow or red:
   * Confirm that the hostname and port are correct and reachable by your nodes.
   * Check that the credentials (client certificate, key, CA or authentication mode) are valid and granted the required RBAC access in the `healthcheck_namespace`.
   * Use the **Diagnostics** tab for the cluster to review error messages and network logs.

Once successful connectivity is established and user access is tested, the cluster resource is ready to be used for user workflows, roles, and policy-driven Kubernetes access.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# EKS

Learn how to add and manage an Amazon EKS (Elastic Kubernetes Service) cluster in StrongDM.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to an Amazon Elastic Kubernetes Service (EKS) cluster via the StrongDM Admin UI. Adding an EKS cluster takes place in both the Admin UI and in the AWS Management Console.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Before you begin, ensure that the EKS endpoint you are connecting is accessible from one of your StrongDM gateways or relays. See our guide on [nodes](/admin/networking/gateways-and-relays) for more information.

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Cluster Setup

{% hint style="info" %}
You can find information about your cluster in the AWS Management Console on your EKS cluster’s general configuration page.
{% endhint %}

### Get the AWS Username and Access Credentials

1. In the AWS Management Console, go to **Identity and Access Management (IAM) > Users** and create a new **access key ID and secret access key** for the IAM user who will be accessing the EKS cluster. It does not need any specific rights.
2. Additionally, copy the **User Amazon Resource Name (ARN)** because you will need it later.

### Grant That User the Ability to Interact With Your Cluster

1. While authenticated to the cluster using your existing connection method, run the following command to edit the `aws-auth` ConfigMap (YML file) within Kubernetes:\
   `kubectl edit -n kube-system configmap/aws-auth`
2. Copy the following snippet and paste it into the file under the `data:` heading:

   ```yml
       mapUsers: |
         - userarn: <USER_ARN>/<USERNAME>
           username: <USERNAME>
           groups:
             - <GROUP>
   ```
3. In that snippet, do the following:

   1. Replace `<USER_ARN>` with the ARN of the IAM user you created.
   2. Replace `<USERNAME>` with the IAM username.
   3. Under `groups:`, specify the appropriate group for the permissions level you want this StrongDM connection to have (see [Kubernetes Roles](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings) for more details).

   Example:

   ```yml
     mapUsers: |
       - userarn: arn:aws:iam::123456789012:user/aliceglick
         username: aliceglick
         groups:
           - system:masters
   ```

{% hint style="warning" %}
The name under `groups:` in the `mapUsers` block must match the subject name in the desired ClusterRoleBinding, not the name of the ClusterRoleBinding itself. For example, if a default EKS cluster has a ClusterRoleBinding called `cluster-admin`, with a group named `system:masters`, then the name `system:masters` must be input in the `mapUsers` block under `groups:`.

In the following example of the default ClusterRoleBinding for `cluster-admin` on an unconfigured EKS cluster, you can see that the group name under `Subjects` is `system:masters`.

```yml
Name:         cluster-admin
Labels:       kubernetes.io/bootstrapping=rbac-defaults
Annotations:  rbac.authorization.kubernetes.io/autoupdate: true
Role:
  Kind:  ClusterRole
  Name:  cluster-admin
Subjects:
  Kind   Name            Namespace
  ----   ----            ---------
  Group  system:masters
```

{% endhint %}

Also note that in the YML file, the indentation is **critically important**. If the indentation is wrong, the Edit command does not trigger an error message, but the change fails. Note that `mapUsers` should be at the same indent level as `mapRoles` in that file.

4. Save the file and exit your text editor.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Infrastructure > Clusters**.
2. Click the **Add Resource** button.
3. Select **EKS** as the **Resource Type** and set other [resource properties](#resource-properties) to configure how the StrongDM relay connects.

   ![](/files/Iu95ccRn9kwrBMYNDEs3)
4. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add eks --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```sh
   NAME:
      sdm admin clusters add amazon-eks - create Elastic Kubernetes Service cluster

   USAGE:
      sdm admin clusters add amazon-eks [command options] <name>

   OPTIONS:
      --access-key-id value                        (required, secret)
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate-authority value                (secret)
      --cluster-name value                         (required)
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --endpoint value                             (required)
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --region value                               (required)
      --role-arn value                             (secret)
      --role-external-id value                     (secret)
      --secret-access-key value                    (required, secret)
      --secret-store-id value                      secret store id
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
   ```
3. Then run `sdm admin clusters add eks <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```sh
   sdm admin clusters add amazon-eks "eks-cluster-prod"
     --cluster-name "eks-prod-cluster"
     --region "us-west-2"
     --endpoint "https://ABCDE12345.gr7.us-west-2.eks.amazonaws.com"
     --access-key-id "AKIAIOSFODNN7EXAMPLE"
     --secret-access-key "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
     --role-arn "arn:aws:iam::123456789012:role/StrongDM-EKS-Access"
     --role-external-id "ext-id-eks-prod-2025"
     --certificate-authority "/etc/strongdm/certs/eks-ca.crt"
     --identity-set-name "EKS Cluster Admins"
     --identity-alias-healthcheck-username "svc_eks_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "eks-prod01"
     --tags "env=prod,cloud=aws,platform=kubernetes,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon EKS cluster
resource "sdm_resource" "eks_cluster_prod" {
  amazon_eks {
    # Required
    name         = "eks-cluster-prod"                                        # <name>
    cluster_name = "eks-prod-cluster"                                        # --cluster-name
    region       = "us-west-2"                                               # --region
    endpoint     = "https://ABCDE12345.gr7.us-west-2.eks.amazonaws.com"     # --endpoint

    # AWS credentials (use a secret store in production)
    access_key_id     = "AKIAIOSFODNN7EXAMPLE"                               # --access-key-id
    secret_access_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"           # --secret-access-key
    role_arn          = "arn:aws:iam::123456789012:role/StrongDM-EKS-Access" # --role-arn (optional)
    role_external_id  = "ext-id-eks-prod-2025"                               # --role-external-id (optional)

    # TLS / CA
    certificate_authority = file("/etc/strongdm/certs/eks-ca.crt")           # --certificate-authority

    # Identity & discovery
    identity_set_name                   = "EKS Cluster Admins"               # --identity-set-name
    identity_alias_healthcheck_username = "svc_eks_health"                   # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                   = true                                # --discovery-enabled
    discovery_username                  = "sdm-discovery"                    # --discovery-username
    healthcheck_namespace               = "default"                           # --healthcheck-namespace

    # Common networking options
    bind_interface = "default"                                               # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                                      # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-west"            # --egress-filter
    subdomain      = "eks-prod01"                                            # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                                # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                                 # --secret-store-id (recommended for keys)

    # (Legacy orgs) allow fallback auth when no resource role is provided
    allow_resource_role_bypass = false                                       # --allow-resource-role-bypass

    # Tags
    tags = {                                                                  # --tags
      env      = "prod"
      cloud    = "aws"
      platform = "kubernetes"
      team     = "devops"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **EKS** cluster type has the following properties.

<table><thead><tr><th width="200.13995361328125">Property</th><th width="130.0703125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cluster Type</strong></td><td>Required</td><td><strong>Elastic Kubernetes Service</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Endpoint</strong></td><td>Required</td><td>API server endpoint of the EKS cluster in the format <code>&#x3C;ID>.&#x3C;REGION>.eks.amazonaws.com</code>, such as <code>A95FBC180B680B58A6468EF360D16E96.yl4.us-west-2.eks.amazonaws.com</code>; relay server should be able to <a href="#prerequisites">connect to your EKS endpoint</a></td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)</td></tr><tr><td><strong>Access Key ID</strong></td><td>Required</td><td>Access key ID, such as <code>AKIAIOSFODNN7EXAMPLE</code>, from the AWS key pair that you created in Step 1</td></tr><tr><td><strong>Secret Access Key</strong></td><td>Required</td><td>Secret access key, such as <code>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</code>, from the AWS key pair that you created in Step 1</td></tr><tr><td><strong>Server CA</strong></td><td>Optional</td><td>Pasted server certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the server certificate on the API server or get it in Base64 format from your existing Kubernetes configuration (kubeconfig) file</td></tr><tr><td><strong>Cluster Name</strong></td><td>Required</td><td>Name of the EKS cluster</td></tr><tr><td><strong>Region</strong></td><td>Required</td><td>Region of the EKS cluster, such as <code>us-west-1</code></td></tr><tr><td><strong>Healthcheck Namespace</strong></td><td>Optional</td><td>If enabled for your organization, the namespace used for the resource healthcheck; defaults to <code>default</code> if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: <code>get pods</code>, <code>get deployments</code>, or <code>describe namespace</code></td></tr><tr><td><strong>Enable Resource Discovery</strong></td><td>Optional</td><td>Enables <a href="/pages/WUl2uuFXmKkTGW2HpN4t#resource-discovery">automatic discovery</a> within this cluster</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Authentication method to access the cluster; select either <strong>Leased Credential</strong> (default) or <strong>Identity Aliases</strong> (to use the Identity Aliases of StrongDM users to access the cluster)</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster</td></tr><tr><td><strong>Assume Role ARN</strong></td><td>Optional</td><td>Role ARN, such as <code>arn:aws:iam::000000000000:role/RoleName</code>, that allows users accessing this resource to assume a role using <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AWS AssumeRole</a> functionality</td></tr><tr><td><strong>Assume Role External ID</strong></td><td>Optional</td><td>External ID if leveraging an external ID to users assuming a role from another account; if used, it must be used in conjunction with <strong>Assume Role ARN</strong>; see the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">AWS documentation on using external IDs</a> for more information</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Resource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **AWS credentials**

When your users connect to this cluster, they have exactly the rights permitted by this AWS key pair. See [AWS documentation](https://docs.aws.amazon.com/eks/latest/userguide/security-iam.html) for more information.

### **Secret Store options**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown menu if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating the EKS cluster resource in the Admin UI, navigate to **Infrastructure > Clusters** and locate your newly added cluster. The health indicator should turn green once connectivity and credentials are validated.
2. On a test client using the StrongDM desktop app or CLI, connect to the cluster and run a basic command such as `kubectl get nodes`. Confirm the output returns your nodes and the connection is routed via StrongDM.
3. If discovery is enabled, in the Admin UI, verify that namespaces, roles, and service accounts appear under the cluster’s **Discovery** tab. This indicates StrongDM successfully queried the Kubernetes API.
4. If the health status remains red or yellow:
   * Verify the cluster’s endpoint, region, and IAM credentials are correct and reachable from your relay or gateway.
   * Check certificate authority and client credentials if using TLS authentication.
   * Confirm `healthcheck_namespace` exists and the identity alias user (if specified) has access.
   * Review logs in the Diagnostics tab for authentication or network errors.

Once connectivity is verified and you can perform Kubernetes operations successfully, the EKS cluster resource is ready. You can assign roles, apply policies, and monitor access through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# EKS (Instance Profile)

Learn how to add and manage an Amazon EKS cluster configured with an EC2 instance profile.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to an Amazon Elastic Kubernetes Service (EKS) Instance Profile cluster via the StrongDM Admin UI. This cluster type supports AWS IAM role authentication for EKS resources and gateways running in EC2. EKS clusters are added and managed in both the Admin UI and the AWS Management Console.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Before you begin, ensure that the EKS endpoint you are connecting is accessible from one of your StrongDM gateways or relays. See our [Nodes](/admin/networking/gateways-and-relays) guide for more information.

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Credentials-reading order

During authentication with your AWS resource, the system looks for credentials in the following places in this order:

1. Environment variables (if the Enable Environment Variables box is checked)
2. Shared credentials file
3. EC2 role or ECS profile

As soon as the relay or gateway finds credentials, it stops searching and uses them. Due to this behavior, we recommend that all similar AWS resources with these authentication options use the same method when added to StrongDM.

For example, if you are using environment variables for AWS Management Console and using EC2 role authentication for an EKS cluster, when users attempt to connect to the EKS cluster through the gateway or relay, the environment variables are found and used in an attempt to authenticate with the EKS cluster, which then fails. We recommend using the same type for all such resources to avoid this problem at the gateway or relay level. Alternatively, you can segment your network by creating subnets with their own relays and sets of resources, so that the relays can be configured to work correctly with just those resources.

## Cluster setup

{% hint style="info" %}
You can find information about your cluster in the AWS Management Console on your EKS cluster’s general configuration page.
{% endhint %}

### Manage the IAM role

1. In the AWS Management Console, go to **Identity and Access Management (IAM) > Roles**.
2. Create a role to be used for accessing the cluster, or select an existing role to be used.
3. Attach or set the role to what you are using to run your relay (for example, an EC2 instance, ECS task, EKS pod, and so forth). See AWS documentation for information on how to [attach roles to EC2 instances](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html), [set the role of an ECS task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html), and [set the role of a pod in EKS](https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html).
4. Copy the **Role ARN** (the Amazon Resource Name specifying the role).

### Grant the role the ability to interact with the cluster

1. While authenticated to the cluster using your existing connection method, run the following command to edit the `aws-auth` ConfigMap (YML file) within Kubernetes:

```yml
kubectl edit -n kube-system configmap/aws-auth
```

2. Copy the following snippet and paste it into the file under the `data:` heading, as shown:

```yml
data:
  mapRoles: |
    - rolearn: <ARN_OF_INSTANCE_ROLE>
      username: <USERNAME>
      groups:
        - <GROUP>
```

3. In that snippet, do the following:

   1. Replace `<ARN_OF_INSTANCE_ROLE>` with the ARN of the instance role.
   2. Under `groups:`, replace `<GROUP>` with the appropriate group for the permissions level you want this StrongDM connection to have (see [Kubernetes Roles](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#default-roles-and-role-bindings) for more details).

   Example:

```yml
data:
  mapRoles: |
    - rolearn: arn:aws:iam::123456789012:role/Example
      username: system:node:{{EC2PrivateDNSNameExample}}
      groups:
        - system:masters
```

{% hint style="warning" %}
The name under `groups:` in the `mapRoles` block must match the subject name in the desired ClusterRoleBinding, not the name of the ClusterRoleBinding itself. For example, if a default EKS cluster has a ClusterRoleBinding called `cluster-admin`, with a group named `system:masters`, then the name `system:masters` must be input in the `mapRoles` block under `groups:`.

In the following example of the default ClusterRoleBinding for `cluster-admin` on an unconfigured EKS cluster, you can see that the group name under `Subjects` is `system:masters`.

```yml
Name:         cluster-admin
Labels:       kubernetes.io/bootstrapping=rbac-defaults
Annotations:  rbac.authorization.kubernetes.io/autoupdate: true
Role:
  Kind:  ClusterRole
  Name:  cluster-admin
Subjects:
  Kind   Name            Namespace
  ----   ----            ---------
  Group  system:masters
```

{% endhint %}

Also note that in the YML file, the indentation is **critically important**. If the indentation is wrong, the Edit command does not trigger an error message, but the change fails. Note that `mapRoles` should be at the same indent level as `mapUsers` in that file.

4. Save the file and exit your text editor.

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Infrastructure > Clusters**.
2. Click the **Add Resource** button.
3. Select **Elastic Kubernetes Service (instance profile)** as the **Resource Type** and set other [resource properties](#resource-properties) to configure how the StrongDM relay connects.

   ![](/files/OgEu0C9BUYfZT5KZwCGf)
4. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add`` ``eks-instance-profile --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   <pre class="language-sh"><code class="lang-sh"><strong>NAME:
   </strong>   sdm admin clusters add amazon-eks-instance-profile - create Elastic Kubernetes Service (instance profile) cluster

   USAGE:
      sdm admin clusters add amazon-eks-instance-profile [command options] &#x3C;name>

   OPTIONS:
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate-authority value                (secret)
      --cluster-name value                         (required)
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --endpoint value                             (required)
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --region value                               (required)
      --role-arn value                             (secret)
      --role-external-id value                     (secret)
      --secret-store-id value                      secret store id
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.&#x3C;your-org-name>.&#x3C;sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command

   </code></pre>
3. Then run `sdm admin clusters add eks-instance-profile <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```sh
   sdm admin clusters add amazon-eks-instance-profile "eks-cluster-ip-prod"
     --cluster-name "eks-prod-instance-profile"
     --region "us-east-1"
     --endpoint "https://ABCDE12345.gr7.us-east-1.eks.amazonaws.com"
     --certificate-authority "/etc/strongdm/certs/eks-ca.crt"
     --role-arn "arn:aws:iam::123456789012:role/StrongDM-EKS-Access"
     --role-external-id "ext-id-eks-ip-prod-2025"
     --identity-set-name "EKS Instance Profile Admins"
     --identity-alias-healthcheck-username "svc_eks_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-east'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "eks-ip-prod01"
     --tags "env=prod,cloud=aws,platform=kubernetes,auth=instance-profile,team=platform"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon EKS (Instance Profile) cluster
resource "sdm_resource" "eks_instance_profile_prod" {
  amazon_eks_instance_profile {
    # Required
    name         = "eks-cluster-ip-prod"                                   # <name>
    cluster_name = "eks-prod-instance-profile"                              # --cluster-name
    region       = "us-east-1"                                              # --region
    endpoint     = "https://ABCDE12345.gr7.us-east-1.eks.amazonaws.com"    # --endpoint

    # TLS / CA
    certificate_authority = file("/etc/strongdm/certs/eks-ca.crt")         # --certificate-authority

    # Optional role assumption (with instance profile as base auth)
    role_arn         = "arn:aws:iam::123456789012:role/StrongDM-EKS-Access" # --role-arn (optional)
    role_external_id = "ext-id-eks-ip-prod-2025"                            # --role-external-id (optional)

    # Identity & discovery
    identity_set_name                   = "EKS Instance Profile Admins"     # --identity-set-name
    identity_alias_healthcheck_username = "svc_eks_health"                  # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                   = true                               # --discovery-enabled
    discovery_username                  = "sdm-discovery"                   # --discovery-username
    healthcheck_namespace               = "default"                          # --healthcheck-namespace

    # Common networking options
    bind_interface = "default"                                              # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                                     # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-east"           # --egress-filter
    subdomain      = "eks-ip-prod01"                                        # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                               # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                                # --secret-store-id (for CA or extras)

    # (Legacy orgs) allow fallback auth when no resource role is provided
    allow_resource_role_bypass = false                                      # --allow-resource-role-bypass

    # Tags
    tags = {                                                                 # --tags
      env      = "prod"
      cloud    = "aws"
      platform = "kubernetes"
      auth     = "instance-profile"
      team     = "platform"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **EKS (instance profile)** cluster type has the following properties.

<table><thead><tr><th width="199.788330078125">Property</th><th width="130.1932373046875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cluster Type</strong></td><td>Required</td><td><strong>Elastic Kubernetes Service (instance profile)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Endpoint</strong></td><td>Required</td><td>API server endpoint of the EKS cluster in the format <code>&#x3C;ID>.&#x3C;REGION>.eks.amazonaws.com</code>, such as <code>A95FBC180B680B58A6468EF360D16E96.yl4.us-west-2.eks.amazonaws.com</code>; relay server should be able to <a href="#prerequisites">connect to your EKS endpoint</a></td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see <a href="#secret-store-options">Secret Store options</a></td></tr><tr><td><strong>Server CA</strong></td><td>Optional</td><td>Pasted server certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the server certificate on the API server or get it in Base64 format from your existing Kubernetes configuration (kubeconfig) file</td></tr><tr><td><strong>Cluster Name</strong></td><td>Required</td><td>Name of the EKS cluster</td></tr><tr><td><strong>Region</strong></td><td>Required</td><td>Region of the EKS cluster, such as <code>us-west-1</code></td></tr><tr><td><strong>Healthcheck Namespace</strong></td><td>Optional</td><td>If enabled for your organization, the namespace used for the resource healthcheck; defaults to <code>default</code> if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: <code>get pods</code>, <code>get deployments</code>, or <code>describe namespace</code></td></tr><tr><td><strong>Enable Resource Discovery</strong></td><td>Optional</td><td>Enables <a href="/pages/WUl2uuFXmKkTGW2HpN4t#resource-discovery">automatic discovery</a> within this cluster</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Authentication method to access the cluster; select either <strong>Leased Credential</strong> (default) or <strong>Identity Aliases</strong> (to use the Identity Aliases of StrongDM users to access the cluster)</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster</td></tr><tr><td><strong>Assume Role ARN</strong></td><td>Optional</td><td>Role ARN, such as <code>arn:aws:iam::000000000000:role/RoleName</code>, that allows users accessing this resource to assume a role using <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AWS AssumeRole</a> functionality</td></tr><tr><td><strong>Assume Role External ID</strong></td><td>Optional</td><td>External ID if leveraging an external ID to users assuming a role from another account; if used, it must be used in conjunction with <strong>Assume Role ARN</strong>; see the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html">AWS documentation on using external IDs</a> for more information</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Resource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **Client credentials**

When your users connect to this cluster, they have exactly the rights permitted by this AWS key pair. See [AWS documentation](https://docs.aws.amazon.com/eks/latest/userguide/security-iam.html) for more information.

### **Server CA**

How to get the **Server CA** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- cluster`, copy the `certificate-authority-data` value. That is the server certificate in Base64 encoding.

```yaml
  - cluster:
    certificate-authority-data: ... SERVER CERT BASE64 ...
```

### **Secret Store options**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown menu if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating the EKS (Instance Profile) cluster resource in the Admin UI, navigate to **Infrastructure > Clusters** and locate your newly added cluster. The health indicator should turn green once StrongDM successfully connects to the EKS control plane using the instance profile role.
2. On a test client using the StrongDM desktop app or CLI, connect to the cluster and run a basic command such as:

   ```bash
   kubectl get nodes
   ```

   Confirm that the output lists your EKS nodes and that the connection is routed through StrongDM.
3. If **Discovery** is enabled, in the Admin UI verify that namespaces, roles, and service accounts appear under the cluster’s **Discovery** tab. This confirms StrongDM successfully queried the Kubernetes API.
4. If the health status remains red or yellow:

   * Verify the cluster’s endpoint, region, and instance profile permissions are correct and reachable from your relay or gateway.
   * Check the certificate authority file and ensure the control plane endpoint uses valid TLS configuration.
   * Confirm the `healthcheck_namespace` exists and the identity alias user (if specified) has access to perform Kubernetes health checks.
   * Review the **Diagnostics** tab for authentication, IAM, or network errors.

   Once connectivity is verified and Kubernetes operations succeed, the EKS (Instance Profile) cluster resource is ready for use. You can assign roles, apply policies, and monitor cluster access through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# GKE

Learn how to add and manage a Google Kubernetes Engine (GKE) cluster in StrongDM.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to an Google Kubernetes Engine (GKE) cluster. Adding a GKE cluster takes place in the StrongDM Admin UI, Google Cloud Console, and Google Developers Console.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Before you begin, ensure that the GKE endpoint you are connecting is accessible from one of your StrongDM gateways or relays. See our guide on [nodes](/admin/networking/gateways-and-relays) for more information.

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Infrastructure > Clusters**.
2. Click the **Add Resource** button.
3. Select **Google Kubernetes Engine** as the **Resource Type** and set other [resource properties](#resource-properties) to configure how the StrongDM relay connects.

   ![](/files/riDyrrv9nnXKDa8ySrXg)
4. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add gke --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```sh
   NAME:
      sdm admin clusters add gke - create Google Kubernetes Engine cluster

   USAGE:
      sdm admin clusters add gke [command options] <name>

   OPTIONS:
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate-authority value                (secret)
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --endpoint value                             (required)
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --secret-store-id value                      secret store id
      --service-account-key value                  (required, secret)
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
   ```
3. Then run `sdm admin clusters add gke <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```sh
   sdm admin clusters add gke "gke-cluster-prod"
     --endpoint "https://35.225.123.45"
     --service-account-key "/etc/strongdm/keys/gcp-service-account.json"
     --certificate-authority "/etc/strongdm/certs/gke-ca.crt"
     --identity-set-name "GKE Cluster Admins"
     --identity-alias-healthcheck-username "svc_gke_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-central1'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "gke-prod01"
     --tags "env=prod,cloud=gcp,platform=kubernetes,team=platform"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# ----------------------------
# Create Google Kubernetes Engine (GKE) cluster
# ----------------------------
resource "sdm_resource" "gke_cluster_prod" {
  gke {
    # Required
    name                  = "gke-cluster-prod"                      # <name>
    endpoint              = "https://35.225.123.45"                 # --endpoint
    service_account_key   = file("/etc/strongdm/keys/gcp-service-account.json")  # --service-account-key (use secret store for production)

    # TLS / CA
    certificate_authority = file("/etc/strongdm/certs/gke-ca.crt")  # --certificate-authority

    # Identity & discovery
    identity_set_name                   = "GKE Cluster Admins"      # --identity-set-name
    identity_alias_healthcheck_username = "svc_gke_health"          # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                   = true                      # --discovery-enabled
    discovery_username                  = "sdm-discovery"           # --discovery-username
    healthcheck_namespace               = "default"                 # --healthcheck-namespace

    # Common networking options
    bind_interface = "default"                                      # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                             # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-central1" # --egress-filter
    subdomain      = "gke-prod01"                                   # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                       # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                        # --secret-store-id (recommended for key and cert storage)

    # (Legacy orgs) allow fallback auth when no resource role is provided
    allow_resource_role_bypass = false                              # --allow-resource-role-bypass

    # Tags
    tags = {                                                        # --tags
      env      = "prod"
      cloud    = "gcp"
      platform = "kuberne
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **GKE** cluster type has the following properties.

<table><thead><tr><th width="200.1505126953125">Property</th><th width="130.0845947265625">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cluster Type</strong></td><td>Required</td><td><strong>Google Kubernetes Engine</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Endpoint</strong></td><td>Required</td><td>Endpoint of the GKE cluster, such as <code>35.232.191.126</code>; relay server should be able to <a href="#prerequisites">connect to your GKE endpoint</a></td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see <a href="#secret-store-options">Secret Store options</a></td></tr><tr><td><strong>Server CA</strong></td><td>Optional</td><td>Server CA, which is available under the <strong>Show Credentials</strong> link just to the right of the endpoint in the <a href="https://console.cloud.google.com/kubernetes">Google Cloud Platform console</a></td></tr><tr><td><strong>Service Account Key</strong></td><td>Required</td><td>Service account key in JSON format; you can generate this key in the <a href="https://console.developers.google.com/apis/credentials">Google Developers Console</a>; ensure it is associated with a user having the appropriate level of access to the cluster for your use case; once generated, upload the key using the button below the <strong>Service Account Key</strong> box</td></tr><tr><td><strong>Healthcheck Namespace</strong></td><td>Optional</td><td>If enabled for your organization, the namespace used for the resource healthcheck; defaults to <code>default</code> if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: <code>get pods</code>, <code>get deployments</code>, or <code>describe namespace</code></td></tr><tr><td><strong>Enable Resource Discovery</strong></td><td>Optional</td><td>Enables <a href="/pages/WUl2uuFXmKkTGW2HpN4t#resource-discovery">automatic discovery</a> within this cluster</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Authentication method to access the cluster; select either <strong>Leased Credential</strong> (default) or <strong>Identity Aliases</strong> (to use the Identity Aliases of StrongDM users to access the cluster)</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Resource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **Google credentials**

When your users connect to this cluster, they have exactly the rights permitted by this Google Service Account key. See [this Google document](https://cloud.google.com/kubernetes-engine/docs/tutorials/authenticating-to-cloud-platform) for more information.

### **Secret Store options**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown menu if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating the GKE cluster resource in the Admin UI, navigate to **Infrastructure > Clusters** and locate your newly added cluster. The health indicator should turn green once connectivity and credentials are validated.
2. On a test client using the StrongDM desktop app or CLI, connect to the cluster and run a basic command such as `kubectl get nodes`. Confirm the output returns your nodes and the connection is routed via StrongDM.
3. If discovery is enabled, in the Admin UI verify that namespaces, roles, and service accounts appear under the cluster’s **Discovery** tab. This confirms StrongDM successfully queried the Kubernetes API and retrieved metadata from your GKE cluster.
4. If the health status remains red or yellow:
   * Verify the cluster’s endpoint, region, and service account permissions are correct and reachable from your relay or gateway.
   * Check the certificate authority file and ensure the GKE control plane endpoint uses valid TLS configuration.
   * Confirm the `healthcheck_namespace` exists and that the identity alias healthcheck user (if specified) has appropriate access.
   * Review the **Diagnostics** tab in the Admin UI for authentication or network-related errors.

Once connectivity is verified and Kubernetes operations succeed, the GKE cluster resource is ready. You can assign roles, apply access policies, and monitor all cluster activity through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Kubernetes

Learn how to add a Kubernetes cluster in StrongDM. Use the Kubernetes resource type in StrongDM to secure and audit access to any self-managed or cloud-hosted Kubernetes API server.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to manage access to a Kubernetes cluster via the StrongDM Admin UI. This process involves creating and configuring a new cluster in the Admin UI and checking the connection to your Kubernetes API server.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Ensure that the Kubernetes API server that you are adding to StrongDM is accessible from your StrongDM gateways or relays. See our guide on [nodes](/admin/networking/gateways-and-relays) for more information.

{% hint style="info" %}
Your gateways or relays must be able to connect to the entry you choose for the hostname. To verify the connection, use the command prompt from the gateway or relay server and type `nc -z <HOSTNAME> port`. If your server can connect to this hostname, you can proceed.
{% endhint %}

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the Admin UI and go to **Infrastructure > Clusters**.
2. Click the **Add Resource** button.
3. Select **Kubernetes** as the **Resource Type** and set other [resource properties](#resource-properties) to configure how the StrongDM relay connects.
4. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a green or yellow state. Green indicates a successful connection. If it is yellow, click the **pencil** icon to the right of the server to reopen the **Connection Details** screen. Then click **Diagnostics** to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add kubernetes --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```sh
   NAME:
      sdm admin clusters add k8s - create Kubernetes cluster

   USAGE:
      sdm admin clusters add k8s [command options] <name>

   OPTIONS:
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --certificate-authority value                (secret)
      --client-certificate value                   (secret)
      --client-key value                           (secret)
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --hostname value                             (required)
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port value                                 (required) (default: 443)
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --secret-store-id value                      secret store id
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
   ```
3. Then run `sdm admin clusters add kubernetes <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```sh
   sdm admin clusters add k8s "k8s-cluster-prod"
     --hostname "k8s-prod01.acme.internal"
     --port 443
     --certificate-authority "/etc/strongdm/certs/k8s-ca.crt"
     --client-certificate "/etc/strongdm/certs/k8s-client.crt"
     --client-key "/etc/strongdm/certs/k8s-client.key"
     --identity-set-name "K8s Cluster Admins"
     --identity-alias-healthcheck-username "svc_k8s_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter 'field:name tag:env=prod tag:region=us-west'
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "k8s-prod01"
     --tags "env=prod,platform=kubernetes,auth=cert,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Kubernetes cluster
resource "sdm_resource" "k8s_cluster_prod" {
  k8s {
    # Required
    name     = "k8s-cluster-prod"                           # <name>
    hostname = "k8s-prod01.acme.internal"                   # --hostname
    port     = 443                                           # --port (default 443)

    # TLS / client auth (recommended: use secret store)
    certificate_authority = file("/etc/strongdm/certs/k8s-ca.crt")      # --certificate-authority
    client_certificate     = file("/etc/strongdm/certs/k8s-client.crt") # --client-certificate
    client_key             = file("/etc/strongdm/certs/k8s-client.key") # --client-key

    # Identity & discovery
    identity_set_name                   = "K8s Cluster Admins" # --identity-set-name
    identity_alias_healthcheck_username = "svc_k8s_health"     # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                   = true                 # --discovery-enabled
    discovery_username                  = "sdm-discovery"      # --discovery-username
    healthcheck_namespace               = "default"            # --healthcheck-namespace

    # Common networking options
    bind_interface = "default"                                 # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                        # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-west" # --egress-filter
    subdomain      = "k8s-prod01"                              # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                  # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                   # --secret-store-id (recommended for keys/certs)

    # (Legacy orgs) allow fallback auth when no resource role is provided
    allow_resource_role_bypass = false                         # --allow-resource-role-bypass

    # Tags
    tags = {                                                   # --tags
      env      = "prod"
      platform = "kubernetes"
      auth     = "mtls"
      team     = "devops"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource properties

The **Kubernetes** cluster type has the following properties.

| Property                      | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**              | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**             | Required    | **Kubernetes**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Proxy Cluster**             | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                  | Required    | Hostname or IP address of the Kubernetes API server, such as `api.kubernetes.example.com`; relay server should be able to [connect to your Kubernetes API server](#prerequisites)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Port**                      | Required    | Port to connect to the API server; default port value **443**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Connectivity Mode**         | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**             | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                       | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**              | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see [Secret Store options](#secret-store-options)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Server CA**                 | Optional    | Pasted server certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the server certificate on the API server or get it in Base64 format from your existing [Kubernetes configuration (kubeconfig) file](#server-ca)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Client Certificate**        | Optional    | Pasted client certificate (plaintext or Base64-encoded), or imported PEM file; you can either generate the client certificate on the API server or get it in Base64 format from your existing [Kubernetes configuration (kubeconfig) file](#client-certificate)                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Client Key**                | Optional    | Pasted client key (plaintext or Base64-encoded) or imported PEM file; you can either generate the client key on the API server or get it in Base64 format from your existing [Kubernetes configuration (kubeconfig) file](#client-key)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Healthcheck Namespace**     | Optional    | If enabled for your organization, the namespace used for the resource healthcheck; defaults to `default` if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: `get pods`, `get deployments`, or `describe namespace`                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Enable Resource Discovery** | Optional    | Enables [automatic discovery](#resource-discovery) within this cluster                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Authentication**            | Required    | Authentication method to access the cluster; select either **Leased Credential** (default) or **Identity Aliases** (to use the Identity Aliases of StrongDM users to access the cluster)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Identity Set**              | Required    | Displays if **Authentication** is set to **Identity Aliases**; select an Identity Set name from the list                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Healthcheck Username**      | Required    | If **Authentication** is set to **Identity Aliases**, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Resource Tags**             | Optional    | Resource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not function properly with cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **Client credentials**

When your users connect to this cluster via StrongDM, they have exactly the same rights as the user associated with these keys. Make sure to consider this prior to setup.

### **Server CA**

How to get the **Server CA** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- cluster`, copy the `certificate-authority-data` value. That is the server certificate in Base64 encoding.

```yaml
  - cluster:
    certificate-authority-data: ... SERVER CERT BASE64 ...
```

**Client certificate**

How to get the **Client Certificate** from your kubeconfig file:

1. From the CLI, type `cat ~/.kube/config` to view the contents of the file.
2. In the file, under `- name`, copy the `client-certificate-data` value. That is the client certificate in Base64 encoding.

```yaml
  - name: clusterUser_StrongDM_example
    user:
    client-certificate-data: ... CLIENT CERT BASE64...
```

### **Client key**

How to get the **Client Key** from your kubeconfig file:

1. Open the CLI and type `cat ~/.kube/config` to view the file.
2. In the file, under `- name`, copy the `client-key-data` value. That is the client private key in Base64 encoding.

```yaml
  - name: clusterUser_StrongDM_example
    user:
    client-key-data: ... CLIENT PRIVATE KEY BASE64...
```

### **Secret Store**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating the Kubernetes cluster resource in the Admin UI, navigate to **Infrastructure > Clusters** and locate your newly added cluster. The health indicator should turn green once connectivity and credentials are validated.
2. On a test client using the StrongDM desktop app or CLI, connect to the cluster and run a basic command such as `kubectl get nodes`. Confirm the output returns your nodes and the connection is routed via StrongDM.
3. If discovery is enabled, in the Admin UI verify that namespaces, roles, and service accounts appear under the cluster’s **Discovery** tab. This indicates StrongDM successfully queried the Kubernetes API.
4. If the health status remains red or yellow:
   * Verify the cluster’s hostname, port, and base credentials (CA, client certificate/key) are correct and reachable from your relay or gateway.
   * Check the certificate-authority and client credentials if using mTLS.
   * Confirm the `healthcheck_namespace` exists and the identity alias or health-check user (if specified) has the permissions to `get pods`, `get deployments`, or `describe namespace`.
   * Review the **Diagnostics** tab for authentication or network errors.

Once connectivity is verified and you can perform Kubernetes operations successfully, the cluster resource is ready. You can assign roles, apply policies, and monitor access through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Kubernetes (Service Account)

The Kubernetes (Service Account) resource type in StrongDM enables you to grant access to a self-managed or on-premises Kubernetes cluster by using a service account token for authentication.

{% hint style="info" %}
For an overview of the available Kubernetes features and supported platforms, please see our [Kubernetes guide](/admin/resources/clusters).
{% endhint %}

## Overview

This guide describes how to set up a Kubernetes cluster in StrongDM with the credentials of a Kubernetes service account. This process involves setting up a Kubernetes cluster, generating a permanent service account token, and using that token to configure a new Kubernetes (Service Account) cluster in the StrongDM Admin UI. When done with this guide, you will be able to use StrongDM to connect to a Kubernetes cluster with the credentials of a Kubernetes service account.

{% hint style="info" %}
If you would like to learn more about how to enable automatic resource discovery within your Kubernetes cluster, or use privilege levels to allow users to request various levels of access to the Kubernetes cluster, please read the [Kubernetes Discovery and Privilege Levels](/admin/resources/clusters/kubernetes-management) section to learn more about those features prior to following this configuration guide.
{% endhint %}

## Prerequisites

Ensure that the API server you intend to add to StrongDM is accessible from your StrongDM nodes (gateways, relays, or proxy clusters). See our guide on [Nodes](/admin/networking/gateways-and-relays) for more information.

{% hint style="info" %}
If you are using kubectl 1.30 or higher, it will default to using websockets, which the StrongDM client did not support prior to version 45.35.0. This can be remedied by taking one of the following actions:

* Update your client to version 45.35.0 or greater.
* Set the environment variable `KUBECTL_REMOTE_COMMAND_WEBSOCKETS=false` to restore the previous behavior in your kubectl.
  {% endhint %}

## Configure the Kubernetes Cluster

Before you can add the cluster to your StrongDM environment, you need to set up the cluster itself. Follow these steps to configure your cluster.

1. Create a ServiceAccount:

   ```yaml
   kubectl create serviceaccount <serviceaccount-name>
   ```
2. Create a Role or ClusterRole.

{% hint style="info" %}
The permissions given in this Role are exactly what StrongDM users get when they connect to this resource.
{% endhint %}

The following example ClusterRole gives blanket permissions to the whole cluster:

```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  annotations:
    rbac.authorization.kubernetes.io/autoupdate: "true"
  labels:
    kubernetes.io/bootstrapping: rbac-defaults
  name: <clusterrolebinding-name>
rules:
  - apiGroups:
      - '*'
    resources:
      - '*'
    verbs:
      - '*'
  - nonResourceURLs:
      - '*'
    verbs:
      - '*'
```

3. Create a RoleBinding or ClusterRoleBinding to associate the Role or ClusterRole with the ServiceAccount.

   To create a RoleBinding:

   ```yaml
   kubectl create rolebinding <rolebinding-name> --role <role-name> --serviceaccount <serviceaccount-name>
   ```

   To create a ClusterRoleBinding:

   ```yaml
   kubectl create clusterrolebinding <clusterrolebinding-name> --clusterrole <clusterrole-name> --serviceaccount <serviceaccount-name>
   ```
4. Create a Secret to manually generate a permanent token.

{% hint style="info" %}
In this step, you manually create a token secret that the kube-apiserver detects and then populates with a token associated with the ServiceAccount. This secret (and token) does not expire. For reference, please see the Kubernetes documentation, [Configure Service Accounts for Pods](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-long-lived-api-token-for-a-serviceaccount).
{% endhint %}

1. First save and complete the following yaml template:

   ```yaml
   apiVersion: v1
   kind: Secret
   metadata:
     name: build-robot-secret
     annotations:
       kubernetes.io/service-account.name: <serviceaccount-name>
   type: kubernetes.io/service-account-token
   ```
2. Run:

   ```yaml
   kubectl apply -f template.yaml
   ```
3. If not done already, obtain the generated token by inspecting the Secret just created.

   ```yaml
   kubectl get secret spirit -o json | jq -r '.data.token'
   ```
4. Save the token in a safe place, as you will need it when adding your resource in the StrongDM Admin UI next.

{% hint style="info" %}
There are alternative ways to generate tokens, other than the manual way described in this guide. However, such ways typically yield temporary tokens, which may adversely affect resource registration. For example, if the following command is used to get a token directly to stdout, the `--duration` flag may not be respected:

`kubectl create token <serviceaccount-name> --duration <duration> | pbcopy`
{% endhint %}

## Resource Configuration in StrongDM

This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add the resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI and go to **Resources** > **Managed Resources**.
2. Click **Add Resource**.
3. For **Resource Type**, select **Kubernetes (Service Account)**.
4. For **API Token**, set the token that you generated and saved in the previous section of this guide.
5. Set all other required [resource properties](#resource-properties) to configure how the StrongDM node connects.
6. Click **Create** to save the resource.

The Admin UI updates and shows your new cluster in a healthy or unhealthy state. Healthy indicates a successful connection. If it is unhealthy, click into the cluster's name and view the **Diagnostics** tab to determine where the connection is failing.
{% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](https://docs.strongdm.com/references/cli) documentation.

1. In your terminal or Command Prompt, log in to StrongDM:

   ```sh
   sdm login
   ```
2. Run `sdm admin clusters add`` ``k8s-service --help` to view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which [properties](#resource-properties) are required and collect the values for them.

   ```sh
   NAME:
      sdm admin clusters add k8s-service - create Kubernetes (Service Account) cluster

   USAGE:
      sdm admin clusters add k8s-service [command options] <name>

   OPTIONS:
      --allow-resource-role-bypass                 (For legacy orgs) allows users to fallback to the existing authentication mode (Leased Credential or Identity Set) when a resource role is not provided.
      --api-token value                            (required, secret)
      --bind-interface value                       IP address on which to listen for connections to this resource on clients. Specify "default", "loopback", or "vnm" to automatically allocate an available address from the corresponding IP range configured in the organization. (default: "default")
      --discovery-enabled                          Enable discovery for the cluster.
      --discovery-username value                   The user to impersonate in the cluster when running discovery. Required if the cluster is configured for identity aliases. (conditional)
      --egress-filter value                        apply filter to select egress nodes e.g. 'field:name tag:key=value ...'
      --healthcheck-namespace default              This path will be used to check the health of your connection.  Defaults to default.
      --hostname value                             (required)
      --identity-alias-healthcheck-username value  (conditional)
      --identity-set-id value                      
      --identity-set-name value                    set the identity set by name
      --port value                                 (required) (default: 443)
      --port-override value                        Port on which to listen for connections to this resource on clients. Specify "-1" to automatically allocate an available port. (default: -1)
      --proxy-cluster-id value                     proxy cluster id
      --secret-store-id value                      secret store id
      --subdomain value, --bind-subdomain value    DNS subdomain through which this resource may be accessed on clients (e.g. "app-prod" allows the resource to be accessed as "app-prod.<your-org-name>.<sdm-proxy-domain>"). Only applicable to HTTP-based resources or resources using virtual networking mode.
      --tags value                                 tags e.g. 'key=value,...'
      --template, -t                               display a JSON template
      --timeout value                              set time limit for command
   ```
3. Then run `sdm admin clusters add`` ``k8s-service <RESOURCE_NAME>` and set all required properties with their values. For example:

   ```sh
   sdm admin clusters add k8s-service "k8s-service-prod"
     --hostname "k8s-prod01.acme.internal"
     --port 443
     --api-token "eyJhbGciOiJSUzI1NiIsImtpZCI6..."
     --identity-set-name "K8s Cluster Admins"
     --identity-alias-healthcheck-username "svc_k8s_health"
     --discovery-enabled
     --discovery-username "sdm-discovery"
     --healthcheck-namespace "default"
     --bind-interface "default"
     --port-override -1
     --egress-filter "field:name tag:env=prod tag:region=us-west"
     --proxy-cluster-id "plc_0123456789abcdef"
     --secret-store-id "ss_abcdef0123456789"
     --subdomain "k8s-service-prod01"
     --tags "env=prod,platform=kubernetes,auth=service-account,team=devops"
     --timeout 30
   ```
4. Check that the resource has been added. The output of the following command should show the resource's name:

   ```sh
   sdm admin clusters list
   ```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```hcl
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from the Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Kubernetes (Service Account) cluster
resource "sdm_resource" "k8s_service_cluster_prod" {
  k8s_service {
    # Required
    name      = "k8s-service-cluster-prod"          # <name>
    hostname  = "k8s-prod01.acme.internal"          # --hostname
    port      = 443                                 # --port (default 443)
    api_token = "eyJhbGciOiJSUzI1NiIsImtpZCI6..."   # --api-token (use secret store in production)

    # Identity & discovery
    identity_set_name                   = "K8s Service Account Admins" # --identity-set-name
    identity_alias_healthcheck_username = "svc_k8s_health"             # --identity-alias-healthcheck-username (conditional)
    discovery_enabled                   = true                         # --discovery-enabled
    discovery_username                  = "sdm-discovery"              # --discovery-username
    healthcheck_namespace               = "default"                    # --healthcheck-namespace

    # Common networking options
    bind_interface = "default"                                        # --bind-interface ("default" | "loopback" | "vnm")
    port_override  = -1                                               # --port-override (-1 = auto-allocate)
    egress_filter  = "field:name tag:env=prod tag:region=us-west"     # --egress-filter
    subdomain      = "k8s-service-prod01"                             # --subdomain / --bind-subdomain (for VN access)

    # Optional integrations
    proxy_cluster_id = "plc_0123456789abcdef"                         # --proxy-cluster-id
    secret_store_id  = "ss_abcdef0123456789"                          # --secret-store-id (recommended for tokens)

    # (Legacy orgs) allow fallback auth when no resource role is provided
    allow_resource_role_bypass = false                                # --allow-resource-role-bypass

    # Tags
    tags = {                                                          # --tags
      env      = "prod"
      platform = "kubernetes"
      auth     = "service-account"
      team     = "devops"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and Manage With SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Go            | ​[pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17)​ | ​[strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)​         | ​[Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)​         |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Java          | ​[javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)​            | ​[strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)​     | ​[Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)​     |
| Python        | ​[pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)​            | ​[strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python)​ | ​[Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples)​ |
| Ruby          | ​[RubyDoc](https://www.rubydoc.info/gems/strongdm)​                        | ​[strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)​     | ​[Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)​     |
| {% endtab %}  |                                                                            |                                                                          |                                                                                   |
| {% endtabs %} |                                                                            |                                                                          |                                                                                   |

## Resource Properties

The following table describes the configuration properties available for your Kubernetes (Service Account) cluster.

<table><thead><tr><th width="200.1824951171875">Property</th><th width="129.7401123046875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><strong>Display Name</strong></td><td>Required</td><td>Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (&#x3C; or >)</td></tr><tr><td><strong>Cluster Type</strong></td><td>Required</td><td><strong>Kubernetes (Service Account)</strong></td></tr><tr><td><strong>Proxy Cluster</strong></td><td>Required</td><td>Defaults to "None (use gateways)"; if using <a href="/pages/UPxilwQwoQwFOlrkBP47">proxy clusters</a>, select the appropriate cluster to proxy traffic to this resource</td></tr><tr><td><strong>Hostname</strong></td><td>Required</td><td>Hostname or IP address of the API server, such as <code>api.aks.example.com</code>; relay server should be able to <a href="#prerequisites">connect to your target server</a> or hostname</td></tr><tr><td><strong>Port</strong></td><td>Required</td><td>Port to connect to the API server; default port value <strong>443</strong></td></tr><tr><td><strong>Connectivity Mode</strong></td><td>Required</td><td>Select either <strong>Virtual Networking Mode</strong>, which lets users connect to the resource with a software-defined, IP-based network; or <strong>Loopback Mode</strong>, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> enabled for your organization</td></tr><tr><td><strong>IP Address</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if <strong>Loopback Mode</strong> is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, <code>127.0.0.1</code>); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if <a href="/pages/lNQp0yqAK0qXnqCStPcb">Virtual Networking Mode</a> and/or <a href="/pages/RlpqrMxEZ1S3YOOA4Kpi">multi-loopback mode</a> is enabled for your organization</td></tr><tr><td><strong>Port Override</strong></td><td>Optional</td><td>If <strong>Virtual Networking Mode</strong> is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if <strong>Loopback Mode</strong> is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the <a href="/pages/ux26VjQ6BPsV3H8wjn1v">Port Overrides settings</a></td></tr><tr><td><strong>DNS</strong></td><td>Optional</td><td>If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, <code>k8s.my-organization-name</code>) instead of the bind address that includes IP address and port (for example, <code>100.64.100.100:5432</code>)</td></tr><tr><td><strong>Secret Store</strong></td><td>Optional</td><td>Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see <a href="#secret-store">Secret Store options</a></td></tr><tr><td><strong>API Token</strong></td><td>Required</td><td>Permanent token associated with the ServiceAccount on the Kubernetes cluster</td></tr><tr><td><strong>Healthcheck Namespace</strong></td><td>Optional</td><td>If enabled for your organization, the namespace used for the resource healthcheck; defaults to <code>default</code> if empty; supplied credentials must have the rights to perform one of the following kubectl commands in the specified namespace: <code>get pods</code>, <code>get deployments</code>, or <code>describe namespace</code></td></tr><tr><td><strong>API Token</strong></td><td>Required</td><td>Permanent token associated with the ServiceAccount on the Kubernetes cluster</td></tr><tr><td><strong>Authentication</strong></td><td>Required</td><td>Authentication method to access the cluster; select either <strong>Leased Credential</strong> (default) or <strong>Identity Aliases</strong> (to use the Identity Aliases of StrongDM users to access the cluster)</td></tr><tr><td><strong>Identity Set</strong></td><td>Required</td><td>Displays if <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>; select an Identity Set name from the list</td></tr><tr><td><strong>Healthcheck Username</strong></td><td>Required</td><td>If <strong>Authentication</strong> is set to <strong>Identity Aliases</strong>, the username that should be used to verify StrongDM's connection to it; username must already exist on the target cluster</td></tr><tr><td><strong>Resource Tags</strong></td><td>Optional</td><td>Resource <a data-mention href="/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO">/spaces/4XOJmXFslCMVCzIG2rKp/pages/anUqbOAAmDPD3e0fF6GO</a> consisting of key-value pairs <code>&#x3C;KEY>=&#x3C;VALUE></code> (for example, <code>env=dev</code>)</td></tr></tbody></table>

### **Display name**

Some Kubernetes management interfaces, such as Visual Studio Code, do not properly render cluster names containing spaces. If you run into problems, please choose a **Display Name** without spaces.

### **Secret Store**

By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

## Test the Connection

1. After creating the Kubernetes (Service Account) cluster resource in the Admin UI, navigate to **Infrastructure > Clusters** and locate your newly added cluster. The health indicator should turn green once connectivity and token authentication are validated.
2. On a test client using the StrongDM Desktop App or CLI, connect to the cluster and run a basic command such as:\\

   ```bash
   kubectl get pods --namespace default
   ```
3. Confirm the command returns resources and the connection is routed through StrongDM.
4. If discovery is enabled, in the Admin UI verify that namespaces, roles, and service accounts appear under the cluster’s **Discovery** tab. This indicates StrongDM successfully queried the Kubernetes API.
5. If the health status remains red or yellow:
   * Verify the cluster’s hostname and port are correct and that the API endpoint is reachable from your relay or gateway.
   * Check that the service account token is valid and has sufficient permissions to access the API.
   * Confirm the `healthcheck_namespace` exists and the user specified in `identity_alias_healthcheck_username` has the appropriate access.
   * Review the **Diagnostics** tab for authentication or network error logs.

Once connectivity is verified and you can successfully run Kubernetes commands, the cluster resource is ready. You can then assign roles, apply policies, and monitor access through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Datasources

A datasource is a combination of a specific database and the credentials to access it.

When a role is assigned a datasource, that entity inherits the permissions associated with the credential in that datasource.

In cases where multiple credentials are desirable for a given host address, the datasource can be cloned, with an alternate credential provided. This can allow different StrongDM users to connect to the same resource, but with different sets of credentials that allow them differing levels of access.

**Example:** Alice wishes to grant read-only access to a Microsoft SQL Server instance previously set up in StrongDM with read-write access. Alice creates a new database user, `sdm-ro`, on the SQL Server instance. She then clones the existing datasource entry, and replaces the read-write credentials with the `sdm-ro` username and password.

This article provides general information about how to add any type of datasource in the Admin UI. Please also see the specific resource page for configuration properties and information unique to the resource type you are adding.

## Prerequisites

It is a relatively simple process to add a datasource if you have met all of the relevant prerequisites.

You must have a properly configured account (that is, have a username and password) on the datasource you intend to add. If you choose to store credentials for the datasource with StrongDM, you must have those credentials handy. If not, you must have a Secret Store integration set up and be able to enter the location of the secrets required to access the datasource.

The hostname or endpoint you enter for your datasource must be accessible by at least one [gateway or relay](/admin/networking/gateways-and-relays). To verify this, log in to the Gateway or Relay, and use Netcat: `nc -zv <YOUR_HOSTNAME> <YOUR_PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your Gateway server can connect to this hostname, proceed.

{% hint style="info" %}
Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

## How to Add a Datasource

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select the **Resource Type** and set other [configuration properties](#basic-datasource-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.

### Basic datasource properties

Basic datasource properties are the properties common to most datasource types. This table provides information about such properties.

| Property              | Description | Requirement                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Type**     | Required    | Select the type of datasource from the list of available types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Restrict Database** | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Port**              | Required    | Port to use when connecting to your database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.


# Aerospike

Learn how to add an Aerospike database as a resource in StrongDM. When done, you will be able to use the StrongDM Desktop application or StrongDM CLI to connect to Aerospike.

## Overview

This guide outlines the configuration steps for adding an Aerospike database as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Aerospike clients and drivers that use the Aerospike wire protocol.

To add the resource to StrongDM, you will need the database hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secrets manager and reference them from within StrongDM. The resource's server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect to Aerospike.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Authentication

The Aerospike datasource type supports both no-authentication (that is, where the Username and Password fields are left blank) and password-based authentication.

TLS standard and mutual (mTLS/PKI) authentication and external authentication (LDAP) are not supported.

## Supported Versions and Clients

StrongDM supports Aerospike Server Enterprise and Standard Edition versions 5.5 through 8.0, but 6.4 or later is recommended. The Community Edition is also supported but not recommended.

StrongDM is generally compatible with all Aerospike clients and drivers. To ensure successful connections to Aerospike via StrongDM, we recommend the following best practices:

* Use recent, actively maintained versions of your Aerospike client.
* Avoid custom or unsupported authentication mechanisms unless StrongDM explicitly supports them.
* Test client connections in a non-production environment first, especially if using GUI tools or custom drivers.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the Aerospike host and port (the default port is `3000`)
* Valid Aerospike credentials (username and password, or appropriate authentication key)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM
* Connection tools such as the Aerospike Client or `aql` to test the connection to the resource independently of StrongDM, if needed

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Aerospike side, you must have the following:

* An Aerospike user with appropriate privileges (read-only or admin depending on your use case)
* Authentication information, including the host, port, and credentials
* TLS/SSL set up to enable encryption, if required by your organization
* Cloud-specific adjustments, if necessary, such as firewall rules and VPC configuration to allow StrongDM access
* Ability to test reachability from the StrongDM node using tools such as `aql`, `asadm`, or Netcat, and confirm DNS resolution

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Aerospike as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Aerospike**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add an Aerospike datasource
sdm admin datasources add aerospike aerospike-prod
  --hostname="aerospike-01.example.org"
  --port="3000"
  --username="sdm_user"
  --password="secret"
  --bind-interface="127.0.0.1"
  --egress-filter="tag:region=us-east-1"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="aerospike-prod"
  --tags="region=west,env=production"
  --timeout="30s"
  --use-services-alternate
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Aerospike resource
resource "sdm_aerospike" "aerospike_prod" {
  name                   = "aerospike-prod"
  hostname               = "aerospike-01.example.org"
  port                   = 3000
  username               = "sdm_user"
  password               = "secret"
  bind_interface         = "127.0.0.1"
  egress_filter          = "tag:region=us-east-1"
  port_override          = 12345
  proxy_cluster_id       = "n-1a2b345c67890123"
  secret_store_id        = "se-e1b2"
  subdomain              = "aerospike-prod"
  use_services_alternate = true
  tags = {
    region = "west"
    env    = "production"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Aerospike datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Display Name**                      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Resource Type**                     | Required    | **Aerospike**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**                     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Hostname**                          | Required    | Hostname for the resource; must be accessible to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Port**                              | Required    | Port to use when connecting to the resource; default port value is **3000**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Connectivity Mode**                 | Required    | Set either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                                                  |
| **IP Address**                        | Optional    | If **Virtual Networking Mode** is the connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's [Port Overrides ](/admin/resources/port-overrides)page after the resource is created; if **Loopback Mode** is the connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**                     | Optional    | If **Virtual Networking Mode** is the connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                                                            |
| **DNS**                               | Optional    | If **Virtual Networking Mode** is the connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                        |
| **Database**                          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Secret Store**                      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Username**                          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization and chosen as the value of **Secret Store**                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Password**                          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization and chosen as the value of **Secret Store**                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Username (path)**                   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Password (path)**                   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Use Aerospike Services Alternates** | Optional    | When set, enables connection to alternate service addresses and ports defined by Aerospike server configuration files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Resource Tags**                     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

{% hint style="info" %}
The **Use Aerospike Services Alternate** option is not enabled by default but may be required if the "alternate" external service addresses should be used to connect to the Aerospike server.
{% endhint %}

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session to the resource:

   ```bash
   sdm connect aerospike-prod
   ```

   This prepares your local environment to connect through StrongDM. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Test with an Aerospike client, such as `aql`, to confirm functionality. For example, list namespaces:

   ```bash
   aql
   aql> show namespaces
   ```

   You should see one or more namespaces returned if connectivity and auth are working.
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and commands were captured.

If you don’t see the resource in `sdm status`, or `aql` can’t list namespaces:

* Re-check your role assignment and resource properties in the StrongDM Admin UI.
* Ensure that the node (gateway/relay/proxy cluster) can reach the Aerospike host and port from its network.
* Verify your Aerospike credentials match what you configured in StrongDM.
* Re-run `sdm connect` and review CLI output; if needed, consult the CLI Reference for flags and limits.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Amazon Elasticsearch (IAM)

Learn how to add Amazon OpenSearch/Elasticsearch as a resource in StrongDM using IAM, and connect to it using the StrongDM Desktop application or StrongDM CLI.

## Overview

This guide outlines the configuration steps for adding Amazon OpenSearch/Elasticsearch as a resource in the StrongDM using IAM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging.

Amazon Elasticsearch and Amazon OpenSearch are both supported by StrongDM via this datasource type. We support the following combinations:

* Elasticsearch domain with Elasticsearch cluster
* OpenSearch domain with Elasticsearch cluster
* OpenSearch domain with OpenSearch cluster

To use access keys rather than IAM, see the [Amazon ES](/admin/resources/datasources/amazon-es) page.

To add the resource to StrongDM, you will need the database hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secrets manager and reference them from within StrongDM. The resource's server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect to Amazon OpenSearch/Elasticsearch.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Amazon Elasticsearch and OpenSearch clusters that are accessible via IAM-based authentication.

Clients should use standard Elasticsearch/OpenSearch protocols (such as REST over HTTPS). Some older AWS Elasticsearch implementation versions may not support IAM; confirm compatibility with your cluster.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the Elasticsearch/OpenSearch endpoint
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Elasticsearch or OpenSearch domain configured for IAM-based access
* Valid IAM role or instance profile attached to the StrongDM node, granting it access to the domain
* Required IAM permissions, such as `es:ESHttpGet`, `es:ESHttpPost`, or similar, as defined by AWS for accessing the domain
* Network accessibility: ensure security groups, VPC settings, and access policies allow StrongDM nodes to connect

## Resource Setup

Some setup is required to prepare an OpenSearch (IAM) resource to receive connections via StrongDM.

The AWS administrator needs to add an IAM policy to the EC2 role as in the example shown. Adjust the actions and the resource values based on your own configuration.

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "iam:GetRole",
            "Resource": "arn:aws:iam::111122223333:role/example-documentdb-iam"
        },
        {
            "Effect": "Allow",
            "Action": [
                "es:ListDomainNames",
                "es:DescribeDomain",
                "es:ESHttpGet",
                "es:ESHttpPost",
                "es:ESHttpPut",
                "es:ESHttpDelete"
            ],
            "Resource": "arn:aws:es:eu-central-1:111122223333:domain/example/*"
        }
    ]
}
```

Then, ensure that in the Amazon OpenSearch Access Policies, the EC2 role is allowed in an access policy, adjusting the example contents to match your own AWS configuration and values:

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:eu-central-1:111122223333:domain/example/*"
    },
  ]
}
```

For further help, consult the [OpenSearch IAM documentation](https://docs.aws.amazon.com/OpenSearch/latest/ug/security-iam-OpenSearch.html).

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Amazon Elasticsearch (IAM) as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Amazon ES (IAM)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Amazon Elasticsearch (IAM) datasource
sdm admin datasources add amazonesiam my-es-domain
  --endpoint="search-prod-domain.us-west-2.es.amazonaws.com"
  --region="us-west-2"
  --port="443"
  --bind-interface="127.0.0.1"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --egress-filter="tag:environment=prod"
  --secret-store-id="se-e1b2"
  --subdomain="es-prod"
  --tags="env=production,team=search"
  --no-tls-required
  --ca-cert="/path/to/ca.pem"
  --client-cert="/path/to/client.crt"
  --client-key="/path/to/client.key"
  --timeout="30s"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon ES (IAM) resource
resource "sdm_amazonesiam" "es_prod" {
  name             = "es-iam-prod"
  endpoint         = "search-prod-domain.us-west-2.es.amazonaws.com"
  region           = "us-west-2"
  port             = 443

  # Networking / node routing
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:environment=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id  = "se-e1b2"
  subdomain        = "es-prod"
  tags = {
    env    = "production"
    team   = "search"
    region = "west"
  }

  # TLS (recommended)
  tls_required = true
  # Optional certificate pinning / client auth (include only if needed)
  # ca_cert     = file("ca.crt")
  # client_cert = file("client.crt")
  # client_key  = file("client.key")
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Amazon Elasticsearch (IAM) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                    | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**            | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**           | Required    | **Amazon ES (IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Proxy Cluster**           | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**                | Required    | API server endpoint of the resource in the format `<ID>.<REGION>.es.amazonaws.com`, such as `A95FBC180B680B58A6468EF360D16E96.yl4.us-west-2.es.amazonaws.com`; StrongDM node should be able to [connect to your ES endpoint](#prerequisites)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode**       | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**              | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                     | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Region**                  | Required    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**            | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **TLS Required**            | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Assume Role ARN**         | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role External ID** | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**           | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store Options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource Status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Elasticsearch (IAM) resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect es-iam-prod
   ```

   This prepares your local environment to route traffic through StrongDM to the Elasticsearch/OpenSearch domain. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your preferred client (for example, `curl`, Postman, or an Elasticsearch/OpenSearch tool) to request cluster health. If you configured a **Subdomain** (for example, `es-prod`), you can use it directly; otherwise, use the endpoint you entered in the resource.

   ```bash
   # If using the StrongDM subdomain:
   curl -s https://es-prod.<ORGANIZATION>.sdm.network/_cluster/health | jq .

   # Example if using the AWS domain you configured:
   curl -s https://search-prod-domain.us-west-2.es.amazonaws.com/_cluster/health | jq .
   ```

   You should see one or more namespaces returned if connectivity and auth are working.
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and commands were captured.
6. If you set **TLS required** on the resource, confirm that the connection negotiates TLS successfully. Mismatched certificate authority or client certs or hostname issues will surface as handshake errors.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Amazon Elasticsearch

Learn how to add Amazon OpenSearch/Elasticsearch as a resource in StrongDM, and connect to it using the StrongDM Desktop application or StrongDM CLI.

### Overview

This guide outlines the configuration steps for adding Amazon OpenSearch/Elasticsearch as a resource in the StrongDM using access keys.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging.

Amazon Elasticsearch and Amazon OpenSearch are both supported by StrongDM via this datasource type. We support the following combinations:

* Elasticsearch domain with Elasticsearch cluster
* OpenSearch domain with Elasticsearch cluster
* OpenSearch domain with OpenSearch cluster

To use IAM rather than access keys, see the [Amazon ES (IAM)](/admin/resources/datasources/amazon-es-iam) page.

To add the resource to StrongDM, you will need the database hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secrets manager and reference them from within StrongDM. The resource's server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect to Amazon OpenSearch/Elasticsearch.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Amazon Elasticsearch and Amazon OpenSearch clusters that are accessible using AWS access keys (Access Key ID and Secret Access Key).

Clients should use standard Elasticsearch and OpenSearch protocols over HTTPS (for example, RESTful APIs via `curl`, Postman, or SDKs).

Note that some legacy Amazon Elasticsearch service versions may have authentication or networking constraints. Ensure your cluster supports access key–based authentication and HTTPS connections before adding it to StrongDM.

## Prerequisites

To add your Amazon Elasticsearch or OpenSearch resource in StrongDM using access keys, make sure the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the Elasticsearch/OpenSearch endpoint
* Valid set of AWS access key credentials (Access Key ID and Secret Access Key) that have permissions to the domain.
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Elasticsearch or OpenSearch domain that is configured to accept access key–based authentication
* AWS user account with an access key and secret key that has permissions to the domain. At minimum, permissions should include actions like `es:ESHttpGet` and `es:ESHttpPost`, as appropriate for your workloads.
* Network accessibility: ensure security groups, VPC settings, and access policies allow StrongDM nodes to connect

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Amazon Elasticsearch as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Amazon ES** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Amazon Elasticsearch datasource
sdm admin datasources add amazones my-es-access-keys
  --endpoint="search-prod-domain.us-west-2.es.amazonaws.com"
  --region="us-west-2"
  --port="443"
  --access-key="AKIAEXAMPLE"
  --secret-key="secretKeyExample123"
  --bind-interface="127.0.0.1"
  --egress-filter="tag:environment=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="es-prod"
  --tags="env=production,team=search"
  --tls-required
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon ES (Access Keys) resource
resource "sdm_amazones" "es_prod" {
  name       = "es-access-keys-prod"
  endpoint   = "search-prod-domain.us-west-2.es.amazonaws.com"
  region     = "us-west-2"
  port       = 443

  # Access keys
  access_key = "AKIAEXAMPLE"
  secret_key = "secretKeyExample123"

  # Networking / node routing
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:environment=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id  = "se-e1b2"
  subdomain        = "es-prod"
  tags = {
    env    = "production"
    team   = "search"
    region = "west"
  }

  # TLS (recommended)
  tls_required = true
  # Optional certificate pinning / client auth (include only if needed)
  # ca_cert     = file("ca.crt")
  # client_cert = file("client.crt")
  # client_key  = file("client.key")
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Amazon Elasticsearch datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                    | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**            | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**           | Required    | **Amazon ES**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**           | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**                | Required    | API server endpoint of the resource in the format `<ID>.<REGION>.es.amazonaws.com`, such as `A95FBC180B680B58A6468EF360D16E96.yl4.us-west-2.es.amazonaws.com`; StrongDM node should be able to [connect to your ES endpoint](#prerequisites)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode**       | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**              | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                     | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Region**                  | Required    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**            | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Access Key ID**           | Required    | Access key ID, such as `AKIAIOSFODNN7EXAMPLE`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Access Key**       | Required    | Secret access key, such as `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Assume Role ARN**         | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role External ID** | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**           | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

| Property                    | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**            | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**           | Required    | **Amazon ES**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**           | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**                | Required    | API server endpoint of the resource in the format `<ID>.<REGION>.es.amazonaws.com`, such as `A95FBC180B680B58A6468EF360D16E96.yl4.us-west-2.es.amazonaws.com`; StrongDM node should be able to [connect to your ES endpoint](#prerequisites)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode**       | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**              | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                     | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Region**                  | Required    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**            | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Access Key ID**           | Required    | Access key ID, such as `AKIAIOSFODNN7EXAMPLE`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Access Key**       | Required    | Secret access key, such as `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Assume Role ARN**         | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role External ID** | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**           | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store Options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource Status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Amazon Elasticsearch resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect es-access-keys-prod
   ```

   This prepares your environment to route traffic securely through StrongDM to the Elasticsearch/OpenSearch domain. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your preferred client (for example, `curl`, Postman, or an Elasticsearch/OpenSearch tool) to request cluster health. If you configured a **Subdomain** (for example, `es-prod`), you can use it directly; otherwise, use the endpoint you entered in the resource.

   ```bash
   # If using the StrongDM subdomain:
   curl -s https://es-prod.<ORGANIZATION>.sdm.network/_cluster/health | jq .

   # Example if using the AWS domain you configured:
   curl -s https://search-prod-domain.us-west-2.es.amazonaws.com/_cluster/health | jq .
   ```

   You should receive a JSON response showing cluster status. This confirms both connectivity and authentication using your access keys.
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and API requests were captured.
6. If you set **TLS required** on the resource, confirm that the connection negotiates TLS successfully. Mismatched certificate authority or client certs or hostname issues will surface as handshake errors.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Amazon MQ AMQP

Learn how to add Amazon MQ as a resource in StrongDM, and connect to it using the StrongDM Desktop application or StrongDM CLI.

## Overview

This guide outlines the configuration steps for adding an Amazon MQ broker (AMQP protocol) as a resource in the StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard AMQP clients and libraries that connect to Amazon MQ brokers over the AMQP 1.0 or AMQP 0-9-1 protocol.

To add the resource to StrongDM, you will need the database hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secrets manager and reference them from within StrongDM. The resource's server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

TLS is supported and can be enabled during setup. For cloud-hosted brokers, ensure security groups or firewall rules permit inbound connections from your StrongDM nodes.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When setup is complete, you will be able to use StrongDM to connect your AMQP clients securely to Amazon MQ.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

### Supported Versions and Clients <a href="#supported-versions-and-clients" id="supported-versions-and-clients"></a>

StrongDM supports Amazon MQ brokers using the AMQP protocol, including Apache ActiveMQ and RabbitMQ engines.

StrongDM is generally compatible with all AMQP clients, such as:

* The `amqp` Python library
* RabbitMQ clients (`pika`, `amqplib`)
* Java AMQP clients
* GUI tools such as RabbitMQ Management or AMQP console apps

{% hint style="info" %}
StrongDM does not alter the AMQP wire protocol. Any client that supports Amazon MQ’s AMQP endpoint can be proxied through StrongDM.
{% endhint %}

## Prerequisites

Before adding Amazon MQ (AMQP) as a datasource in StrongDM, ensure the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the broker’s host and port (default AMQP ports: `5671` for TLS, `5672` for non-TLS)
* Valid set of Amazon MQ credentials (username and password)
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Amazon MQ broker configured with the AMQP protocol enabled
* AWS user account created in Amazon MQ with permissions to connect over AMQP
* Security groups or firewall rules that allow inbound traffic from your StrongDM nodes to the broker

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Amazon MQ as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Amazon MQ (AMQP)** as the **Resource Type** and set other [configuration properties](#resource-properties) for your new resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Amazon MQ datasource
sdm admin datasources add amazonmqamqp my-mq-broker
  --hostname="b-12345678-1234.mq.us-west-2.amazonaws.com"
  --port=5671
  --username="mq_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="mq-prod"
  --tags="env=production,team=messaging"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon MQ resource
resource "sdm_amazonmqamqp" "mq_prod" {
  name            = "mq-prod"
  hostname        = "b-12345678-1234.mq.us-west-2.amazonaws.com"
  port            = 5671
  username        = "mq_user"
  password        = "secret"

  tls_required    = true
  bind_interface  = "127.0.0.1"
  egress_filter   = "tag:env=prod"
  port_override   = 12345
  proxy_cluster_id = "n-1a2b345c67890123"
  secret_store_id  = "se-e1b2"
  subdomain        = "mq-prod"
  tags = {
    env  = "production"
    team = "messaging"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Amazon MQ (AMQP) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Amazon MQ (AMQP)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Proxy Cluster**     | Required    | Defaults to “None (use gateways)”; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**              | Optional    | Port to connect to the service; use port 5671 for TLS; use port 5672 for non-TLS; default port value is **5671**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) is enabled for your organization                                                                                                                                                                                                                                                                                                                                 |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource’s human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**     | Optional    | Datasource [tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and ensure that your user or role is assigned to the Amazon MQ AMQP resource.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Amazon MQ AMQP resource appears in your list of accessible datasources.
3. Connect through StrongDM, as in the following example:

   ```bash
   sdm connect mq-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your AMQP client or tooling (for example, `amqp-tools`, RabbitMQ client libraries, or ActiveMQ console) to connect and send a basic message. For example, using Python with `pika`:

   ```python
   import pika
   connection = pika.BlockingConnection(pika.ConnectionParameters(
       host="mq-prod.<ORG>.sdm.network",
       port=5671,
       ssl=True,
       credentials=pika.PlainCredentials("mq_user", "secret")
   ))
   channel = connection.channel()
   channel.queue_declare(queue="test")
   channel.basic_publish(exchange="", routing_key="test", body="hello world")
   print(" [x] Sent 'hello world'")
   connection.close()

   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm your session is recorded.
6. If you set **TLS required** on the resource, confirm that the connection negotiates TLS successfully.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Amazon MQ (AMQP 0.9.1)

## Overview

This guide describes how to add an Amazon MQ broker using the AMQP 0.9.1 protocol as a datasource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard AMQP 0.9.1 clients and libraries that connect to Amazon MQ brokers.

{% hint style="info" %}
If you wish to connect over the AMQP 1.0 instead, please see the [Amazon MQ AMQP](/admin/resources/datasources/amazon-mq-amqp) section of the documentation.
{% endhint %}

To add this datasource, you will need the broker’s hostname, port, and a valid username and password. Optionally, you can store credentials in a supported secrets manager and reference them from StrongDM.

TLS is supported and can be enabled during setup. For cloud-hosted brokers, ensure that security groups or firewall rules permit inbound connections from StrongDM nodes.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once setup is complete, you can connect your AMQP 0.9.1 clients to Amazon MQ through StrongDM.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

### Supported Versions and Clients <a href="#supported-versions-and-clients" id="supported-versions-and-clients"></a>

StrongDM supports Amazon MQ brokers using the AMQP protocol, including Apache ActiveMQ and RabbitMQ engines.

StrongDM is generally compatible with all AMQP clients, such as:

* The `amqp` Python library
* RabbitMQ clients (`pika`, `amqplib`)
* Java AMQP clients
* GUI tools such as RabbitMQ Management or AMQP console apps

{% hint style="info" %}
StrongDM does not alter the AMQP wire protocol. Any client that supports Amazon MQ’s AMQP endpoint can be proxied through StrongDM.
{% endhint %}

## Prerequisites

Before adding Amazon MQ (AMQP) as a datasource in StrongDM, ensure the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the broker’s host and port (default AMQP ports: `5671` for TLS, `5672` for non-TLS)
* Valid set of Amazon MQ credentials (username and password)
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Amazon MQ broker configured with the AMQP protocol enabled
* AWS user account created in Amazon MQ with permissions to connect over AMQP
* Security groups or firewall rules that allow inbound traffic from your StrongDM nodes to the broker

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Amazon MQ as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Amazon MQ (AMQP 0.9.1)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Amazon MQ (AMQP 0.9.1) datasource
sdm admin datasources add amazonmqamqp091 my-mq-rabbit
  --hostname="b-12345678-1234.mq.us-west-2.amazonaws.com"
  --port=5671
  --username="mq_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="mq-rabbit-prod"
  --tags="env=production,team=messaging"

# Clone Amazon MQ (AMQP 0.9.1) datasource
# Specify the ID of the resource to clone and give it a new name
sdm admin datasources clone rs-12a3456789b012cd --name "mq-rabbit-clone"

# Update Amazon MQ (AMQP 0.9.1) datasource
# Specify the ID of the resource to update and change some options
sdm admin datasources update rs-12a3456789b012cd \
  --port 1234 \
  --tags "env=staging,team=search"

# Delete Amazon MQ datasource
# Specify the ID of the resource to delete
sdm admin datasources delete rs-12a3456789b012cd
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon MQ AMQP 0.9.1 resource
resource "sdm_amazonmqamqp091" "mq_prod" {
  name             = "mq-rabbit-prod"
  hostname         = "b-12345678-1234.mq.us-west-2.amazonaws.com"
  port             = 5671
  username         = "mq_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"
  secret_store_id  = "se-e1b2"
  subdomain        = "mq-rabbit-prod"
  tags = {
    env  = "production"
    team = "messaging"
  }
}

# Clone Amazon MQ AMQP 0.9.1 resource
resource "sdm_amazonmqamqp091" "mq_clone" {
  name             = "mq-rabbit-clone"
  hostname         = sdm_amazonmqamqp091.mq_prod.hostname
  port             = sdm_amazonmqamqp091.mq_prod.port
  username         = sdm_amazonmqamqp091.mq_prod.username
  password         = sdm_amazonmqamqp091.mq_prod.password

  tls_required     = sdm_amazonmqamqp091.mq_prod.tls_required
  bind_interface   = sdm_amazonmqamqp091.mq_prod.bind_interface
  egress_filter    = sdm_amazonmqamqp091.mq_prod.egress_filter
  port_override    = sdm_amazonmqamqp091.mq_prod.port_override
  proxy_cluster_id = sdm_amazonmqamqp091.mq_prod.proxy_cluster_id
  secret_store_id  = sdm_amazonmqamqp091.mq_prod.secret_store_id
  subdomain        = "mq-rabbit-clone" # give the clone a distinct subdomain
  tags             = sdm_amazonmqamqp091.mq_prod.tags
}

# Update Amazon MQ AMQP 0.9.1 resource
# Updates in Terraform are applied by changing arguments in the same resource
# and re-running `terraform apply`. For illustration, here we change port,
# egress_filter, and tags.

resource "sdm_amazonmqamqp091" "mq_prod_updated" {
  name             = "mq-rabbit-prod"
  hostname         = "b-12345678-1234.mq.us-west-2.amazonaws.com"
  port             = 5672                   # updated port (non-TLS)
  username         = "mq_user"
  password         = "secret"

  tls_required     = false                  # updated to disable TLS
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=staging"      # updated egress filter
  port_override    = 15432                  # updated override
  proxy_cluster_id = "n-1a2b345c67890123"
  secret_store_id  = "se-e1b2"
  subdomain        = "mq-rabbit-prod"
  tags = {
    env  = "staging"                        # updated tag
    team = "messaging"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Amazon Elasticsearch datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Amazon MQ (AMQP 0.9.1)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**              | Required    | Port to connect to the service; use port 5671 for TLS; use port 5672 for non-TLS; default port value is **5671**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and ensure that your user or role is assigned to the Amazon MQ AMQP 0.9.1 resource.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Amazon MQ AMQP 0.9.1 resource appears in your list of accessible datasources.
3. Connect through StrongDM, as in the following example:

   ```bash
   sdm connect mq-rabbit-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your AMQP 0.9.1 client to connect and send a basic message. For example, using Python with `pika`:

   ```python
   import pika
   connection = pika.BlockingConnection(pika.ConnectionParameters(
       host="mq-rabbit-prod.<ORG>.sdm.network",
       port=5671,
       ssl=True,
       credentials=pika.PlainCredentials("mq_user", "secret")
   ))
   channel = connection.channel()
   channel.queue_declare(queue="test")
   channel.basic_publish(exchange="", routing_key="test", body="hello world")
   print("Sent message")
   connection.close()
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm your session and commands are recorded.
6. If you set **TLS required** on the resource, confirm that the connection negotiates TLS successfully.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Amazon Neptune

Learn how to add Amazon Neptune as a resource in StrongDM using either access and secret keys or IAM.

## Overview

This guide describes how to add an **Amazon Neptune** graph database as a datasource in StrongDM using either access keys or AWS IAM for authentication.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Neptune client connections over HTTPS using the Gremlin or SPARQL protocols.

To add this datasource, you will need the Neptune cluster endpoint, port, and authentication details (if required). Optionally, you can store credentials in a supported secrets manager and reference them in StrongDM.

TLS is supported and recommended for secure connections. Ensure that your StrongDM nodes can reach the Neptune cluster endpoint on the appropriate port.

{% hint style="info" %}
By default, Neptune access is unauthenticated, with the assumption that anything inside the VPC that can connect to the cluster can connect to the Neptune API. However, Amazon also offers an IAM-based configuration. Both configurations are fully supported by StrongDM, and you can choose which type when selecting a datasource type. Both configurations are detailed in the sections that follow.
{% endhint %}

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once configured, you can use StrongDM to connect client applications to Amazon Neptune through your chosen interface.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

### Supported Versions and Clients <a href="#supported-versions-and-clients" id="supported-versions-and-clients"></a>

StrongDM supports **Amazon Neptune clusters** running supported Neptune engine versions, including connections via **Gremlin** and **SPARQL**.

Clients include, but are not limited to:

* Gremlin Console
* Apache TinkerPop-compatible clients
* SPARQL 1.1 query tools and libraries

{% hint style="info" %}
StrongDM does not modify the Neptune wire protocols. Any client compatible with Neptune’s Gremlin or SPARQL endpoints can connect through StrongDM.
{% endhint %}

## Prerequisites

Before adding Amazon Neptune as a datasource in StrongDM, ensure the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the Neptune cluster endpoint (default port: `8182`)
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Amazon Neptune cluster deployed and available
* Appropriate VPC and security group settings that allow inbound traffic from StrongDM nodes to the cluster
* Any required database users or authentication mechanisms configured in Neptune

## Resource Setup

Some setup steps are required to prepare a Neptune (IAM) resource to receive connections via StrongDM.

1. The AWS administrator should enable IAM authentication for the target Neptune resource in the AWS Management Console. This can be done at creation, or be modified at a later time. This is done by locating the **Database authentication** setting and choosing the option **Password and IAM database authentication**.
2. A Neptune administrator needs to log in to the database and create a user for use with StrongDM.
3. Finally, the AWS administrator needs to add an IAM policy to the IAM role that is attached to the gateway or relay to allow access, as in the example shown.

```json
{
   "Version": "2012-10-17",
   "Statement": [
      {
         "Effect": "Allow",
         "Action": [
             "rds-db:connect"
         ],
         "Resource": [
             "arn:aws:rds-db:us-east-2:1234567890:dbuser:cluster-ABCDEFGHIJKL01234/db_userx"
         ]
      }
   ]
}
```

For further help, consult the [AWS Neptune IAM documentation](https://docs.aws.amazon.com/neptune/latest/userguide/iam-auth-enable.html).

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Neptune as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Neptune** or **Neptune (IAM)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Amazon Neptune datasource
sdm admin datasources add amazonneptune my-neptune-cluster
  --hostname="my-neptune-cluster.cluster-abcdefghijkl.us-east-1.neptune.amazonaws.com"
  --port=8182
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="neptune-prod"
  --tags="env=production,team=graphdb"

# Add Amazon Neptune (IAM) datasource
sdm admin datasources add neptuneiam my-neptune-iam-cluster
  --endpoint="my-neptune-cluster.cluster-abcdefghijkl.us-east-1.neptune.amazonaws.com"
  --region="us-east-1"
  --port=8182
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="neptune-iam-prod"
  --tags="env=production,team=graphdb"
  --role-arn="arn:aws:iam::123456789012:role/NeptuneAccessRole"
  --role-external-id="external-id-optional"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Amazon Neptune resource
resource "sdm_amazonneptune" "neptune_prod" {
  name             = "neptune-prod"
  hostname         = "my-neptune-cluster.cluster-abcdefghijkl.us-east-1.neptune.amazonaws.com"
  port             = 8182

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"
  secret_store_id  = "se-e1b2"
  subdomain        = "neptune-prod"
  tags = {
    env  = "production"
    team = "graphdb"
  }
}

# Create Amazon Neptune (IAM) resource
resource "sdm_neptuneiam" "neptune_iam_prod" {
  name     = "neptune-iam-prod"
  endpoint = "my-neptune-cluster.cluster-abcdefghijkl.us-east-1.neptune.amazonaws.com"
  region   = "us-east-1"
  port     = 8182

  # IAM options (choose one approach)
  # 1. Use an assumed IAM role
  role_arn         = "arn:aws:iam::123456789012:role/NeptuneAccessRole"
  role_external_id = "external-id-optional"

  # 2. Or supply static AWS credentials (optional alternative, not recommended for production)
  # access_key        = "AKIAEXAMPLE"
  # secret_access_key = "secretKeyExample123"

  # Networking / routing
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "neptune-iam-prod"
  tags = {
    env  = "production"
    team = "graphdb"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Amazon Neptune or Amazon Neptune (IAM) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

{% tabs %}
{% tab title="Amazon Neptune" %}
**Amazon Neptune Properties**

If you use the Neptune datasource type, you will have the following fields.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Neptune**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**          | Required    | Endpoint (for example, `<ENDPOINT>.<REGION>.neptune.amazonaws.com`); [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Optional    | Port to connect to the service; default port value is **8182**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                              |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's Port Overrides page after the resource is created; if **Loopback Mode** is the selected connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                  |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Amazon Neptune (IAM)" %}
**Amazon Neptune (IAM) Properties**

If you use the Neptune (IAM) datasource type, you will have the following fields.

| Property                           | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                   | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                  | Required    | **Neptune (IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Proxy Cluster**                  | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**                       | Required    | Endpoint (for example, `<ENDPOINT>.<REGION>.neptune.amazonaws.com`); [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**                           | Optional    | Port to connect to the service; default port value is **8182**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Connectivity Mode**              | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                  | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                            | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Region**                         | Required    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**                   | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about \[Secret Store#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Access Key ID**                  | Optional    | Access key ID, such as `AKIAIOSFODNN7EXAMPLE`, from your AWS key pair; if the IAM role on the node is used for authentication, do not set the access key ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Secret Access Key**              | Optional    | Secret access key, such as `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`, from your AWS key pair; ; if the IAM role on the node is used for authentication, do not set the secret access key                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **AWS S3 Output Location**         | Required    | Amazon S3 output location (for example, `s3://aws-athena-query-results-123456789012-us-east-1/MyInsertQuery/2021/10/04/abc1234d-5efg-67hi-jklm-89n0op12qr34`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Assume Role ARN**                | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role ARN (path)**         | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is not StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Assume Role External ID**        | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Assume Role External ID (path)** | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is *not* StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**                  | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}                       |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtabs %}                      |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the health checks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and ensure that your user or role is assigned to the Neptune resource.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Neptune resource appears in your list of accessible datasources.
3. Connect through StrongDM, as in the following example:

   ```bash
   sdm connect neptune-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use Gremlin Console or another supported client to send a simple query. For example:

   ```bash
   gremlin> :remote connect tinkerpop.server conf/remote.yaml
   gremlin> g.V().limit(1)

   connection.close()
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm your session and requests are logged.
6. If you set **TLS required** on the resource, confirm that the connection negotiates TLS successfully.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Athena (IAM)

Learn how to add an Athena database as a datasource in StrongDM using IAM.

## Overview

This guide explains how to add an Amazon Athena datasource in StrongDM using AWS IAM for authentication.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging.

Use this guide to complete IAM setup on your node, fill in the required properties (including the S3 query results location), and test connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Athena when access is authenticated via AWS IAM. StrongDM also supports authentication with AWS access keys (for more detail, see the [Athena](/admin/resources/datasources/athena) guide).

Standard Athena clients (for example, JDBC/ODBC tools, AWS SDK/CLI–backed clients, or BI tools that speak the Athena API) work when configured to reach Athena through StrongDM. Ensure that your client can operate with an S3 query results bucket, as required by Athena.

When using JDBC clients to access Athena, StrongDM supports versions 2.0.5, 2.0.6, and 3.0.0 to 3.6.0. For JDBC v3, a StrongDM certificate is required (see the [User Connection](#user-connection-with-jdbc-v3) section).

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach Athena’s endpoint
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* IAM role (or equivalent) attached to the EC2 instance(s) where your StrongDM node runs, granting the minimum Athena, S3, and Glue permissions needed to run queries and list metadata (example policy shown in the docs). Typical actions include:

  * Athena: `athena:GetQueryExecution`, `athena:StartQueryExecution`, `athena:GetDatabase`, `athena:GetTables`
  * S3: `s3:PutObject`, `s3:GetObject`, `s3:ListBucket`, `s3:GetBucketLocation`, etc.
  * Glue: `glue:GetTable`, `glue:GetSchemaVersion`, `glue:ListSchemaVersions`

  Attach this role to the node EC2 instance(s).

### Resource Setup

Some setup is required to prepare an Athena (IAM) resource to receive connections via StrongDM. Specifically, you will need to create an IAM role similar to the example below and attach that role to the EC2 instance you are using for your node (gateway or relay).

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:ListBucket",
        "s3:CreateBucket",
        "s3:GetBucketLocation",
        "s3:ListBucketMultipartUploads",
        "s3:ListMultipartUploadParts",
        "s3:AbortMultipartUpload"
      ],
      "Resource": [
        "*"
      ]
    },
    {
      "Sid": "VisualEditor1",
      "Effect": "Allow",
      "Action": [
        "athena:GetQueryExecution",
        "athena:GetTables",
        "athena:GetDatabase",
        "athena:ListNamedQueries",
        "athena:StartQueryExecution"
      ],
      "Resource": "*"
    },
    {
      "Sid": "VisualEditor2",
      "Effect": "Allow",
      "Action": [
        "glue:GetSchemaVersion",
        "glue:ListSchemaVersions",
        "glue:GetTable"
      ],
      "Resource": "*"
    }
  ]
}
```

For further help, consult the [Athena IAM documentation](https://docs.aws.amazon.com/athena/latest/ug/security-iam-athena.html).

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Athena (IAM) database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Athena (IAM)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Athena (IAM) datasource
sdm admin datasources add athenaiam athena-iam-prod
  --region="us-east-1"
  --s3-output="s3://aws-athena-query-results-123456789012-us-east-1/strongdm/"
  --workgroup="primary"
  --port=443
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="athena-prod"
  --tags="env=production,team=bi"
  --role-arn="arn:aws:iam::123456789012:role/StrongDM-Athena-Role"
  --role-external-id="optional-external-id"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Athena (IAM) resource
resource "sdm_athenaiam" "athena_prod" {
  name                = "athena-iam-prod"
  region              = "us-east-1"
  s3_output_location  = "s3://aws-athena-query-results-123456789012-us-east-1/strongdm/"
  workgroup           = "primary"   # optional
  port                = 443

  # IAM options (choose one approach)
  role_arn         = "arn:aws:iam::123456789012:role/StrongDM-Athena-Role"
  role_external_id = "optional-external-id"
  # OR static AWS creds (alternative, not recommended for prod)
  # access_key_id     = "AKIAEXAMPLE"
  # secret_access_key = "secretKeyExample123"

  # Networking / routing
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "athena-prod"
  tags = {
    env  = "production"
    team = "bi"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Athena (IAM) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                           | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                   | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                  | Required    | **Athena (IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Proxy Cluster**                  | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **AWS Region**                     | Optional    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Connectivity Mode**              | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                  | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                            | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**                   | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **AWS S3 Output Location**         | Required    | Enter the Amazon S3 output location (for example, `s3://aws-athena-query-results-123456789012-us-east-1/MyInsertQuery/2024/10/04/abc1234d-5efg-67hi-jklm-89n0op12qr34`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Assume Role ARN**                | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role ARN (path)**         | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is not StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Assume Role External ID**        | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Assume Role External ID (path)** | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is *not* StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**                  | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## User Connection With JDBC v3

For users with JDBC drivers versions 3.0.0 to 3.6.0, users must install the StrongDM DNS CA certificate in order to successfully connect. StrongDM admins can manage this certificate in the Admin UI at **Settings** > **Secrets Management** > **Certificate Authorities** > **StrongDM DNS Certificate Authority**. They can create, rotate, and delete the certificate there, and can also download it to distribute to end users who plan to use JDBC v3 drivers.

Users can install the certificate using the following command, replacing the cert file name:

```bash
keytool -import -cacerts -file dns.cer -alias sdmdns
```

Additionally, users must set values for the following parameters upon connection:

* `ProxyHost`: StrongDM hostname for the resource, which must begin with `http://`; can be found in the desktop app or with `sdm status` at the CLI
* `ProxyPort`: StrongDM assigned port for the resource; can be found in the desktop app or with `sdm status` at the CLI
* `Region`: Must be `us-east-1` regardless of the actual region of the datasource

Example connection string:

```bash
jdbc:athena://ProxyHost=http://127.0.0.1;ProxyPort=<PORT>;Region=us-east-1;UID=ANY_VALUE;PWD=ANY_VALUE;OutputLocation=s3://ANY_VALUE;ConnectionTest=FALSE
```

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Athena (IAM) resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect <RESOURCE_NAME>
   ```

   This routes your client through StrongDM to Athena. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your JDBC/ODBC tool or an AWS-backed client to execute a trivial query against a known database/table. Verify results are written to your configured S3 output location.

   ```bash
   # If using the StrongDM subdomain:
   curl -s https://es-prod.<ORGANIZATION>.sdm.network/_cluster/health | jq .

   # Example if using the AWS domain you configured:
   curl -s https://search-prod-domain.us-west-2.es.amazonaws.com/_cluster/health | jq .
   ```

   You should see one or more namespaces returned if connectivity and auth are working.
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and statements were recorded.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Athena

Learn how to add an Athena database as a datasource in StrongDM.

## Overview

This guide explains how to add Amazon Athena as a datasource in StrongDM using AWS access keys for authentication. To use IAM role authentication instead, see the [Athena (IAM)](/admin/resources/datasources/athena-iam) guide.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. You can connect your preferred Athena clients (such as JDBC/ODBC tools or BI applications) through StrongDM to run queries.

Athena requires an S3 query results location for all queries. When configuring the resource in StrongDM, you must supply an S3 bucket path where results will be stored.

Use this guide to prepare your AWS and StrongDM environments, configure the resource with the necessary properties, and test the connection.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports authentication with Athena using AWS access keys for authentication. IAM roles for authentication are also supported (see the [Athena (IAM)](/admin/resources/datasources/athena-iam) guide).

Standard Athena clients (for example, JDBC/ODBC tools, AWS SDK/CLI–backed clients, or BI tools that speak the Athena API) work when configured to reach Athena through StrongDM. Ensure that your client can operate with an S3 query results bucket, as required by Athena.

When using JDBC clients to access Athena, StrongDM supports versions 2.0.5, 2.0.6, and 3.0.0 to 3.6.0. For JDBC v3, a StrongDM certificate is required (see the [User Connection](#user-connection-with-jdbc-v3) section).

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to Athena endpoints.
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* AWS user account with Access Key ID and Secret Access Key credentials.
* The user must have IAM policies that grant Athena access and S3 permissions for the output location. Required actions typically include:
  * Athena: `athena:GetQueryExecution`, `athena:StartQueryExecution`
  * S3: `s3:PutObject`, `s3:GetObject`, `s3:ListBucket`, `s3:GetBucketLocation`
  * (Optional) Glue: for metadata access (`glue:GetDatabase`, `glue:GetTable`)
* S3 bucket configured as the query results location

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Athena database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Athena** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Athena datasource
sdm admin datasources add athena athena-access-keys-prod
  --region="us-east-1"
  --s3-output="s3://aws-athena-query-results-123456789012-us-east-1/strongdm/"
  --workgroup="primary"
  --access-key-id="AKIAEXAMPLE"
  --secret-access-key="secretKeyExample123"
  --port=443
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="athena-prod"
  --tags="env=production,team=bi"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Athena (Access Keys) resource
resource "sdm_athena" "athena_prod" {
  name                = "athena-access-keys-prod"
  region              = "us-east-1"
  s3_output_location  = "s3://aws-athena-query-results-123456789012-us-east-1/strongdm/"
  workgroup           = "primary"

  access_key_id       = "AKIAEXAMPLE"
  secret_access_key   = "secretKeyExample123"

  # Networking / routing
  port                = 443
  bind_interface      = "127.0.0.1"
  egress_filter       = "tag:env=prod"
  port_override       = 12345
  proxy_cluster_id    = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id     = "se-e1b2"
  subdomain           = "athena-prod"
  tags = {
    env  = "production"
    team = "bi"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Athena datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                           | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                   | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                  | Required    | **Athena**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Proxy Cluster**                  | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **AWS Region**                     | Optional    | AWS region (for example, `us-east-1`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Connectivity Mode**              | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                  | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                            | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**                   | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **AWS Access Key ID**              | Required    | Access key ID, such as `AKIAIOSFODNN7EXAMPLE`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **AWS Secret Access Key**          | Required    | Secret access key, such as `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`, from your AWS key pair                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **AWS S3 Output Location**         | Required    | Amazon S3 output location (for example, `s3://aws-athena-query-results-123456789012-us-east-1/MyInsertQuery/2021/10/04/abc1234d-5efg-67hi-jklm-89n0op12qr34`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Assume Role ARN**                | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) functionality                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Assume Role ARN (path)**         | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is not StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Assume Role External ID**        | Optional    | External ID role to assume after login (for example `12345`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Assume Role External ID (path)** | Optional    | If Secret Store integration is configured for your organization *and* you selected a Secret Store type that is *not* StrongDM, the path to the secret in your Secret Store (for example, `path/to/credential?key=optionalKeyName`); the key argument is optional                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**                  | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## User Connection With JDBC v3

For users with JDBC drivers versions 3.0.0 to 3.6.0, users must install the StrongDM DNS CA certificate in order to successfully connect. StrongDM admins can manage this certificate in the Admin UI at **Settings** > **Secrets Management** > **Certificate Authorities** > **StrongDM DNS Certificate Authority**. They can create, rotate, and delete the certificate there, and can also download it to distribute to end users who plan to use JDBC v3 drivers.

Users can install the certificate using the following command, replacing the cert file name:

```bash
keytool -import -cacerts -file dns.cer -alias sdmdns
```

Additionally, users must set values for the following parameters upon connection:

* `ProxyHost`: StrongDM hostname for the resource, which must begin with `http://`; can be found in the desktop app or with `sdm status` at the CLI
* `ProxyPort`: StrongDM assigned port for the resource; can be found in the desktop app or with `sdm status` at the CLI
* `Region`: Must be `us-east-1` regardless of the actual region of the datasource

Example connection string:

```bash
jdbc:athena://ProxyHost=http://127.0.0.1;ProxyPort=<PORT>;Region=us-east-1;UID=ANY_VALUE;PWD=ANY_VALUE;OutputLocation=s3://ANY_VALUE;ConnectionTest=FALSE
```

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Athena resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect athena-access-keys-prod
   ```

   This routes your client through StrongDM to Athena. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use your Athena client (JDBC/ODBC, BI tool, or AWS CLI) to issue a basic query. Verify results are saved to your specified S3 output location.
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and statements were recorded.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

## Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Aurora MySQL (IAM)

Learn how to add an Aurora MySQL database as a datasource in StrongDM using IAM.

## Overview

This guide explains how to add an Aurora MySQL database in StrongDM using AWS IAM for authentication.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging.

Use this guide to complete IAM setup on your node, fill in the required properties (including the S3 query results location), and test connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Aurora MySQL clusters running MySQL-compatible engines that are configured for IAM database authentication.

Any standard MySQL client or library can connect through StrongDM, including:

* `mysql` and `mysqlsh` CLI clients
* GUI tools like MySQL Workbench or DBeaver
* Application frameworks using MySQL drivers

{% hint style="info" %}
IAM authentication must be enabled on your Aurora MySQL cluster. Ensure your Aurora engine version supports IAM DB auth (MySQL 5.6+, 5.7+, or 8.0+ depending on Aurora release).
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach the Aurora cluster endpoint and port (default: `3306`)
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Aurora MySQL cluster with IAM database authentication enabled
* Database user created with the `IDENTIFIED WITH AWSAuthenticationPlugin` clause
* IAM role or IAM user with:
  * `rds-db:connect` permissions for the DB resource
  * AWS permissions to generate database tokens (`rds:GenerateDbAuthToken`)
* Correct security groups/VPC settings so StrongDM nodes can connect to the cluster endpoint

## Resource Setup

Some setup steps are required to prepare an Aurora MySQL (IAM) resource to receive connections via StrongDM.

1. The AWS administrator should enable IAM authentication for the target MySQL resource in the AWS Management Console. This can be done at creation, or be modified at a later time. This is done by locating the **Database authentication** setting and choosing the option **Password and IAM database authentication**.
2. A MySQL administrator needs to log in to the database and create a user for use with StrongDM. For example: `CREATE USER db_userx IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS';`
3. Finally, the AWS administrator needs to add an IAM policy to the IAM role that is attached to the gateway or relay to allow access, as in the example shown.

```json
{
   "Version": "2012-10-17",
   "Statement": [
      {
         "Effect": "Allow",
         "Action": [
             "rds-db:connect"
         ],
         "Resource": [
             "arn:aws:rds-db:us-east-2:1234567890:dbuser:cluster-ABCDEFGHIJKL01234/db_userx"
         ]
      }
   ]
}
```

For further help, consult the [Aurora IAM documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.DBAccounts.html).

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Aurora MySQL (IAM) database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Aurora MySQL (IAM)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Aurora MySQL (IAM) datasource
sdm admin datasources add auroramysqliam aurora-mysql-iam-prod
  --hostname="mydb-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  --port=3306
  --database="production"
  --region="us-east-1"
  --username="iam_db_user"
  --role-arn="arn:aws:iam::123456789012:role/AuroraDBRole"
  --role-external-id="optional-external-id"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="aurora-iam-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Aurora MySQL (IAM) resource
resource "sdm_auroramysqliam" "aurora_prod" {
  name       = "aurora-mysql-iam-prod"
  hostname   = "mydb-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  port       = 3306
  database   = "production"
  region     = "us-east-1"
  username   = "iam_db_user"

  # IAM options
  role_arn         = "arn:aws:iam::123456789012:role/AuroraDBRole"
  role_external_id = "optional-external-id"
  # Alternative:
  # access_key_id     = "AKIAEXAMPLE"
  # secret_access_key = "secretKeyExample123"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "aurora-iam-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Athena (IAM) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                 | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**         | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**        | Required    | **Aurora MySQL (IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Proxy Cluster**        | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**             | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**                 | Required    | Port to use when connecting to your Aurora MySQL (IAM) database; default port value is **3306**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Connectivity Mode**    | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                  | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Healthcheck Database** | Optional    | Database name you would like to connect to specifically for healthchecks from StrongDM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Secret Store**         | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**             | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Username (path)**      | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Region**               | Required    | AWS region to connect to (for example, `us-west-2`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Role Assumption ARN**  | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Resource Tags**        | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Aurora resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect aurora-mysql-iam-prod
   ```

   \
   This sets local environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth) for connecting. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use the MySQL CLI or GUI to connect, as in the following example:

   ```bash
   mysql -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE
   ```

   \
   Run a simple query to confirm:

   ```bash
   SELECT NOW();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and statements were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Aurora MySQL

Learn how to add an Aurora MySQL database as a datasource in StrongDM.

## Overview

This guide explains how to add an Aurora MySQL database in StrongDM using standard database credentials (username and password).

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. Unlike [Aurora MySQL (IAM)](/admin/resources/datasources/aurora-mysql-iam), this resource type uses static credentials that you provide or manage through a secret store.

Use this guide to configure the required database details, supply credentials, and test connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Aurora clusters running **MySQL-compatible engines** (for example, Aurora MySQL 5.6, 5.7, or 8.0).

Any standard MySQL client or library works through StrongDM, including:

* MySQL CLI tools (`mysql`, `mysqlsh`)
* GUI clients (MySQL Workbench, DBeaver, DataGrip)
* Application frameworks that use MySQL drivers

{% hint style="info" %}
For IAM database authentication, see the **Aurora MySQL (IAM)** datasource type instead.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in a network location that can reach your Aurora cluster endpoint and port (`3306` by default)
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Aurora MySQL cluster deployed and available
* A database user created with the required privileges (for example, read-only for reporting or full CRUD for administration)
* Correct VPC, subnet, and security group rules so that StrongDM nodes can connect to the cluster endpoint

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Aurora MySQL database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Aurora MySQL** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Aurora MySQL datasource
sdm admin datasources add auroramysql aurora-mysql-prod
  --hostname="mydb-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  --port=3306
  --database="production"
  --username="db_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="aurora-mysql-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Aurora MySQL resource
resource "sdm_auroramysql" "aurora_prod" {
  name       = "aurora-mysql-prod"
  hostname   = "mydb-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  port       = 3306
  database   = "production"
  username   = "db_user"
  password   = "secret"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "aurora-mysql-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Aurora MySQL datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                                   | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                           | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                          | Required    | **Aurora MySQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Proxy Cluster**                          | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                               | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**                                   | Required    | Port to use when connecting to your Aurora MySQL database; default port value is **3306**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Connectivity Mode**                      | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                             | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                          | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                                    | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Healthcheck Database**                   | Optional    | Database name you would like to connect to specifically for healthchecks from StrongDM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Secret Store**                           | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                               | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                               | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Require Native Password Authentication** | Optional    | Enable if the resource requires the use of `mysql_native_password` for all connections; this option is available for backwards compatibility with prior MySQL versions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Use Azure Single Server Usernames**      | Optional    | If selected, the hostname is appended to the username when interacting with a `database.azure.com` address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Resource Tags**                          | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the Aurora resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect aurora-mysql-prod
   ```

   \
   This sets local environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth) for connecting. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use the MySQL client to connect, as in the following example:

   ```bash
   mysql -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE
   ```

   \
   Run a simple query to confirm:

   ```bash
   SELECT NOW();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and statements were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Aurora PostgreSQL (IAM)

Learn how to add an Aurora PostgreSQL database as a datasource in StrongDM using IAM.

## Overview

This guide explains how to add an Aurora PostgreSQL database as a datasource in StrongDM using AWS IAM for authentication.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. IAM authentication replaces static passwords with temporary authentication tokens that StrongDM retrieves from AWS.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Aurora PostgreSQL clusters that have IAM database authentication enabled. Supported engine versions include Aurora PostgreSQL-compatible releases (for example, versions based on PostgreSQL 9.6, 10.x, 11.x, 12.x, 13.x, and 14.x depending on Aurora’s availability in your region).

StrongDM works with any standard PostgreSQL client or library, such as:

* `psql` CLI
* GUI tools like DBeaver or DataGrip
* Application frameworks using PostgreSQL drivers

{% hint style="info" %}
Make sure your Aurora PostgreSQL cluster has IAM database authentication turned on and that your engine version supports it.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach the Aurora PostgreSQL cluster endpoint and port (`5432`).
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Aurora PostgreSQL cluster with IAM database authentication enabled
* Database user created with IAM authentication (for example: `CREATE USER db_iam_user WITH LOGIN; ALTER USER db_iam_user WITH rds_iam;`)
* IAM role or IAM user with:
  * `rds-db:connect` permission on the DB resource
  * AWS permissions to generate database tokens (`rds:GenerateDbAuthToken`)
* Correct VPC, subnet, and security group rules so StrongDM nodes can reach the cluster endpoint

## Resource Setup

Some setup steps are required to prepare an Aurora PostgreSQL (IAM) resource to receive connections via StrongDM.

1. The AWS administrator should enable IAM authentication for the target PostgreSQL cluster in the AWS Management Console. This can be done at creation, or be modified at a later time. This is done by locating the **Database authentication** setting and choosing the option **Password and IAM database authentication**.
2. A PostgreSQL administrator needs to log in to the database and grant the `rds_iam` permission either to an existing user or a newly created user for use with StrongDM. For example, `GRANT rds_iam TO db_userx` where `db_userx` is the username.
3. Finally, the AWS administrator needs to add an IAM policy to the IAM role that is attached to the gateway or relay to allow access, as in the example shown.

```json
{
   "Version": "2012-10-17",
   "Statement": [
      {
         "Effect": "Allow",
         "Action": [
             "rds-db:connect"
         ],
         "Resource": [
             "arn:aws:rds-db:us-east-2:1234567890:dbuser:cluster-ABCDEFGHIJKL01234/db_userx"
         ]
      }
   ]
}
```

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Aurora MySQL (IAM) database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Aurora PostgreSQL (IAM)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Aurora PostgreSQL (IAM) datasource
sdm admin datasources add aurorapostgresiam aurora-pg-iam-prod
  --hostname="mypg-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  --port=5432
  --database="production"
  --region="us-east-1"
  --username="iam_db_user"
  --role-arn="arn:aws:iam::123456789012:role/AuroraPGDBRole"
  --role-external-id="optional-external-id"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="aurora-pg-iam-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Aurora PostgreSQL (IAM) resource
resource "sdm_aurorapostgresiam" "aurora_pg_prod" {
  name       = "aurora-pg-iam-prod"
  hostname   = "mypg-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  port       = 5432
  database   = "production"
  region     = "us-east-1"
  username   = "iam_db_user"

  # IAM options
  role_arn         = "arn:aws:iam::123456789012:role/AuroraPGDBRole"
  role_external_id = "optional-external-id"
  # Alternative:
  # access_key_id     = "AKIAEXAMPLE"
  # secret_access_key = "secretKeyExample123"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "aurora-pg-iam-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Aurora PostgreSQL (IAM) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**        | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**       | Required    | **Aurora PostgreSQL (IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Proxy Cluster**       | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**            | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**                | Required    | Port to use when connecting to your Aurora PostgreSQL (IAM) database; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Connectivity Mode**   | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**          | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**       | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                 | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**            | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**        | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**            | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Username (path)**     | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Region**              | Required    | AWS region to connect to (for example, `us-west-2`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Role Assumption ARN** | Optional    | Role ARN, such as `arn:aws:iam::000000000000:role/RoleName`, that allows users accessing this resource to assume a role using [AWS AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Resource Tags**       | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect aurora-pg-iam-prod
   ```

   \
   This sets local environment variables (such as `PGHOST`, `PGPORT`, `PGUSER`, and so forth) for connecting. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect with psql:

   ```bash
   psql "$PGDATABASE"
   ```

   \
   Run a simple query to confirm:

   ```bash
   SELECT version();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Aurora PostgreSQL

Learn how to add an Aurora PostgreSQL database as a datasource in StrongDM.

## Overview

This guide explains how to add an Aurora PostgreSQL database as a datasource in StrongDM using standard database credentials (username and password).

When you add an Aurora PostgreSQL resource, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized credential management, access enforcement, and full query auditing. Unlike [Aurora PostgreSQL (IAM)](/admin/resources/datasources/aurora-postgresql-iam), this datasource type relies on static credentials, either provided directly or retrieved from a secret store.

Use this guide to configure the connection properties, add the resource in StrongDM, and test client connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Aurora PostgreSQL clusters running PostgreSQL-compatible engines, including supported Aurora PostgreSQL versions (for example, 9.6, 10.x, 11.x, 12.x, 13.x, and 14.x depending on availability).

Standard PostgreSQL clients and tools work seamlessly through StrongDM, including:

* `psql` CLI
* GUI tools like DBeaver and DataGrip
* Application frameworks that use PostgreSQL drivers

{% hint style="info" %}
For IAM-based database authentication, see the Aurora PostgreSQL (IAM) resource type.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Aurora PostgreSQL cluster endpoint on port `5432`
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the AWS side, you must have the following:

* Aurora PostgreSQL cluster deployed and available
* PostgreSQL user with the required privileges (read-only for reporting or full CRUD for administrative use)
* Correct VPC, subnet, and security group rules so that StrongDM nodes can reach the cluster endpoint

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add an Aurora MySQL (IAM) database as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Aurora PostgreSQL** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Aurora PostgreSQL datasource
sdm admin datasources add aurorapostgres aurora-pg-prod
  --hostname="mypg-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  --port=5432
  --database="production"
  --username="db_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="aurora-pg-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Aurora PostgreSQL resource
resource "sdm_aurorapostgres" "aurora_pg_prod" {
  name       = "aurora-pg-prod"
  hostname   = "mypg-cluster.cluster-abcdefghijkl.us-east-1.rds.amazonaws.com"
  port       = 5432
  database   = "production"
  username   = "db_user"
  password   = "secret"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "aurora-pg-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Aurora PostgreSQL datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Aurora PostgreSQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**              | Required    | Port to use when connecting to your Aurora PostgreSQL (IAM) database; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Restrict Database** | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect aurora-pg-prod
   ```

   \
   This sets local environment variables (such as `PGHOST`, `PGPORT`, `PGUSER`, and so forth) for connecting. See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect with psql:

   ```bash
   psql "$PGDATABASE"
   ```

   \
   Run a simple query to confirm:

   ```bash
   SELECT version();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Azure Database for MySQL

Learn how to add Azure Database for MySQL as a datasource in StrongDM.

## Overview

This guide explains how to add an Azure Database for MySQL resource in StrongDM using standard username and password authentication.

When you add an Azure MySQL resource, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This centralizes access control, credential management, and auditing.

To connect successfully, you’ll need the server hostname, port, database name, and a valid set of credentials. Optionally, you can configure StrongDM to pull credentials from a secret store. TLS is supported and recommended, especially since Azure requires encrypted connections by default.

Use this guide to configure the connection properties, add the resource in StrongDM, and test client connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Azure Database for MySQL servers running supported community MySQL versions (such as 5.7 and 8.0).

Any standard MySQL client works through StrongDM, including:

* MySQL CLI (`mysql`, `mysqlsh`)
* GUI clients (MySQL Workbench, DBeaver, DataGrip)
* Applications using MySQL drivers

{% hint style="info" %}
Azure Database for MySQL typically requires SSL/TLS for all connections. Ensure the `--tls-required` option (or equivalent setting) is enabled in StrongDM.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Azure MySQL server
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Azure side, you must have the following:

* Azure Database for MySQL server provisioned and running
* Database user with appropriate privileges (read-only for reporting, or full CRUD for administration)
* Ensure firewall rules and VNet service endpoints allow inbound connections from your StrongDM node
* Download the Azure SSL certificate if required for TLS validation.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Azure Database for MySQL as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Azure Database for MySQL** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Azure Database for MySQL datasource
sdm admin datasources add azuremysql azure-mysql-prod
  --hostname="myserver.mysql.database.azure.com"
  --port=3306
  --database="production"
  --username="db_user@myserver"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="azure-mysql-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Azure Database for MySQL resource
resource "sdm_azuremysql" "azure_mysql_prod" {
  name       = "azure-mysql-prod"
  hostname   = "myserver.mysql.database.azure.com"
  port       = 3306
  database   = "production"
  username   = "db_user@myserver"
  password   = "secret"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "azure-mysql-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Aurora PostgreSQL datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                                   | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                           | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                          | Required    | **Azure MySQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Proxy Cluster**                          | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                               | Required    | Hostname for your resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Port**                                   | Required    | Port to use when connecting to your Aurora MySQL database; default port value is **3306**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Connectivity Mode**                      | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                             | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                          | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                                    | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Healthcheck Database**                   | Optional    | Database name you would like to connect to specifically for healthchecks from StrongDM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Secret Store**                           | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                               | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                               | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Require Native Password Authentication** | Optional    | Enable if the resource requires the use of `mysql_native_password` for all connections; this option is available for backwards compatibility with prior MySQL versions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Use Azure Single Server Usernames**      | Optional    | If selected, the hostname is appended to the username when interacting with a `database.azure.com` address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Resource Tags**                          | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% hint style="info" %}
For use with Azure Flexible Servers, leave **Azure Single Server Usernames** unchecked.
{% endhint %}

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect azure-mysql-prod
   ```

   \
   This sets environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth). See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use a MySQL client:

   ```bash
   mysql -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE
   ```

   \
   Run a simple query to confirm:

   ```bash
   SELECT NOW();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Azure MySQL (Managed Identity)

Learn how to add Azure Database for MySQL (Managed Identity) as a datasource in StrongDM.

## Overview

This guide explains how to set up managed identities in the Microsoft Azure portal and set up StrongDM to use them to connect to Azure Database for MySQL. The Azure MySQL (Managed Identity) datasource type supports both user-assigned and system-assigned managed identities to authenticate to Azure Database for MySQL.

When you add an Azure MySQL (Managed Identity) resource, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and auditing, without the need to store long-lived MySQL passwords. Instead, StrongDM retrieves temporary access tokens from Azure Active Directory using a system- or user-assigned managed identity.

Use this guide to configure the connection properties, add the resource in StrongDM, and test client connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Azure Database for MySQL Flexible Servers and Single Servers that are configured to allow authentication with Azure AD identities.

Any standard MySQL client or driver can be used through StrongDM, including:

* MySQL CLI (`mysql`, `mysqlsh`)
* GUI clients (MySQL Workbench, DBeaver, DataGrip)
* Application libraries and ORMs that support MySQL

{% hint style="info" %}
Managed Identity authentication must be enabled on your Azure MySQL server, and the managed identity must be granted appropriate roles in Azure AD and database permissions in MySQL.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in an Azure environment where the managed identity is available
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Azure side, you must have the following:

* Access to an Azure subscription with appropriate permissions to create user-assigned managed identities
* Azure Virtual Machine (VM) with a StrongDM node (gateway, relay, or proxy worker) installed on it
* Azure account with the Virtual Machine Contributor and Managed Identity Operator role assignments in order to assign managed identities to your VM. Note that no other Microsoft Entra (formerly Azure AD) directory role assignments are required.
* At least one user-assigned managed identity already created, so you can assign it to the VM

## Azure Setup

The following steps provide general instructions on what to do within Azure. For more detailed information, please consult the [Microsoft Azure Database for MySQL documentation](https://learn.microsoft.com/en-us/azure/mysql/).

### User-assigned managed identity

If using a user-assigned managed identity, follow these steps.

1. Sign in to the Azure portal. You must use an account associated with the Azure subscription that contains the Azure VM that hosts your gateway or relay.
2. Assign a user-assigned managed identity to your VM.
3. Copy the client ID of that user-assigned managed identity for use in later steps.
4. Create a MySQL user for the user-assigned managed identity. This can be done for Azure Database for MySQL Single Server or Flexible Server.
5. Set up roles and permissions (for example, read or readwrite) on your database for the managed identity. This must be done so that the StrongDM gateway or relay can connect to it using the managed identity assigned to the gateway or relay's VM.

{% hint style="info" %}
Repeat these steps if you have more than one managed identity that needs access to the database.
{% endhint %}

### System-assigned managed identity

If using a system-assigned managed identity, follow these steps.

1. Sign in to the Azure portal using an account associated with the Azure subscription that contains the Azure VM that hosts your gateway or relay.
2. If the VM was provisioned without a system-assigned managed identity, enable the system-assigned managed identity by changing its status to **On**.
3. Find the client ID of the system-assigned managed identity and copy it for use in later steps. The client ID may be obtained by using the Azure CLI, not the Azure portal, with `az ad sp list --display-name <VM_NAME> --query [*].appId --out tsv`.
4. Create a MySQL user for the managed identity. This can be done for Azure Database for MySQL Single Server or Azure Database for MySQL Flexible Server. Note that the "managed identity name" for the system-assigned identity is the name of the VM.
5. Set up roles and permissions (for example, read or readwrite) on your database for the managed identity. This must be done so that the StrongDM gateway or relay can connect to it using the managed identity assigned to the gateway or relay's VM.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Azure Database for MySQL as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Azure MySQL (Managed Identity)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Azure MySQL (Managed Identity) datasource
sdm admin datasources add azuremysqlmi azure-mysql-mi-prod
  --hostname="myserver.mysql.database.azure.com"
  --port=3306
  --database="production"
  --username="mi_user@myserver" \
  --managed-identity-client-id="11111111-2222-3333-4444-555555555555"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="azure-mysql-mi-prod"
  --tags="env=production,team=data"

```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Azure MySQL (Managed Identity) resource
resource "sdm_azuremysqlmi" "azure_mysql_mi_prod" {
  name       = "azure-mysql-mi-prod"
  hostname   = "myserver.mysql.database.azure.com"
  port       = 3306
  database   = "production"
  username   = "mi_user@myserver"

  # Use this for a user-assigned identity; omit for system-assigned
  managed_identity_client_id = "11111111-2222-3333-4444-555555555555"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "azure-mysql-mi-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Azure MySQL (Managed Identity) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Display Name**                      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Resource Type**                     | Required    | **Azure MySQL (Managed Identity)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**                     | Required    | Defaults to "None (use gateways)"; if using proxy clusters, select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Hostname**                          | Required    | Hostname for your Azure Database for MySQL resource; must be accessible to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Port**                              | Optional    | Port to use when connecting to your Azure Database for MySQL; default port value is **3306**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Connectivity Mode**                 | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if Virtual Networking Mode is enabled for your organization                                                                                                                                                                                                                                                                                                  |
| **IP Address**                        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization                         |
| **Port Override**                     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the Port Overrides settings |
| **DNS**                               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                       |
| **Database**                          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Secret Store**                      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about Secret Store options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Schema**                            | Optional    | Name of the schema that should be used if the user belongs to a particular schema                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Username**                          | Required    | Username of the MySQL user for your managed identity, which you created during Azure setup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Username (path)**                   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Client ID**                         | Required    | Client ID of the managed identity, which you created during Azure setup                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Client ID (path)**                  | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Use Azure Single Server Usernames** | Optional    | If selected, the hostname is appended to the username when interacting with a `database.azure.com` address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Resource Tags**                     | Optional    | Resource tags consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect azure-mysql-mi-prod
   ```

   \
   This sets environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth). See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use a MySQL client:

   ```bash
   mysql -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER $MYSQL_DATABASE
   ```

   \
   The password is replaced by a temporary token retrieved from Azure AD.\
   \
   Run a simple query to confirm:

   ```bash
   SELECT NOW();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Azure PostgreSQL (Managed Identity)

Learn how to add Azure PostgreSQL (Managed Identity) as a datasource in StrongDM.

### Overview

This guide explains how to set up managed identities in the Microsoft Azure portal and set up StrongDM to use them to connect to Azure Database for PostgreSQL. The Azure PostgreSQL (Managed Identity) datasource type supports both user-assigned and system-assigned managed identities to authenticate to Azure Database for PostgreSQL.

When you add an Azure PostgreSQL (Managed Identity) resource, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This provides centralized access control, credential management, and auditing, while eliminating the need to manage long-lived PostgreSQL passwords. StrongDM requests temporary access tokens from Azure Active Directory (Azure AD) using either a system-assigned or user-assigned managed identity.

Use this guide to configure the connection properties, add the resource in StrongDM, and test client connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports **Azure Database for PostgreSQL Flexible Server** and **Single Server** instances configured for Azure AD authentication.

Any standard PostgreSQL client or driver can connect through StrongDM, including:

* `psql` CLI
* GUI clients (DBeaver, DataGrip)
* Applications and frameworks using PostgreSQL drivers

{% hint style="info" %}
Managed Identity authentication must be enabled on the Azure PostgreSQL server. The managed identity must be mapped to a corresponding PostgreSQL role with appropriate privileges.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) running in Azure with access to the managed identity
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Azure side, you must have the following:

* Access to an Azure subscription with appropriate permissions to create user-assigned managed identities
* Azure Virtual Machine (VM) with a StrongDM node (gateway, relay, or proxy worker) installed on it
* Azure account with the Virtual Machine Contributor and Managed Identity Operator role assignments in order to assign managed identities to your VM. Note that no other Microsoft Entra (formerly Azure AD) directory role assignments are required.
* At least one user-assigned managed identity already created, so you can assign it to the VM

## Azure Setup

The following steps provide general instructions on what to do within Azure. For more detailed information, please consult Microsoft Azure documentation:

* [Managed Identity Setup for Azure Database for PostgreSQL Single Server](https://learn.microsoft.com/azure/postgresql/single-server/how-to-connect-with-managed-identity)
* [Managed Identity Setup for Azure Database for PostgreSQL Flexible Server](https://learn.microsoft.com/azure/postgresql/flexible-server/how-to-connect-with-managed-identity)

### User-assigned managed identity

If using a user-assigned managed identity, follow these steps.

1. Sign in to the Azure portal. You must use an account associated with the Azure subscription that contains the Azure VM that hosts your gateway or relay.
2. Assign a user-assigned managed identity to your VM.
3. Copy the client ID of that user-assigned managed identity for use in later steps.
4. Create a PostgreSQL user for the user-assigned managed identity. This can be done for Azure Database for PostgreSQL Single Server or Flexible Server.
5. Set up roles and permissions (for example, read or readwrite) on your database for the managed identity. This must be done so that the StrongDM gateway or relay can connect to it using the managed identity assigned to the gateway or relay's VM.

{% hint style="info" %}
Repeat these steps if you have more than one managed identity that needs access to the database.
{% endhint %}

### System-assigned managed identity

If using a system-assigned managed identity, follow these steps.

1. Sign in to the Azure portal using an account associated with the Azure subscription that contains the Azure VM that hosts your gateway or relay.
2. If the VM was provisioned without a system-assigned managed identity, enable the system-assigned managed identity by changing its status to **On**.
3. Find the client ID of the system-assigned managed identity and copy it for use in later steps. The client ID may be obtained by using the Azure CLI, not the Azure portal, with `az ad sp list --display-name <VM_NAME> --query [*].appId --out tsv`.
4. Create a PostgreSQL user for the managed identity. This can be done for Azure Database for PostgreSQL Single Server or Azure Database for PostgreSQL Flexible Server. Note that the "managed identity name" for the system-assigned identity is the name of the VM.
5. Set up roles and permissions (for example, read or readwrite) on your database for the managed identity. This must be done so that the StrongDM gateway or relay can connect to it using the managed identity assigned to the gateway or relay's VM.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Azure PostgreSQL (Managed Identity) as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Azure PostgreSQL (Managed Identity)** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Azure PostgreSQL (Managed Identity) datasource
sdm admin datasources add azurepostgresmi azure-pg-mi-prod
  --hostname="mypg.postgres.database.azure.com"
  --port=5432
  --database="production"
  --username="mi_user@mypg"
  --managed-identity-client-id="11111111-2222-3333-4444-555555555555"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="azure-pg-mi-prod"
  --tags="env=production,team=data"

Omit --managed-identity-client-id if you are using a system-assigned managed identity
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Azure PostgreSQL (Managed Identity) resource
resource "sdm_azurepostgresmi" "azure_pg_mi_prod" {
  name       = "azure-pg-mi-prod"
  hostname   = "mypg.postgres.database.azure.com"
  port       = 5432
  database   = "production"
  username   = "mi_user@mypg"

  # For user-assigned identity; omit for system-assigned
  managed_identity_client_id = "11111111-2222-3333-4444-555555555555"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "azure-pg-mi-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Azure PostgreSQL (Managed Identity) datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                     | Required    | **Azure PostgreSQL (Managed Identity)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Proxy Cluster**                     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                          | Required    | Hostname for your Azure PostgreSQL database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Port**                              | Optional    | Port to use when connecting to your Azure PostgreSQL database; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Connectivity Mode**                 | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**                          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**                      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                          | Required    | Username of the PostgreSQL user for your managed identity, which you created during [Azure setup](#azure-setup)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**                   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Client ID**                         | Required    | Client ID of your managed identity in the Azure portal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Client ID (path)**                  | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Restrict Database**                 | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Use Azure Single Server Usernames** | Optional    | If selected, the hostname is appended to the username when interacting with a `database.azure.com` address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Resource Tags**                     | Optional    | Resource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect azure-pg-mi-prod
   ```

   \
   This sets environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth). See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use psql:

   ```bash
   psql "$PGDATABASE"
   ```

   \
   The password is replaced by a temporary token retrieved from Azure AD.\
   \
   Run a simple query to confirm:

   ```bash
   SELECT version();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to confirm the session and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# Azure PostgreSQL

Learn how to add Azure PostgreSQL as a datasource in StrongDM.

### Overview

This guide explains how to add an Azure Database for PostgreSQL to StrongDM using standard username and password authentication. When configured, StrongDM proxies client connections through a gateway, relay, or proxy cluster, allowing centralized credential management, access control, and audit logging.

When you add an Azure PostgreSQL resource, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This provides centralized access control, credential management, and auditing.

Use this guide to configure the connection properties, add the resource in StrongDM, and test client connectivity.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports **Azure Database for PostgreSQL Flexible Server** and **Single Server** instances configured for Azure AD authentication.

Any standard PostgreSQL client or driver can connect through StrongDM, including:

* `psql` CLI
* GUI clients (DBeaver, DataGrip)
* Applications and frameworks using PostgreSQL drivers

{% hint style="info" %}
Managed Identity authentication must be enabled on the Azure PostgreSQL server. The managed identity must be mapped to a corresponding PostgreSQL role with appropriate privileges.
{% endhint %}

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) must have network access to the target Azure PostgreSQL endpoint
* If using secrets management tools for storing your credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Azure side, you must have the following:

* Azure Database for PostgreSQL server provisioned (Flexible Server or Single Server)
* PostgreSQL user account created with the appropriate privileges (for example, read-only for analytics or full CRUD for admin use)
* Server firewall rules or VNet/Private Link access configured so that the StrongDM nodes can connect to the PostgreSQL server
* SSL/TLS enabled, as Azure requires encrypted connections by default. Ensure you have downloaded the Azure CA certificate if certificate validation is required in your environment.
* Correct username format, depending on your server type:
  * Flexible Server: usually just `username`
  * Single Server: `username@servername` format (for example, `dbuser@mypgserver`)

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Azure Database for PostgreSQL as a StrongDM resource, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. Select **Azure Database for PostgreSQL** as the **Resource Type** and set other [configuration properties](#configuration-properties) for your new database resource.
5. Complete all required fields.
6. Click **Create** to save the resource.
7. Click the resource name to [view status](#resource-status), diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Azure Database for PostgreSQL datasource
sdm admin datasources add azurepostgres azure-pg-prod
  --hostname="mypgserver.postgres.database.azure.com"
  --port=5432
  --database="production"
  --username="dbuser@mypgserver"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="-1"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="azure-pg-prod"
  --tags="env=production,team=data"

# For Single Server deployments, the username must include the @servername suffix
# For Flexible Server, use just username
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Azure Database for PostgreSQL resource
resource "sdm_azurepostgres" "azure_pg_prod" {
  name       = "azure-pg-prod"
  hostname   = "mypgserver.postgres.database.azure.com"
  port       = 5432
  database   = "production"
  username   = "dbuser@mypgserver"
  password   = "secret"

  # Networking / routing
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  # Secrets / metadata
  secret_store_id = "se-e1b2"
  subdomain       = "azure-pg-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define an Azure Database for PostgreSQL datasource in StrongDM. These settings control how StrongDM connects to the resource, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Azure Database for PostgreSQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your Azure database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Port**              | Required    | Port to use when connecting to your Azure PostgreSQL database; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Restrict Database** | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Ensure that the resource appears in your list of accessible datasources.
3. Start a session to the resource, as in the following example:

   ```bash
   sdm connect azure-pg-prod
   ```

   \
   This sets environment variables (such as `MYSQL_HOST`, `MYSQL_PORT`, and so forth). See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use psql to connect:

   ```bash
   psql "$PGDATABASE"
   ```

   \
   Or connect manually:\\

   ```bash
   psql -h $PGHOST -p $PGPORT -U $PGUSER -d $PGDATABASE
   ```

   \
   Run a test query. If successful, you should see the PostgreSQL engine version.

   ```bash
   SELECT version();
   ```
5. In the StrongDM Admin UI, check **Logs > Connections** and **Logs > Queries** to confirm the session and queries are logged.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region
* Timestamps of failed attempts


# BigQuery

Learn how to add BigQuery as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding BigQuery as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard BigQuery clients and drivers that communicate using the BigQuery API.

To add the resource to StrongDM, you will need the BigQuery project ID and a valid service account key in JSON format. Optionally, you can store this key in a supported secret manager and reference it from within StrongDM. The BigQuery API endpoint (`www.googleapis.com`) must be reachable from the selected StrongDM node and configured to allow outbound connections to that service.

Use this guide to complete all necessary preparations to add BigQuery to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to query BigQuery through StrongDM.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports all generally available versions of Google BigQuery. Because BigQuery is a managed service, version compatibility is handled by Google, and StrongDM integrates with the stable BigQuery API rather than a specific engine version.

StrongDM is generally compatible with all standard BigQuery clients, including command-line tools, SDKs, and GUI-based connectors.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) deployed in a location that can reach the BigQuery API endpoint (`https://www.googleapis.com/bigquery/v2/`)
* Valid BigQuery credentials (username and password, or appropriate authentication key)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM
* Connection tools such as the BigQuery `bq` command line tool or another method to test your connection to the resource independently of StrongDM, if needed

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the GCP side, you must have the following:

* Google Cloud project with BigQuery enabled
* Valid service account with sufficient permissions to run queries against BigQuery (for example, `roles/bigquery.dataViewer`, `roles/bigquery.jobUser`, or broader roles if required)
* JSON service account key file, either uploaded directly into StrongDM or stored in a configured Secret Store
* If using VPC Service Controls, egress filtering, or private networking, ensure that StrongDM nodes are allowed to connect to the BigQuery API endpoint (`www.googleapis.com`) and that DNS resolution is configured properly.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add BigQuery as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **BigQuery**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add a BigQuery datasource
sdm admin datasources add bigquery bigquery-prod
  --endpoint="www.googleapis.com"
  --project="example-project-123456"
  --private-key="$(cat /path/to/service-account.json)"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --tags="env=production,team=analytics"

```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create BigQuery resource
resource "sdm_bigquery" "bq_prod" {
  name             = "bigquery-prod"
  endpoint         = "www.googleapis.com"
  project          = "example-project-123456"

  # If storing creds in StrongDM / as inline secret:
  private_key      = file("service-account.json")

  # If using a Secret Store instead, omit private_key and set:
  # secret_store_id = "se-e1b2"

  # Networking / routing / metadata
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"
  tags = {
    env  = "production"
    team = "analytics"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a BigQuery datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **BigQuery**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Endpoint**          | Required    | Endpoint (for example, `www.googleapis.com`), which [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Project**           | Required    | Project ID that is configured for the database (for example, "example-project-123456")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **JSON Private Key**  | Required    | JSON private key associated with your project ID; this field is shown when Secret Store integration is not configured for your organization, or when it is and StrongDM is the selected Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect bigquery
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Run a test query, as in the following example:

   ```sql
   SELECT CURRENT_DATE();
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your query was captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Cassandra

Learn how to add Cassandra as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Apache Cassandra as a resource via StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Cassandra clients and drivers using the CQL (Cassandra Query Language) protocol.

To add the resource to StrongDM, you will need the Cassandra cluster’s hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secret manager and reference them from within StrongDM. The Cassandra server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to complete all necessary preparations to add Cassandra to your StrongDM environment; fill in the appropriate properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect to Cassandra.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Apache Cassandra 3.x and higher, as well as compatible Cassandra distributions such as DataStax Enterprise (DSE) that expose the CQL (Cassandra Query Language) protocol. These versions cover the commonly deployed, production-ready Cassandra environments in modern infrastructures.

StrongDM is generally compatible with all Cassandra clients and drivers that use the CQL native protocol.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Cassandra host and port (`9042`)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Cassandra server side, you must have the following:

* Cassandra cluster deployed and running (on Apache Cassandra or a compatible distribution)
* Database user with a valid username and password configured in Cassandra
* Network configuration (such as firewalls or VPC rules) that allows StrongDM nodes to reach the Cassandra host/port

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Apache Cassandra as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Cassandra**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Cassandra datasource
sdm admin datasources add cassandra cassandra-prod
  --hostname="cassandra.example.org"
  --port=9042
  --username="cassa_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="cassandra-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Cassandra resource
resource "sdm_cassandra" "cass_prod" {
  name             = "cassandra-prod"
  hostname         = "cassandra.example.org"
  port             = 9042
  username         = "cassa_user"
  password         = "secret"

  # Enable TLS if encryption is required
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "cassandra-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Cassandra datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Cassandra**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Required    | Port to use when connecting to your resource; default port value is **9042**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect cassandra-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use a Cassandra client to connect. For example:

   ```bash
   cqlsh $CASSANDRA_HOST $CASSANDRA_PORT -u $CASSANDRA_USER -p $CASSANDRA_PASSWORD
   ```
5. Run a test, as in the following example:

   ```
   SELECT now() FROM system.local;
   ```
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and query were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Citus

Learn how to add Citus as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Citus as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Citus-compatible PostgreSQL clients and drivers using the PostgreSQL wire protocol.

Use this guide to complete all necessary preparations for adding Citus to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you’ll be able to use the StrongDM Desktop application or CLI to connect to Citus.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Citus 8.x and higher, as well as compatible distributions such as Citus Community Edition and Azure Citus. These versions cover widely used, production-ready Citus deployments.

StrongDM is compatible with all standard PostgreSQL and Citus clients that speak the PostgreSQL wire protocol.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Citus coordinator (or proxy) host and port (default `5432`).
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Citus side, you must have the following:

* Citus cluster deployed and accessible, either via the coordinator or load-balancing proxy
* PostgreSQL user account with appropriate privileges on the Citus database
* Network policies (firewall or VPC rules) allowing StrongDM nodes to connect to the coordinator

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Citus as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Citus**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Citus datasource
sdm admin datasources add citus citus-prod
  --hostname="citus-coordinator.example.org"
  --port=5432
  --database="my_analytics_db"
  --username="citus_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="citus-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Citus resource
resource "sdm_citus" "citus_prod" {
  name             = "citus-prod"
  hostname         = "citus-coordinator.example.org"
  port             = 5432
  database         = "my_analytics_db"
  username         = "citus_user"
  password         = "secret"

  # TLS if configured
  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "citus-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Citus datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Citus**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Required    | Port to use when connecting to your resource; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Restrict Database** | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect citus-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use a PostgreSQL client to connect. For example:

   ```bash
   psql -h $PGHOST -p $PGPORT -U $PGUSER -d $PGDATABASE
   ```
5. Run a test, as in the following example:

   ```
   SELECT count(*) FROM your_shard_table LIMIT 1;
   ```
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and query were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# ClickHouse

Learn how to add ClickHouse as a datasource in StrongDM.

### Overview

This guide describes how to add a ClickHouse database as a datasource in StrongDM. StrongDM supports HTTP, MySQL, Postgres, and TCP for connection to ClickHouse. If you want to use a Postgres client to connect to ClickHouse, simply follow the [Postgres](/admin/resources/datasources/postgresql) guide.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard ClickHouse clients and drivers using the ClickHouse native protocol.

To add the resource to StrongDM, you will need the ClickHouse server's hostname, port, and a valid set of credentials. Optionally, you can store these credentials in a supported secret manager and reference them in StrongDM. The ClickHouse server must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to perform all necessary preparations to add ClickHouse to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you can use the StrongDM Desktop application or CLI to connect to ClickHouse.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports ClickHouse versions 20.8 and higher, including widely used, production-ready deployments.

StrongDM is compatible with all ClickHouse client tools and drivers that use the ClickHouse native protocol (HTTP or TCP).

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the ClickHouse host and port (typically `9440` for HTTPS or `9000` for native TCP)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the ClickHouse side, you must have the following:

* Running ClickHouse cluster or standalone server, reachable at the specified hostname/port
* User account with valid credentials in ClickHouse
* Network configuration (firewalls, VPC rules, etc.) that permits access from StrongDM nodes

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add ClickHouse as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **ClickHouse (HTTP)**, **ClickHouse (MySQL)**, **ClickHouse (TCP)**, or **PostgreSQL**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add ClickHouse (HTTP) datasource
sdm admin datasources add clickhousehttp clickhouse-http-prod
  --hostname="clickhouse-http.example.org"
  --port=8443
  --username="ch_http_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12346"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="clickhouse-http-prod"
  --tags="env=production,team=analytics"

# Add ClickHouse (MySQL) datasource
sdm admin datasources add clickhousemysql clickhouse-mysql-prod
  --hostname="clickhouse-mysql.example.org"
  --port=9004
  --username="ch_mysql_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12347"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="clickhouse-mysql-prod"
  --tags="env=production,team=analytics"

# Add ClickHouse (TCP) datasource
sdm admin datasources add clickhousetcp clickhouse-tcp-prod
  --hostname="clickhouse-tcp.example.org"
  --port=9000
  --username="ch_tcp_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12348"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="clickhouse-tcp-prod"
  --tags="env=production,team=analytics"

# Add PostgreSQL (for ClickHouse) datasource
sdm admin datasources add postgres clickhouse-pg-prod
  --hostname="pg.example.org"
  --port=9005
  --database="default"
  --username="ch_pg_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12349"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="clickhouse-pg-prod"
  --tags="env=production,team=analytics"


```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create ClickHouse (Native) resource
resource "sdm_clickhouse" "ch_prod" {
  name             = "clickhouse-prod"
  hostname         = "clickhouse.example.org"
  port             = 9440
  username         = "ch_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clickhouse-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}

# Create ClickHouse (HTTP) resource
resource "sdm_clickhousehttp" "ch_http_prod" {
  name             = "clickhouse-http-prod"
  hostname         = "clickhouse-http.example.org"
  port             = 8443
  username         = "ch_http_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12346
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clickhouse-http-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}

# Create ClickHouse (MySQL) resource
resource "sdm_clickhousemysql" "ch_mysql_prod" {
  name             = "clickhouse-mysql-prod"
  hostname         = "clickhouse-mysql.example.org"
  port             = 9004
  username         = "ch_mysql_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12347
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clickhouse-mysql-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}

# Create ClickHouse (TCP) resource
resource "sdm_clickhousetcp" "ch_tcp_prod" {
  name             = "clickhouse-tcp-prod"
  hostname         = "clickhouse-tcp.example.org"
  port             = 9000
  username         = "ch_tcp_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12348
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clickhouse-tcp-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}

# Create ClickHouse (PostgreSQL wire protocol) resource
resource "sdm_clickhousepostgres" "ch_pg_prod" {
  name             = "clickhouse-pg-prod"
  hostname         = "clickhouse-pg.example.org"
  port             = 9005
  database         = "default"
  username         = "ch_pg_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12349
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clickhouse-pg-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a ClickHouse datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

{% tabs %}
{% tab title="ClickHouse (HTTP)" %}
**ClickHouse (HTTP) resource properties**

The following table describes the settings available for the ClickHouse (HTTP) datasource type.

{% hint style="info" %}
Both HTTP and HTTPS are supported. For HTTP, the default port value is 8123. For HTTPS, the default port value is 8443.
{% endhint %}

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | Select **Clickhouse (HTTP)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                              |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's Port Overrides page after the resource is created; if **Loopback Mode** is the selected connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                  |
| **Database**          | Optional    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **Base URL**          | Required    | Base address of the database without the path (for example, `https://www.example.com`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="ClickHouse (MySQL) " %}
**ClickHouse (MySQL) resource properties**

The following table describes the settings available for the ClickHouse (MySQL) datasource type.

| Property                                   | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                           | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                          | Required    | Select **ClickHouse (MySQL)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**                          | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                               | Required    | Hostname for your ClickHouse (MySQL) database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Port**                                   | Required    | Port to use when connecting to your ClickHouse (MySQL) database; default port value is **9004**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Connectivity Mode**                      | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                              |
| **IP Address**                             | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's Port Overrides page after the resource is created; if **Loopback Mode** is the selected connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**                          | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                         |
| **DNS**                                    | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                  |
| **Healthcheck Database**                   | Optional    | Database used exclusively for healthchecks; note that the database sent by clients is respected otherwise                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**                           | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                               | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                               | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **Require Native Password Authentication** | Optional    | If the resource requires the use of `mysql_native_password` for all connections, enable this option; this option is available for backwards compatibility with prior MySQL versions                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Resource Tags**                          | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}                               |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="ClickHouse (TCP)" %}
**ClickHouse (TCP) resource properties**

The following table describes the settings available for the ClickHouse (TCP) datasource type.

{% hint style="info" %}
The ClickHouse (TCP) datasource type supports ClickHouse server versions 24.1.0 to 24.1.3 and versions 24.2 to 24.10.
{% endhint %}

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | Select **ClickHouse (TCP)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your ClickHouse (TCP) database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Port**              | Required    | Port to use when connecting to your ClickHouse (TCP) database; default port value for TCP is **9000**; default port value for TCP with TLS is **9440**                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                              |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's Port Overrides page after the resource is created; if **Loopback Mode** is the selected connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                  |
| **Database**          | Optional    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                              |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="PostgreSQL (for ClickHouse)" %}
**PostgreSQL (for ClickHouse) resource properties**

To allow users to use Postgres clients to connect to ClickHouse, select **PostgreSQL** as the **Resource Type** and set all required properties. For your convenience, the [PostgreSQL](/admin/resources/datasources/postgresql) resource properties are pasted here.

{% hint style="info" %}
The PostgreSQL protocol only supports plaintext passwords. The plaintext password type must be configured on the ClickHouse server in order for the Postgres protocol to work.
{% endhint %}

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | Select **PostgreSQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for the resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Port**              | Required    | Port to use when connecting to the resource; default port value is **9005**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Override Database** | Optional    | By default, StrongDM will limit all connections to the configured PostgreSQL database; uncheck the box to disable this option                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| {% endtab %}          |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| {% endtabs %}         |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect clickhouse-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Use a ClickHouse CLI to connect. For example:

   ```bash
   clickhouse-client --host $CLICKHOUSE_HOST --port $CLICKHOUSE_PORT --user $CLICKHOUSE_USER --password $CLICKHOUSE_PASSWORD --query "SELECT now()"
   ```
5. Run a test, as in the following example:

   ```
   SELECT count(*) FROM your_shard_table LIMIT 1;
   ```
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and query were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Clustrix

Learn how to add Clustrix as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Clustrix (distributed SQL compatible with MariaDB) as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard MySQL clients and drivers using the MariaDB/MySQL protocol to connect to Clustrix clusters.

To add the resource to StrongDM, you will need the Clustrix coordinator (or proxy) hostname, port, and valid credentials. Optionally, you can store these credentials in a supported secret manager and reference them from within StrongDM. The Clustrix endpoint must be reachable from the selected StrongDM node and configured to accept connections from that node’s IP or network.

Use this guide to complete all necessary preparations for adding Clustrix to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you’ll be able to use the StrongDM Desktop application or CLI to connect to Clustrix.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Clustrix / MariaDB Xpand versions 3.x and above, covering enterprise-grade, multi-node distributed SQL deployments.

StrongDM is compatible with all MySQL/MariaDB clients and drivers, including:

* CLI tools (`mysql`, `mysqlsh`)
* GUI clients like MySQL Workbench or DBeaver
* Application frameworks using MySQL or MariaDB connectors

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Clustrix endpoint and port (`3306` by default)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Clustrix side, you must have the following:

* Running Clustrix or MariaDB Xpand cluster, reachable at the specified hostname/port
* Database user with appropriate privileges on the target Clustrix database
* Network configuration (firewalls, VPC rules) permitting StrongDM node access

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Clustrix as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Clustrix**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Clustrix datasource
sdm admin datasources add clustrix clustrix-prod
  --hostname="clustrix.example.org"
  --port=3306
  --database="mydb"
  --username="cx_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="clustrix-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Clustrix resource
resource "sdm_clustrix" "cx_prod" {
  name             = "clustrix-prod"
  hostname         = "clustrix.example.org"
  port             = 3306
  database         = "mydb"
  username         = "cx_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "clustrix-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Clustrix datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                                   | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**                           | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**                          | Required    | **Clustrix**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**                          | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                               | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**                                   | Required    | Port to use when connecting to your resource; default port value is **3306**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode**                      | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**                             | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**                          | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                                    | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Healthcheck Database**                   | Optional    | Database used exclusively for healthchecks; note that the database sent by clients is respected otherwise                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**                           | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                               | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                               | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**                        | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Require Native Password Authentication** | Optional    | If the resource requires the use of `mysql_native_password` for all connections, enable this option; this option is available for backwards compatibility with prior MySQL versions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Use Azure Single Server Usernames**      | Optional    | If selected, the hostname is appended to the username when interacting with a `database.azure.com` address                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Resource Tags**                          | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect clustrix-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect using a MySQL client. For example:

   ```bash
   mysql -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE
   ```
5. Run a test, as in the following example:

   ```sql
   SHOW DATABASES;
   ```
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session was captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# CockroachDB

Learn how to add CockroachDB as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding CockroachDB as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports any client compatible with the PostgreSQL wire protocol, as CockroachDB is PostgreSQL-compatible.

Use this guide to complete all necessary preparations for adding CockroachDB to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you’ll be able to use the StrongDM Desktop application or CLI to connect to Citus.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports **CockroachDB versions 20.2 and higher**, including community, managed, and cloud deployments.

Because CockroachDB is wire-compatible with PostgreSQL, StrongDM supports all PostgreSQL clients, such as:

* CLI tools (`psql`, DBeaver)
* PostgreSQL drivers (JDBC, psycopg2, JDBC, and so forth)
* BI and ORM frameworks using PostgreSQL dialects

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach the CockroachDB endpoint (host and port)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the CockroachDB side, you must have the following:

* Running CockroachDB cluster or standalone node accessible at the specified endpoint
* Database user with required permissions on the target database
* Firewall or network rules allowing access from StrongDM nodes

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add CockroachDB as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **CockroachDB**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add CockroachDB datasource
sdm admin datasources add cockroachdb cb-prod
  --hostname="cockroachdb.example.org"
  --port=26257
  --database="defaultdb"
  --username="cb_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="cockroachdb-prod"
  --tags="env=production,team=analytics"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create CockroachDB resource
resource "sdm_cockroachdb" "cb_prod" {
  name             = "cockroachdb-prod"
  hostname         = "cockroachdb.example.org"
  port             = 26257
  database         = "defaultdb"
  username         = "cb_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "cockroachdb-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a CockroachDB datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **CockroachDB**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Required    | Port to use when connecting to your resource; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Restrict Database** | Optional    | When selected, limits all connections to the configured database                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect cockroachdb-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect with psql. For example:

   ```bash
   psql "postgresql://$PGUSER@$PGHOST:$PGPORT/$PGDATABASE?sslmode=require"
   ```
5. Run a test, as in the following example:

   ```
   SELECT version();
   ```
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and query were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Couchbase

Learn how to add Couchbase as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding a Couchbase database as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Couchbase clients and drivers compatible with the Couchbase SDKs and query protocols.

Use this guide to complete all necessary preparations to add Couchbase to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once configured, you'll be able to use the StrongDM Desktop application or CLI to connect to Couchbase.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

{% hint style="info" %}
StrongDM supports Couchbase versions 7.6 and 8.0.
{% endhint %}

StrongDM also supports Couchbase Capella (cloud-hosted) deployments, as long as they are accessible to StrongDM nodes over the required ports.

StrongDM is generally compatible with all official Couchbase client tools and SDKs that connect via the Couchbase binary protocol or the N1QL query service.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach theCouchbase endpoint hostname and port
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Couchbase side, you must have the following:

* Running Couchbase cluster or server accessible via the designated hostname and port
* User account with proper privileges
* Network configurations (firewalls, VPC rules, subnet access) allowing StrongDM nodes to connect

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Couchbase as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Couchbase**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Couchbase datasource
sdm admin datasources add couchbase cb-prod
  --hostname="cb.example.org"
  --port=11210
  --username="cb_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="couchbase-prod"
  --tags="env=production,team=analytics"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Couchbase resource
resource "sdm_couchbase" "cb_prod" {
  name             = "couchbase-prod"
  hostname         = "cb.example.org"
  port             = 11210
  username         = "cb_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "couchbase-prod"
  tags = {
    env  = "production"
    team = "analytics"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Couchbase datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Couchbase**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your Couchbase database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Port**              | Optional    | Port to use when connecting to your Couchbase database; default port value is **11210**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your secret store location, if using a secret store (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a secret store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Password (path)**   | Required    | Path to the secret in your secret store location, if using a secret store (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a secret store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this Couchbase resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **N1QL Port**         | Required    | Port number for N1QL queries; default HTTP is 8093; default HTTPS is 18093                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect couchbase-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect using a Couchbase client pointing to `$CB_HOST:$CB_PORT`, with provided credentials.
5. Run a sample N1QL query to verify connectivity
6. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session and query were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Databricks SQL

Learn how to add Databricks SQL as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Databricks SQL as a datasource in StrongDM.

When the resource is added, StrongDM proxies client connections through a StrongDM node (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging.

To connect to Databricks SQL, you’ll need your Databricks workspace Server Hostname and the SQL warehouse or cluster HTTP Path, which are available in the Databricks connection details.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

Databricks SQL is typically accessed via standard JDBC and ODBC clients and drivers (for example, BI tools and SQL IDEs) using Databricks workspace hostname and HTTP Path connection settings.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to your Databricks workspace hostname (typically on port 443)
* If using secrets management tools for storing your Databricks credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

On the Databricks side, you must have the following:

* Access to a Databricks workspace
* A SQL warehouse or cluster you intend to query
* A Databricks authentication mechanism you will use with StrongDM (commonly a Personal Access Token (PAT))

{% hint style="info" %}
In Databricks, the connection details you need are typically listed as **Server Hostname**, **Port**, and **HTTP Path** for the SQL warehouse.
{% endhint %}

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Databricks SQL as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Databricks SQL**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Databricks SQL datasource
sdm admin datasources add databricks analytics-warehouse
  --hostname="dbc-example.cloud.databricks.com"
  --http-path="/sql/1.0/warehouses/abc123def456"
  --access-token="dapiXXXXXXXXXXXXXXXX"
  --connectivity-mode="vnm"
  --ip-address="100.64.100.100"
  --port-override="15443"
  --dns="databricks-analytics"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --tags="env=production,team=analytics"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = ">= 16.15.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Databricks SQL resource
resource "sdm_resource" "databricks_sql" {
  databricks_sql {
     name = "analytics-warehouse"
     
     # Required
     hostname = "dbc-example.cloud.databricks.com"
     http_path = "/sql/1.0/warehouses/abc123def456"
     access_token = "dapiXXXXXXXXXXXXXXXX"
     
     # Optional (StrongDM networking/routing)
     proxy_cluster_id = "n-1a2b345c67890123"
     secret_store_id = "se-e1b2"
     
     # If you’re using Virtual Networking Mode
     # Field names may vary slightly by provider version
     connectivity_mode = "vnm"
     ip_address = "100.64.100.100"
     port_override = 15443
     dns = "databricks-analytics"
     
     tags = {
       env = "production"
       team = "analytics"
    }
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following table describes the settings available for Databricks SQL.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Databricks SQL**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your resource (for example, `dbc-example.cloud.databricks.com`); [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system                                                                                                                                                                                                                                                                                                                              |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the range `100.64.0.1` to `100.127.255.252` (default `100.64.100.100`); optionally change the default value for Virtual Networking Mode to your preferred IP address value, as long as it's a valid IP address defined by your organization settings; edit either on this form or later on the Admin UI's Port Overrides page after the resource is created; if **Loopback Mode** is the selected connectivity mode, the IP address value must be within the range of `127.0.0.1` to `127.0.0.34` |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource; when left empty, the system assigns the default port to this resource; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                  |
| **HTTP Path**         | Required    | HTTP path to your SQL warehouse or cluster; found in the JDBC/ODBC connection details                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**      | Optional    | Credential store location; defaults to **Stored in StrongDM**; learn more about [Secret Store options](#secret-store-options)                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Access Token**      | Required    | Databricks Personal Access Token (PAT) for authentication                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Settings** > **Secrets Management.** When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect analytics-warehouse
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect using your preferred Databricks-capable SQL client (JDBC/ODBC/BI tool) pointed at the StrongDM-provided local endpoint, and verify you can run a simple query (for example `SELECT 1`).

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Db2 LUW

Learn how to add Db2 LUW as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Db2 LUW as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports standard Db2 LUW clients and drivers that use the PostgreSQL-compatible wire protocol.

Use this guide to complete all necessary preparations for adding Db2 LUW to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you’ll be able to use the StrongDM Desktop application or CLI to connect.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports IBM Db2 for LUW version 11.1 and higher (Linux, Unix, and Windows editions), including both community and enterprise deployments.

StrongDM is compatible with any clients and tools using the PostgreSQL wire protoc**ol** integration such as:

* `db2` CLI (via pgwire or compatible instances)
* GUI tools (for example, DBeaver, DbVisualizer)
* PostgreSQL drivers (JDBC, libpq, psycopg2, etc.)

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to the Db2 LUW host and port (default `50000`)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Db2 LUW side, you must have the following:

* Running Db2 LUW instance accessible via network
* Database user with privileges on the target database
* Network rules (firewalls or VPCs) allowing access from your StrongDM node

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Db2 LUW as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Db2 LUW**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Db2 LUW datasource
sdm admin datasources add db2luw db2-prod
  --hostname="db2-server.example.org"
  --port=50000
  --database="MYDB"
  --username="db2_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="db2-prod"
  --tags="env=production,team=data"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Db2 LUW resource
resource "sdm_db2luw" "db2_prod" {
  name             = "db2-prod"
  hostname         = "db2-server.example.org"
  port             = 50000
  database         = "MYDB"
  username         = "db2_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "db2-prod"
  tags = {
    env  = "production"
    team = "data"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Db2 LUW datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **Db2 LUW**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Required    | Port to use when connecting to your resource; default port value is **50000**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Database**          | Required    | Database name you would like to connect to using this datasource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **TLS Required**      | Optional    | When selected, requires TLS for connections to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect db2-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect using a PostgreSQL-compatible client. For example:

   ```bash
   psql "$PGDATABASE"
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session was captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# Db2i

Learn how to add Db2i as a datasource in StrongDM.

### Overview

This guide outlines the configuration steps for adding Db2i as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking/gateways-and-relays) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports drivers compatible with Db2i via standard PostgreSQL wire protocol.

Use this guide to complete all necessary preparations for adding Db2i to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. Once complete, you’ll be able to use the StrongDM Desktop application or CLI to connect.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports IBM Db2 i servers running version 7.3 or higher, including both on-premises and hosted deployments.

Db2 i is wire-compatible with PostgreSQL over its native protocol. Accordingly, StrongDM supports any clients leveraging the PostgreSQL wire protocol, including:

* `psql`, DBeaver, DataGrip, and other PostgreSQL-capable tools
* Application drivers/libraries like JDBC, libpq, or psycopg2

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) with network access to your Db2 i host and port (`8471`)
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the Db2i side, you must have the following:

* Running Db2 i instance accessible over network
* Database user with proper access to the target database
* Network configuration (firewall, VPC, and so forth) allowing StrongDM node access

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add Db2i as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **Db2i**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add Db2i datasource
sdm admin datasources add db2i db2i-prod
  --hostname="db2i.example.org"
  --port=8471
  --username="db2i_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="db2i-prod"
  --tags="env=production,team=dbadmin"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create Db2i resource
resource "sdm_db2i" "db2i_prod" {
  name             = "db2i-prod"
  hostname         = "db2i.example.org"
  port             = 8471
  username         = "db2i_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "db2i-prod"
  tags = {
    env  = "production"
    team = "dbadmin"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a Db2i datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | Select **Db2i**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your database resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**              | Required    | Port to use when connecting to your resource; default port value is **8471**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Secret Store**      | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**          | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**          | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**   | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have added your resource in StrongDM, follow these steps to verify that it’s working correctly.

1. Assign yourself access by ensuring that your user or role has access to the resource. In the StrongDM Admin UI, go to **Access** > **Roles**, and verify that the resource is attached to a role you’re in.
2. In the CLI, run `sdm status` to list the available datasources. Confirm that the resource is available.
3. Start a session. For example:

   ```bash
   sdm connect db2i-prod
   ```

   See the CLI Reference documentation for details on [sdm connect](/references/cli/connect).
4. Connect using a PostgreSQL-compatible client. For example:

   ```bash
   psql -h $PGHOST -p $PGPORT -U $PGUSER
   ```
5. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify your session was captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# DocumentDB (single host IAM)

Learn how to add a DocumentDB (single host IAM) database as a resource in StrongDM.

## Overview

This guide outlines the configuration steps for adding a DocumentDB (single host IAM) database as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports Amazon DocumentDB (single host) with IAM-based authentication, allowing you to connect without embedding static credentials.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Amazon DocumentDB deployments that are configured with IAM role authentication for single-host clusters (not replica sets or sharded clusters).

Connections are supported via standard MongoDB protocols. Use tools such as:

* `mongosh`, `mongo` CLI
* MongoDB GUI tools (for example, Compass)
* Application drivers (Node.js, Python, Java, Go) supporting AWS IAM

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach the DocumentDB endpoint
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the DocumentDB side, you must have the following:

* Configured DocumentDB cluster with IAM authentication enabled
* IAM role attached to your compute instance (for example, EC2)
* Proper IAM user added in DocumentDB to match that role

## Resource Setup

Your DocumentDB database should be set up for IAM role authentication prior to using StrongDM to connect to it. This is typically done through attaching an IAM role to an EC2 instance and then adding a user to the DocumentDB database that uses that role.

See the [AWS DocumentDB IAM Guide](https://docs.aws.amazon.com/documentdb/latest/developerguide/iam-identity-auth.html) for more details.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add DocumentDB (single host IAM) as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **DocumentDB (single host IAM)**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add DocumentDB (single host IAM) datasource
sdm admin datasources add documentdbhostiam docdb-prod
  --hostname="docdb.example.org"
  --port=5432
  --region="us-west-2"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="docdb-prod"
  --tags="env=production,team=mongo"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create DocumentDB (single host IAM) resource
resource "sdm_documentdbhostiam" "docdb_prod" {
  name              = "docdb-prod"
  hostname          = "docdb.example.org"
  port              = 5432
  region            = "us-west-2"

  tls_required      = true
  bind_interface    = "127.0.0.1"
  egress_filter     = "tag:env=prod"
  port_override     = 12345
  proxy_cluster_id  = "n-1a2b345c67890123"

  secret_store_id   = "se-e1b2"
  subdomain         = "docdb-prod"
  tags = {
    env  = "production"
    team = "mongo"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a DocumentDB (single host IAM) datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property              | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**      | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**     | Required    | **DocumentDB (single host IAM)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Proxy Cluster**     | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**          | Required    | Hostname for your DocumentDB (single host IAM) resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Port**              | Required    | Port to use when connecting to your DocumentDB (single host IAM) database; default port value is **5432**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Connectivity Mode** | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**        | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**     | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**               | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Region**            | Required    | Region of the resource, such as `us-west-1`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Resource Tags**     | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have created the DocumentDB datasource, you can use the MongoDB Shell to test the connection to DocumentDB.

1. Run the following command to connect to the instance running on your localhost:\
   `mongosh "mongodb://localhost:<PORT>/admin"`

   Example:\
   `mongosh "mongodb://localhost:37018/admin"`
2. Once connected, execute the following command to see the databases:\
   `show dbs`
3. In the StrongDM Admin UI, check **Logs > Queries** (and **Logs > Connections**) to verify that your activities were captured.

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# DocumentDB (Replica Set)

Learn how to add a DocumentDB (Replica Set) database as a resource in StrongDM.

## Overview

This guide outlines the configuration steps for adding a DocumentDB (replica set) database as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports single-mode clusters in replica-set configurations with full TLS enforcement and username/password authentication.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Amazon DocumentDB replica set deployments with TLS enabled and username/password authentication. Both production-grade and development clusters are supported, as long as they are reachable by your StrongDM nodes.

StrongDM is compatible with all MongoDB drivers and client tools that can connect to Amazon DocumentDB via replica set connection strings. Commonly used clients include:

* CLI tools such as `mongosh` (MongoDB Shell)
* GUI clients like MongoDB Compass and DBeaver
* Application drivers (Node.js, Python `pymongo`, Java, Go, .NET, and so forth) that support replica set parameters

## Limitations

* The DocumentDB (replica set) resource type supports username/password authentication only.
* DocumentDB requires TLS to connect.
* DocumentDB does not support connection using service (SRV) records.
* AWS Directory Service integration is not supported.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) hat can reach the DocumentDB replica set endpoints over the network
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the DocumentDB side, you must have the following:

* Properly configured DocumentDB replica set cluster with TLS enabled
* Username and password authentication set up for access (IAM authentication is not supported for replica set connections)
* Network configuration (VPC, subnet, security groups, and firewall rules) that allows inbound access from your StrongDM node’s IP or subnet

## Resource Setup

Your DocumentDB database should be set up for IAM role authentication prior to using StrongDM to connect to it. This is typically done through attaching an IAM role to an EC2 instance and then adding a user to the DocumentDB database that uses that role.

See the [AWS DocumentDB IAM Guide](https://docs.aws.amazon.com/documentdb/latest/developerguide/iam-identity-auth.html) for more details.

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add DocumentDB (replica set) as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **DocumentDB (replica set)**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add DocumentDB (replica set) datasource
sdm admin datasources add documentdbreplicaset docdb-rs-prod
  --hostname="rs0-docdb.example.org:27017,rs1-docdb.example.org:27017"
  --replica-set="rs0"
  --auth-database="admin"
  --username="docdb_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="docdb-rs-prod"
  --tags="env=production,team=api"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create DocumentDB (replica set) resource
resource "sdm_documentdbreplicaset" "docdb_rs_prod" {
  name             = "docdb-rs-prod"
  hostname         = "rs0-docdb.example.org:27017,rs1-docdb.example.org:27017"
  replica_set      = "rs0"
  auth_database    = "admin"
  username         = "docdb_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "docdb-rs-prod"
  tags = {
    env  = "production"
    team = "api"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a DocumentDB (replica set) datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                    | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**            | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**           | Required    | **DocumentDB (replica set)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**           | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                | Required    | Hostnames for your DocumentDB (replica set) resource; [must be accessible](#prerequisites) to a gateway or relay; Host addresses and ports of all replica instances must be included, and separated by commas (for example, `primary0:27017,replica1:27017,replica2:27017`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **Connectivity Mode**       | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**              | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                     | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Authentication Database** | Required    | Name of the DocumentDB authentication database (for example, “admin”)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **Secret Store**            | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**         | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**         | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Replica Set**             | Required    | Name of the Mongo replicaset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Connect to Replica?**     | Required    | Enable to connect to a replica instead of the primary node; defaults to disabled                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Resource Tags**           | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have created the DocumentDB datasource, you can use the MongoDB Shell to test the connection to DocumentDB.

1. Run the following command to connect to the instance running on your localhost:\
   `mongosh "mongodb://localhost:<PORT>/admin"`

   Example:\
   `mongosh "mongodb://localhost:37018/admin"`
2. Once connected, execute the following command to see the databases:\
   `show dbs`

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region


# DocumentDB (Single Host)

Learn how to add a DocumentDB (single host) database as a resource in StrongDM.

## Overview

This guide outlines the configuration steps for adding a DocumentDB (single host) database as a resource in StrongDM.

When the resource is added, StrongDM proxies client connections through a [node](/admin/networking) (gateway, relay, or proxy cluster). This enables centralized access control, credential management, and audit logging. StrongDM supports Amazon DocumentDB (single host) with IAM-based authentication, allowing you to connect without embedding static credentials.

Use this guide to complete all necessary preparations to add this resource to your StrongDM environment; input the correct properties in the Admin UI, CLI, SDKs, or Terraform provider; and test for a successful connection. When done, you will be able to use the StrongDM Desktop application or CLI to connect.

For general information about how to add a database as a resource in StrongDM, see our main guide, [Add a Datasource](/admin/resources/datasources).

## Supported Versions and Clients

StrongDM supports Amazon DocumentDB (single host) clusters that use username/password authentication with TLS enabled. Both production and development environments are supported, as long as the cluster endpoint is reachable by your StrongDM nodes.

StrongDM is compatible with any MongoDB-compatible client or driver that can connect to Amazon DocumentDB. Commonly used clients include:

* CLI tools such as `mongosh` (MongoDB Shell)
* GUI clients like MongoDB Compass or DBeaver
* Application drivers for Node.js, Python (`pymongo`), Java, Go, .NET, and others that support the MongoDB wire protocol

## Limitations

* The DocumentDB (single host) resource type supports username/password authentication only. It does not support IAM authentication. The separate [DocumentDB (single host IAM)](/admin/resources/datasources/documentdb-single-host) resource type is also available.
* DocumentDB requires TLS to connect.
* DocumentDB does not support connection using service (SRV) records.
* AWS Directory Service integration is not supported.

## Prerequisites

To add your resource in StrongDM, you need to meet several technical and configuration prerequisites. Please ensure that the following requirements are met.

In StrongDM, you must have the following:

* Administrator permission level
* At least one operational StrongDM node (gateway, relay, or proxy cluster) that can reach the DocumentDB endpoint
* If using secrets management tools for storing your database credentials, a Secret Store configured in StrongDM

{% hint style="info" %}
To verify that the resource is accessible by the node, log in to the gateway or relay and use Netcat: `nc -zv <HOSTNAME> <PORT>` (in this example, `nc -zv testdb-01.fancy.org 3306`). If your gateway server can connect to this hostname, proceed.

Netcat is a tool for checking various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The command in the aforementioned example use "-z" to check for listeners without sending data and "-v" to show verbose output. If you don't have Netcat, you can install the Netcat package with whatever package manager you are using, such as "apt-get install netcat".
{% endhint %}

#### On the DocumentDB side, you must have the following:

* Properly configured DocumentDB (single host) cluster with username/password authentication
* TLS enabled on the DocumentDB instance
* Network configuration (VPC, security groups, firewalls) that allows StrongDM nodes to connect

## Resource Management in StrongDM

After all prerequisites and prep work is done, you are ready to add the resource to StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.

{% tabs %}
{% tab title="Admin UI" %}
**Set up and Manage With the Admin UI**

If using the Admin UI to add DocumentDB (single host) as a resource to StrongDM, use the following steps.

1. Log in to the StrongDM Admin UI.
2. Go to **Resources** > **Managed Resources**.
3. Click **Add Resource**.
4. For **Resource Type**, select **DocumentDB (single host)**.
5. Complete all required [configuration properties](#configuration-properties) for your selected datasource type.
6. Click **Create** to save the resource.
7. Click the resource name to view status, diagnostic information, and setting details.
   {% endtab %}

{% tab title="CLI" %}
**Set up and Manage With the CLI**

This section provides an example of how to add the resource using the StrongDM CLI. For more information and examples, please see the [CLI Reference](/references/cli) documentation.

```
# Add DocumentDB (single host) datasource
sdm admin datasources add documentdbhost docdb-prod
  --hostname="docdb-single.example.org"
  --port=27017
  --auth-database="admin"
  --username="docdb_user"
  --password="secret"
  --tls-required
  --bind-interface="127.0.0.1"
  --egress-filter="tag:env=prod"
  --port-override="12345"
  --proxy-cluster-id="n-1a2b345c67890123"
  --secret-store-id="se-e1b2"
  --subdomain="docdb-prod"
  --tags="env=production,team=mongo"
```

{% endtab %}

{% tab title="Terraform" %}
**Set up and Manage With Terraform**

This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the [Terraform provider](https://github.com/strongdm/terraform-provider-sdm) documentation.

```
# Install StrongDM provider
terraform {
  required_providers {
    sdm = {
      source  = "strongdm/sdm"
      version = "16.5.0"
    }
  }
}

# Configure StrongDM provider
provider "sdm" {
  # Add API access key and secret key from Admin UI
  api_access_key = "njjSn...5hM"
  api_secret_key = "ziG...="
}

# Create DocumentDB (single host) resource
resource "sdm_documentdbhost" "docdb_prod" {
  name             = "docdb-prod"
  hostname         = "docdb-single.example.org"
  port             = 27017
  auth_database    = "admin"
  username         = "docdb_user"
  password         = "secret"

  tls_required     = true
  bind_interface   = "127.0.0.1"
  egress_filter    = "tag:env=prod"
  port_override    = 12345
  proxy_cluster_id = "n-1a2b345c67890123"

  secret_store_id  = "se-e1b2"
  subdomain        = "docdb-prod"
  tags = {
    env  = "production"
    team = "mongo"
  }
}
```

{% endtab %}

{% tab title="SDKs" %}
**Set up and manage with SDKs**

In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.

| Language      | Reference                                                                | GitHub                                                                 | Examples                                                                        |
| ------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Go            | [pkg.go.dev](https://pkg.go.dev/github.com/strongdm/strongdm-sdk-go/v17) | [strongdm-sdk-go](https://github.com/strongdm/strongdm-sdk-go)         | [Go SDK Examples](https://github.com/strongdm/strongdm-sdk-go-examples)         |
| Java          | [javadoc](https://strongdm.github.io/strongdm-sdk-java-docs/)            | [strongdm-sdk-java](https://github.com/strongdm/strongdm-sdk-java)     | [Java SDK Examples](https://github.com/strongdm/strongdm-sdk-java-examples)     |
| Python        | [pdocs](https://strongdm.github.io/strongdm-sdk-python-docs/)            | [strongdm-sdk-python](https://github.com/strongdm/strongdm-sdk-python) | [Python SDK Examples](https://github.com/strongdm/strongdm-sdk-python-examples) |
| Ruby          | [RubyDoc](https://www.rubydoc.info/gems/strongdm)                        | [strongdm-sdk-ruby](https://github.com/strongdm/strongdm-sdk-ruby)     | [Ruby SDK Examples](https://github.com/strongdm/strongdm-sdk-ruby-examples)     |
| {% endtab %}  |                                                                          |                                                                        |                                                                                 |
| {% endtabs %} |                                                                          |                                                                        |                                                                                 |

## **Configuration Properties**

The following configuration properties are required to define a DocumentDB (single host) datasource in StrongDM. These settings control how StrongDM connects to the database, authenticates the connection, and optionally uses encryption or secret management. Each property must be correctly configured to ensure connectivity and access enforcement through StrongDM.

| Property                    | Requirement | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Display Name**            | Required    | Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Resource Type**           | Required    | **DocumentDB (single host)**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Proxy Cluster**           | Required    | Defaults to "None (use gateways)"; if using [proxy clusters](/admin/networking/proxy-clusters), select the appropriate cluster to proxy traffic to this resource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **Hostname**                | Required    | Hostname for your DocumentDB (single host) resource; [must be accessible](#prerequisites) to a gateway or relay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Port**                    | Required    | Port to use when connecting to your DocumentDB (single host) resource; default port value is **27017**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Connectivity Mode**       | Required    | Select either **Virtual Networking Mode**, which lets users connect to the resource with a software-defined, IP-based network; or **Loopback Mode**, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) enabled for your organization                                                                                                                                                                                                                                                                                                                                    |
| **IP Address**              | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if **Loopback Mode** is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, `127.0.0.1`); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if [Virtual Networking Mode](/admin/clients/client-networking/virtual-networking-mode) and/or [multi-loopback mode](/admin/clients/client-networking/loopback-ip-ranges) is enabled for your organization |
| **Port Override**           | Optional    | If **Virtual Networking Mode** is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if **Loopback Mode** is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the [Port Overrides settings](/admin/resources/port-overrides)                                                         |
| **DNS**                     | Optional    | If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, `k8s.my-organization-name`) instead of the bind address that includes IP address and port (for example, `100.64.100.100:5432`)                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Authentication Database** | Required    | Name of the DocumentDB authentication database (for example, “admin”).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Secret Store**            | Optional    | Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); learn more about [Secret Store](#secret-store-options) options                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Username**                | Required    | Username to utilize when connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **Password**                | Required    | Password for the user connecting to this datasource; displays when Secret Store integration is not configured for your organization or when StrongDM serves as the secret store                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Username (path)**         | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Password (path)**         | Required    | Path to the secret in your Secret Store location (for example, `path/to/credential?key=optionalKeyName` where key argument is optional); required when using a non-StrongDM Secret Store type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Resource Tags**           | Optional    | Datasource [Tags](/references/cli/tags) consisting of key-value pairs `<KEY>=<VALUE>` (for example, `env=dev`)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### Secret Store options

By default, datasource credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.

Non-StrongDM options appear in the **Secret Store** dropdown if they are created under **Network** > **Secret Stores**. When you select another Secret Store type, its unique properties display. For more details, see [Configure Secret Store Integrations](/admin/access/secret-stores).

### Resource status

After a resource is created, the Admin UI displays that resource as unhealthy until the healthchecks run successfully. When the resource is ready, the **Health** icon indicates a positive, green status.

When the resource does not display a positive status, click the resource name to go to the **Diagnostics** tab and check for errors.

## Test the Connection

After you have created the DocumentDB datasource, you can use the MongoDB Shell to test the connection to DocumentDB.

1. Run the following command to connect to the instance running on your localhost:\
   `mongosh "mongodb://localhost:<PORT>/admin"`

   Example:\
   `mongosh "mongodb://localhost:37018/admin"`
2. Once connected, execute the following command to see the databases:\
   `show dbs`

When these steps succeed, you’re ready to connect to your resource through StrongDM.

### Help

If you encounter issues, please consult the [StrongDM Help Center](https://help.strongdm.com/hc/en-us).

Be prepared to provide the following information to StrongDM Support, so that they can inspect logs and confirm node and resource health:

* Resource name or ID
* CLI error output or logs
* Node name and region




---

[Next Page](/llms-full.txt/1)

