> ## Documentation Index
> Fetch the complete documentation index at: https://www.c1.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up an OpenSearch connector

> C1 provides identity governance for OpenSearch. Integrate your OpenSearch instance with C1 to run user access reviews (UARs) and enable just-in-time access requests.

<Warning>
  **This connector is in beta.** This means it's undergoing ongoing testing and development while we gather feedback, validate functionality, and improve stability. Beta connectors are generally stable, but they may have limited feature support, incomplete error handling, or occasional issues.

  We recommend closely monitoring workflows that use this connector and contacting our Support team with any issues or feedback.
</Warning>

## Capabilities

| Resource | Sync                                                          | Provision |
| :------- | :------------------------------------------------------------ | :-------- |
| Accounts | <Icon icon="circle-info" />                                   |           |
| Groups   | <Icon icon="circle-info" />                                   |           |
| Roles    | <Icon icon="square-check" iconType="solid" color="#c937ae" /> |           |

<Icon icon="circle-info" /> This connector pulls account and group information from another connector. You'll configure this relationship when setting up the connector.

## Gather OpenSearch credentials

Configuring the connector requires you to pass in credentials generated in OpenSearch. Gather these credentials before you move on.

<Warning>
  A user with the **Owner** or **Admin** role (or a custom user role with the **Edit Configuration** user right) in OpenSearch must perform this task.
</Warning>

To set up the connector, you'll need:

