# Multiple Vaults Integration

<figure><img src="https://3357255970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb7weUpu7VBcMnESSH8vG%2Fuploads%2FKMKS3wJ0EcGHLcXmc800%2FMulitple-Vaults-Integration.jpg?alt=media&#x26;token=0147cc33-89f5-46f2-806c-f089e4f27523" alt=""><figcaption></figcaption></figure>

## Overview

Keeper Connection Manager can pull secrets from different vaults or different shared folders of the Keeper Vault, via the Keeper Secrets Manager integration. There are two main ways which KCM can connect to multiple Keeper Vaults for retreiving secrets:

1. Connection Groups can be assigned to different secrets manager configurations. Any connection defined within a Connection Group will retrieve secrets from the group assignment.
2. Users can be assigned Secrets Manager configurations, and connections can retrieve secrets from configurations defined by each individual user profiles. This allows different users to connect to the same set of connections with their own set of secrets.

## Connection Groups

Each Keeper Connection Manager "Connection Group" can use a Keeper Secrets Manager configuration for the connections in the group. When this is activated, each connection group will look for records in the corresponding Secrets Manager configuration to retrieve secrets and replace tokens in the connection settings.

In order to use a Keeper Secrets Manager with a Connection Group, enter a Keeper Secrets Manager One-Time Access Token, or Configuration into the "KSM Service Configuration" field of the connection group form.

![Connection Group settings](https://3357255970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb7weUpu7VBcMnESSH8vG%2Fuploads%2FsPTjp7HHROPWYxRMFwPy%2Fimage.png?alt=media\&token=6d877793-d280-4471-897b-c1966fbfe3d3)

All connections created within this Connection Group will then use the Secrets Manager configuration defined to retrieve secrets when establishing connections, instead of using the root level Secrets Manager configuration.

The Secrets Manager configuration can come from the same vault, or any other vault.

See the [Dynamic Tokens documentation](https://docs.keeper.io/en/keeper-connection-manager/vault-integration/dynamic-tokens) for more information on the available tokens and how to use them.

{% hint style="info" %}
Note: A Secrets Manager configuration must be established in the baseline configuration as a default to use connection group Secrets Manager configurations.  See the [documentation ](https://docs.keeper.io/en/keeper-connection-manager/vault-integration/installation)for information on setting up a Secrets Manager configuration.
{% endhint %}

## User-Specified Configuration

Each Keeper Connection Manager **User** profile can be assigned to a Keeper Secrets Manager configuration for any connection. When the connection is updated to allow user-specific vaults, Keeper Connection Manager will pull the secret from the user's corresponding configuration. This feature allows multiple users to share the same set of connections, using secrets that originate from the user's own vault.

In order to use user-specific secrets manager connections, the Keeper Connection Manager installation needs to have the feature enabled. It is disabled by default.

### **Docker Install Method**

An additional environmental variable must be added to the keeper/guacamole Docker image in your `docker-compose.yml` file.

`KSM_ALLOW_USER_CONFIG`

For example:

{% code title="docker-compose.yml" %}

```
            ....
            MYSQL_DATABASE: "guacamole_db"
            MYSQL_USERNAME: "guacamole_user"
            KSM_CONFIG: "XXX"
            ....
            ....
            KSM_ALLOW_USER_CONFIG: "true"
            ....
```

{% endcode %}

In the Edit User screen, fill in the KSM Service Configuration that has been set up for that user. This is also available to each user to set up the KSM Service Configuration for themselves.

<figure><img src="https://3357255970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb7weUpu7VBcMnESSH8vG%2Fuploads%2FTF3iSyDUWMTKmWkTU1V7%2FScreen%20Shot%202023-01-23%20at%207.52.51%20PM.png?alt=media&#x26;token=40d4f33c-aaf4-4536-b11a-638488f36411" alt=""><figcaption><p>User-specific KSM Configuration</p></figcaption></figure>

When creating or editing a connection, there is a field which appears called "Allow user-provided KSM configuration".

<figure><img src="https://3357255970-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb7weUpu7VBcMnESSH8vG%2Fuploads%2FMv1WYhshaQ5MBWvK1hfj%2FScreen%20Shot%202023-01-23%20at%208.07.39%20PM.png?alt=media&#x26;token=9da11603-345e-4882-9ade-fa4e01133af4" alt=""><figcaption><p>User-provided KSM configuration</p></figcaption></figure>

When this option is selected, Keeper Connection Manager will look for corresponding secrets in the user's vault corresponding to the Keeper Secrets Manager configuration.&#x20;

### Order of Precedence

Keeper Connection Manager will always use the base (or Connection Group) secrets if any are applicable. It will only use user-provided secrets if there isn't an admin-provided secret for the same, to ensure that users cannot override the intent of the admin.
