# Rancher

Rancher is a Kubernetes management platform that simplifies the deployment and management of clusters across any environment, enhancing flexibility, scalability, and resource efficiency.

{% hint style="success" %}
For organizations requiring a more robust solution, SUSE Rancher Prime offers a hardened and fully-supported enterprise-grade experience.
{% endhint %}

By integrating with this ecosystem, Apono helps you discover your Kubernetes resources and securely manage access directly through your Rancher instance.

***

### Prerequisite

<table><thead><tr><th width="221">Item</th><th>Description</th></tr></thead><tbody><tr><td><strong>Rancher Admin Access</strong></td><td>User account with admin permissions to create a new user account</td></tr></tbody></table>

***

### Create a dedicated Apono user

Follow these steps to create a dedicated user for Apono:

1. In Rancher, [create a custom role](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/manage-role-based-access-control-rbac/custom-roles#creating-a-custom-role) with a user-friendly name, such as *apono-provisionser-user-role*.

{% hint style="info" %}
You must create a global role (**Create Global Role**) that grants the following resource:

* **Verbs**: *list*
* **Resource**: *users*
* **API Groups**: *management.cattle.io*
  {% endhint %}

2. Locate the new role.
3. Click **☰ > Edit YAML**.
4. Above the `metadata` property, add the `cluster-owner` role.

```
inheritedClusterRoles:
  - cluster-owner
```

{% hint style="success" %}
Assigning the `cluster-owner` role via `inheritedClusterRoles` does not provide access to the `local` cluster (the Rancher control plane cluster). This role inheritance applies only to downstream user clusters and excludes Rancher’s internal management plane.
{% endhint %}

5. Click **Save**.
6. [Create a local user](https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/create-local-users#adding-local-users) with a user-friendly name, such as *apono-provisioner-user.*
7. Assign the new dedicated user (apono-provisioner-user) to the new local user.
8. Logged in as the new dedicated user (apono-provisioner-user), [create an API key](https://ranchermanager.docs.rancher.com/reference-guides/user-settings/api-keys#creating-an-api-key) and copy the **Access Key** and **Secret Key**.
9. Create a [secret](https://docs.apono.io/docs/connectors-and-secrets/apono-integration-secret) for the dedicated user to use during the Apono integration setup.\
   \
   Use the values from step **7** to generate the secret.

```
"access_key": "RANCHER_ACCESS_KEY",
"secret_key": "RANCHER_SECRET_KEY"
```

You can now [integrate Rancher](#integrate-rancher).

***

### Integrate Rancher

<figure><img src="https://1094436629-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv6MBfUGvblSdAz31yJXm%2Fuploads%2Fgit-blob-f43788c63d080fc67f659da4bf21fc2f9c5cb5a5%2Fintegrate-rancher.png?alt=media" alt="" width="563"><figcaption><p>Rancher tile</p></figcaption></figure>

{% hint style="success" %}
You can also use the steps below to integrate with Apono using Terraform. In step **10**, instead of clicking **Confirm**, follow the **Are you integrating with Apono using Terraform?** guidance.
{% endhint %}

Follow these steps to complete the integration:

1. On the [**Catalog**](https://app.apono.io/catalog?search=rancher) tab, click **Rancher**. The **Connect Integration** page appears.
2. Under **Discovery**, click **Next**. The **Apono connector** section expands.
3. From the dropdown menu, select a connector.

{% hint style="success" %}
If the desired connector is not listed, click **+ Add new connector** and follow the instructions for creating a connector ([AWS](https://docs.apono.io/docs/aws-environment/apono-connector-for-aws), [Azure](https://docs.apono.io/docs/azure-environment/apono-connector-for-azure), [GCP](https://docs.apono.io/docs/gcp-environment/apono-connector-for-gcp), [Kubernetes](https://docs.apono.io/docs/kubernetes-environment/apono-connector-for-kubernetes)).
{% endhint %}

4. Click **Next**. The **Integration Config** section expands.
5. Define the **Integration Config** settings.

   <table><thead><tr><th width="188">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Integration Name</strong></td><td>Unique, alphanumeric, user-friendly name used to identify the integration when constructing an access flow</td></tr><tr><td><strong>Host</strong></td><td>Hostname of the Rancher server</td></tr><tr><td><strong>Port</strong></td><td>Rancher port value</td></tr><tr><td><strong>Certificate Authority (optional)</strong></td><td><p>(Optional) Ensures that the Kubernetes API server you are communicating with is trusted and authentic</p><p>Leave this field blank to connect the cluster where the Apono connector is deployed.</p></td></tr><tr><td><strong>Rancher UI URL (optional)</strong></td><td><p>(Optional) URL of your Rancher UI</p><p>This URL must be reachable from all the hosts that you add.</p></td></tr></tbody></table>
6. Click **Next**. The **Secret Store** section expands.
7. [Associate the secret or credentials](https://docs.apono.io/docs/connectors-and-secrets/apono-integration-secret).
8. Click **Next**. The **Get more with Apono** section expands.
9. Define the **Get more with Apono** settings.

   <table><thead><tr><th width="186">Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>Credential Rotation</strong></td><td><p>(Optional) Number of days after which the database credentials must be rotated</p><p>Learn more about the <a href="../../architecture-and-security/credentials-rotation-policy">Credentials Rotation Policy</a>.</p></td></tr><tr><td><strong>User cleanup after</strong> <strong>access is revoked (in days)</strong></td><td><p>(Optional) Defines the number of days after access has been revoked that the user should be deleted</p><p><br>Learn more about <a href="../../architecture-and-security/periodic-user-cleanup-and-deletion">Periodic User Cleanup &#x26; Deletion</a>.</p></td></tr><tr><td><strong>Custom Access Details</strong></td><td>(Optional) Instructions explaining how to access this integration's resources<br><br>Upon accessing an integration, a message with these instructions will be displayed to end users in the User Portal. The message may include up to <strong>400 characters</strong>.<br><br>To view the message as it appears to end users, click <strong>Preview</strong>.</td></tr><tr><td><strong>Integration Owner</strong></td><td><p>(Optional) Fallback approver if no <a href="../../access-flows/dynamic-access-management/resource-and-integration-owners">resource owner</a> is found<br><br>Follow these steps to define one or several integration owners:</p><ol><li>From the <strong>Attribute</strong> dropdown menu, select <strong>User</strong> or <strong>Group</strong> under the relevant identity provider (IdP) platform.</li><li>From the <strong>Value</strong> dropdown menu, select one or multiple users or groups.</li></ol><p><br><strong>NOTE</strong>: When <strong>Resource Owner</strong> is defined, an <strong>Integration Owner</strong> must be defined.</p></td></tr><tr><td><strong>Resource Owner</strong></td><td><p>(Optional) Group or role responsible for managing access approvals or rejections for the resource<br><br>Follow these steps to define one or several <a href="../../access-flows/dynamic-access-management/resource-and-integration-owners">resource owners</a>:</p><ol><li>Enter a <strong>Key name</strong>. This value is the name of the tag created in your cloud environment.</li><li>From the <strong>Attribute</strong> dropdown menu, select an attribute under the IdP platform to which the key name is associated.<br><br>Apono will use the value associated with the key (tag) to identify the resource owner. When you update the membership of the group or role in your IdP platform, this change is also reflected in Apono.</li></ol><p><br><strong>NOTE</strong>: When this setting is defined, an <strong>Integration Owner</strong> must also be defined.</p></td></tr></tbody></table>
10. Click **Confirm**.

<details>

<summary>💡Are you integrating with Apono using Terraform?</summary>

If you want to integrate with Apono using Terraform, follow these steps instead of clicking **Confirm**:

1. At the top of the screen, click **View as Code**. A modal appears with the completed Terraform configuration code.
2. Click to copy the code.
3. Make any additional edits.
4. Deploy the code in your Terraform.

Refer to [Integration Config Metadata](https://docs.apono.io/metadata-for-integration-config/integration-metadata/rancher) for more details about the schema definition.

</details>

Now that you have completed this integration, you can [create access flows](https://docs.apono.io/docs/access-flows/access-flows) that grant permission to your Rancher instance.