* **Your OpenSearch server address**

  Use your OpenSearch cluster endpoint (for example, [https://your-opensearch-cluster.com:9200](https://your-opensearch-cluster.com:9200)). For cloud deployments, use the provided endpoint from your OpenSearch service provider.

* **An OpenSearch username and password**

  The Opensearch account used to configure the connector must have OpenSearch cluster administrator access and access to the OpenSearch Dashboards or API for user management.

If your OpenSearch cluster uses a custom certificate, you'll also need:

* **A (PEM-encoded) CA certificate or the path to a CA certificate**

**Done.** Next, move on to the connector configuration instructions.

## Configure the OpenSearch connector

<Warning>
  To complete this task, you'll need:

  * The **Connector Administrator** or **Super Administrator** role in C1
  * Access to the set of OpenSearch credentials generated by following the instructions above
</Warning>

<Tabs>
  <Tab title="Cloud-hosted">
    **Follow these instructions to use a built-in, no-code connector hosted by C1.**

    <Steps>
      <Step>
        In C1, navigate to **Integrations** > **Connectors** and click **Add connector**.
      </Step>

      <Step>
        Search for **OpenSearch** and click **Add**.
      </Step>

      <Step>
        Choose how to set up the new OpenSearch connector:

        * Add the connector to a currently unmanaged app (select from the list of apps that were discovered in your identity, SSO, or federation provider that aren't yet managed with C1)

        * Add the connector to a managed app (select from the list of existing managed apps)

        * Create a new managed app
      </Step>

      <Step>
        Set the owner for this connector. You can manage the connector yourself, or choose someone else from the list of C1 users. Setting multiple owners is allowed.

        If you choose someone else, C1 will notify the new connector owner by email that their help is needed to complete the setup process.
      </Step>

      <Step>
        Click **Next**.
      </Step>

      <Step>
        Find the **Settings** area of the page and click **Edit**.
      </Step>

      <Step>
        In the **Address** field, enter your OpenSearch cluster endpoint (for example, [https://your-opensearch-cluster.com:9200](https://your-opensearch-cluster.com:9200)) or the endpoint provided by your OpenSearch service provider (if yours is a cloud deployment).
      </Step>

      <Step>
        Enter the OpenSearch account username and password into the next two fields.
      </Step>

      <Step>
        In the **User match key** field, enter the value (such as `name` or `id`) that will tell the connector which piece of data to use to match OpenSearch accounts with the accounts synced from the shared identity source. The default value is `email`.
      </Step>

      <Step>
        **Optional.** If configuring this connector for use with a development or testing environment, click to enable **Insecure Skip Verify**. Do not use this option for production environments.

        If this option is not selected, you must include a CA certificate. If insecure verification skip is enabled, you do not need to provide a certificate.
      </Step>

      <Step>
        If needed (see above), upload a **CA certificate**. The certificate must be PEM-encoded.

        CA certificates are used for production TLS verification.
      </Step>

      <Step>
        Click **Save**.
      </Step>

      <Step>
        In the **Shared identity source** area of the page, click **Edit**.
      </Step>

      <Step>
        Select the connector from which you want to pull identities.
      </Step>

      <Step>
        **Optional.** Limit the identities pulled from the connector you selected to only those with a certain entitlement by setting the entitlement.
      </Step>

      <Step>
        Click **Save**.
      </Step>

      <Step>
        The connector's label changes to **Syncing**, followed by **Connected**. You can view the logs to ensure that information is syncing.
      </Step>
    </Steps>

    **Done.** Your OpenSearch connector is now pulling access data into C1.
  </Tab>

  <Tab title="Self-hosted">
    **Follow these instructions to use the OpenSearch connector, hosted and run in your own environment.**

    When running in service mode on Kubernetes, a self-hosted connector maintains an ongoing connection with C1, automatically syncing and uploading data at regular intervals. This data is immediately available in the C1 UI for access reviews and access requests.

    ### Resources

    * [GitHub repository](https://github.com/conductorone/baton-opensearch): Access the source code, report issues, or contribute to the project.

    ### Step 1: Set up a new OpenSearch connector

    <Steps>
      <Step>
        In C1, navigate to **Integrations** > **Connectors** > **Add connector**.
      </Step>

      <Step>
        Search for **Baton** and click **Add**.
      </Step>

      <Step>
        Choose how to set up the new OpenSearch connector:

        * Add the connector to a currently unmanaged app (select from the list of apps that were discovered in your identity, SSO, or federation provider that aren't yet managed with C1)

        * Add the connector to a managed app (select from the list of existing managed apps)

        * Create a new managed app
      </Step>

      <Step>
        Set the owner for this connector. You can manage the connector yourself, or choose someone else from the list of C1 users. Setting multiple owners is allowed.

        If you choose someone else, C1 will notify the new connector owner by email that their help is needed to complete the setup process.
      </Step>

      <Step>
        Click **Next**.
      </Step>

      <Step>
        In the **Settings** area of the page, click **Edit**.
      </Step>

      <Step>
        Click **Rotate** to generate a new Client ID and Secret.

        Carefully copy and save these credentials. We'll use them in Step 2.
      </Step>
    </Steps>

    ### Step 2: Create Kubernetes configuration files

    Create two Kubernetes manifest files for your OpenSearch connector deployment:

    #### Secrets configuration

    ```yaml expandable theme={"theme":{"light":"css-variables","dark":"css-variables"}}
    # baton-opensearch-secrets.yaml
    apiVersion: v1
    kind: Secret
    metadata:
      name: baton-opensearch-secrets
    type: Opaque
    stringData:
      # C1 credentials
      BATON_CLIENT_ID: <C1 client ID>
      BATON_CLIENT_SECRET: <C1 client secret>
      
      # OpenSearch credentials
      BATON_OPENSEARCH_ADDRESS: <Your OpenSearch server address>
      BATON_OPENSEARCH_USERNAME: <Username for an OpenSearch account with security API access>
      BATON_OPENSEARCH_PASSWORD: <Password for the OpenSearch account>
      BATON_OPENSEARCH_USER_MATCH_KEY: <Field name for matching users, such as `email`, `name`, or `id` (defaults to `email`)>

      # Optional: include these credentials to perform TLS certification validation
      BATON_OPENSEARCH_INSECURE_SKIP_VERIFY: true
      BATON_OPENSEARCH_CA_CERT_PATH: <Path to PEM-encoded certificate file>
    ```

    See the connector's README or run `--help` to see all available configuration flags and environment variables.

    #### Deployment configuration

    ```yaml expandable theme={"theme":{"light":"css-variables","dark":"css-variables"}}
    # baton-opensearch.yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: baton-opensearch
      labels:
        app: baton-opensearch
    spec:
      selector:
        matchLabels:
          app: baton-opensearch
      template:
        metadata:
          labels:
            app: baton-opensearch
            baton: true
            baton-app: opensearch
        spec:
          containers:
          - name: baton-opensearch
            image: ghcr.io/conductorone/baton-opensearch:latest
            imagePullPolicy: IfNotPresent
            env:
            - name: BATON_HOST_ID
              value: baton-opensearch
            envFrom:
            - secretRef:
                name: baton-opensearch-secrets
    ```

    ### Step 3: Deploy the connector

    <Steps>
      <Step>
        Create a namespace in which to run C1 connectors (if desired), then apply the secret config and deployment config files.
      </Step>

      <Step>
        Check that the connector data uploaded correctly. In C1, click **Apps**. On the **Managed apps** tab, locate and click the name of the application you added the OpenSearch connector to. OpenSearch data should be found on the **Entitlements** and **Accounts** tabs.
      </Step>
    </Steps>

    **Done.** Your OpenSearch connector is now pulling access data into C1.
  </Tab>
</Tabs>
