---
title: Restrict OpenSharing recipient access using IP access lists (Databricks-to-Open sharing)
description: Learn about how to use OpenSharing IP access lists as an additional way to control recipient access to shared data.
canonical_url: https://docs.databricks.com/aws/en/opensharing/access-list
---

# Restrict OpenSharing recipient access using IP access lists (Databricks-to-Open sharing)

This article describes how data providers can assign IP access lists to control recipient access to shared data.

If you, as a data provider, are using the [Databricks-to-Open sharing protocol](https://docs.databricks.com/aws/en/opensharing/index.md#open), you can limit a recipient to a restricted set of IP addresses when they access data that you share. This list is independent of [Workspace IP access lists](https://docs.databricks.com/api/workspace/ipaccesslists). Only allow lists are supported.

The IP access list affects the following:

* OpenSharing OSS Protocol REST API access
* OpenSharing activation URL access
* OpenSharing credential file download

> [!NOTE]
>
> When the provider has [SecureConnect](https://docs.databricks.com/aws/en/opensharing/secureconnect-provider.md) enabled, the IP access list also enforces access to shared data storage. Without SecureConnect, storage URLs are reachable from any client IP, regardless of the IP access list.

Each recipient supports a maximum of 100 IP/CIDR values, where one CIDR counts as a single value. Only IPv4 addresses are supported.

## <a id="assign-an-ip-access-list-to-a-recipient" />Assign an IP access list to a recipient

You can assign an IP access list to a recipient using Catalog Explorer or the Databricks Unity Catalog CLI.

**Permissions required**: If you are assigning an IP access list when you create a recipient, you must have the `CREATE RECIPIENT` privilege. If you are assigning an IP access list to an existing recipient, you must be the recipient object owner.

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/aws/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, click **Recipients** and select the recipient.

4. On the **IP access list** tab, click **Add IP address/CIDRs** for each IP address (in single IP address format, like 8.8.8.8) or range of IP addresses (in CIDR format, like 8.8.8.4/10).

### CLI

To add an IP access list when you create a new recipient, run the following command using the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/index.md), replacing `<recipient-name>` and the IP address values.

```bash
databricks recipients create \
--json=-'{
  "name": "<recipient-name>",
  "authentication_type": "<authentication-type>",
  "ip_access_list": {
    "allowed_ip_addresses": [
      "8.8.8.8",
      "8.8.8.4/10"
    ]
  }
}'
```

To add an IP access list to an existing recipient, run the following command, replacing `<recipient-name>` and the IP address values.

```bash
databricks recipients update \
--json='{
  "name": "<recipient-name>",
  "ip_access_list": {
    "allowed_ip_addresses": [
      "8.8.8.8",
      "8.8.8.4/10"
    ]
  }
}'
```

## Remove an IP access list

You can remove a recipient's IP access list using Catalog Explorer or the Databricks Unity Catalog CLI. If you remove all IP addresses from the list, the recipient can access the shared data from anywhere.

**Permissions required**: Recipient object owner.

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/aws/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, click **Recipients** and select the recipient.

4. On the **IP access list** tab, click the trash can icon next to the IP address you want to delete.

### CLI

Use the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/index.md) to pass in an empty IP access list:

```bash
databricks recipients update \
--json='{
  "name": "<recipient-name>",
  "ip_access_list": {}
}'
```

## View a recipient's IP access list

You can view a recipient's IP access list using Catalog Explorer, the Databricks Unity Catalog CLI, or the `DESCRIBE RECIPIENT` SQL command in a notebook or Databricks SQL query.

**Permissions required**: Metastore admin, user with the `USE RECIPIENT` privilege, or the recipient object owner.

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/aws/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/aws/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, click **Recipients** and select the recipient.

4. View allowed IP addresses on the **IP access list** tab.

### CLI

Run the following command using the [Databricks CLI](https://docs.databricks.com/aws/en/dev-tools/cli/index.md).

```bash
databricks recipients get <recipient-name>
```

### SQL

Run the following command in a notebook or the Databricks SQL query editor.

```sql
DESCRIBE RECIPIENT <recipient-name>;
```

## Audit logging for OpenSharing IP access lists

The following operations trigger audit logs related to IP access lists:

* Recipient management operations: create, update
* Denial of access to any of the OpenSharing OSS Protocol REST API calls
* Denial of access to OpenSharing activation URL (Databricks-to-Open sharing only)
* Denial of access to OpenSharing credential file download (Databricks-to-Open sharing only)

To learn more about how to enable and read audit logs for OpenSharing, see [Audit and monitor data sharing](https://docs.databricks.com/aws/en/opensharing/audit-logs.md).
