cancel
Showing results for 
Search instead for 
Did you mean: 
Knowledge Sharing Hub
Dive into a collaborative space where members like YOU can exchange knowledge, tips, and best practices. Join the conversation today and unlock a wealth of collective wisdom to enhance your experience and drive success.
cancel
Showing results for 
Search instead for 
Did you mean: 

Understanding Databricks Workspace IP Access List

Ajay-Pandey
Esteemed Contributor III

What is a Databricks Workspace IP Access List?

The Databricks Workspace IP Access List is a security feature that allows administrators to control access to the Databricks workspace by specifying which IP addresses or IP ranges are allowed or denied access. This feature is crucial for enhancing the security of your Databricks environment, especially when working in sensitive or regulated industries

Key Features

  • Allows configuration of allow lists and block lists.
  • Supports IPv4 and IPv6 address ranges.
  • Ensures that unauthorized users outside the specified IP ranges cannot access the workspace.

Why Do We Use It?

The primary reason for implementing an IP access list is security. Here are some scenarios where this feature is indispensable:

  1. Restrict Unauthorized Access: By allowing only known IP ranges, you reduce the risk of unauthorized access to your data and computations.
  2. Compliance with Regulations: Many industries, such as finance and healthcare, require strict access controls to comply with data protection regulations.
  3. Network Segmentation: Organizations often want to ensure that only users within their corporate network or VPN can access sensitive data and resources.
  4. Auditing and Monitoring: Helps identify and block unexpected IP addresses attempting to access the workspace.

How Does It Operate?

  1. Definition of Rules: Administrators define a list of IP addresses or CIDR ranges to either allow or block access to the workspace.
  2. Priority of Rules: Allow rules take precedence over deny rules. If no allow rules match, access is denied by default.
  3. Propagation: Once configured, the rules are applied to all endpoints of the Databricks workspace, including the web UI, REST APIs, and notebooks.
  4. Enforcement: Any attempt to access the workspace from an IP not on the allow list will be blocked.

Real-World Use Case

Scenario: Securing Access to a Healthcare Analytics Workspace

A healthcare organization uses Databricks for advanced analytics on patient data. To ensure compliance with HIPAA regulations, they need to secure the workspace. They:

  • Allow access only from their corporate VPN, which operates within the IP range 203.0.113.0/24.
  • Block all other IP ranges by default.

Using the IP access list, they configure the allow rule for their corporate network and prevent any external unauthorized access.


Implementation

Using REST API

You can configure the IP access list via the Databricks REST API.

1. Authentication

First, generate a Databricks Personal Access Token (PAT) from your workspace.

2. Add an IP Access List

curl -X POST \
  -H "Authorization: Bearer <your_pat_token>" \
  -H "Content-Type: application/json" \
  https://<your-databricks-instance>/api/2.0/ip-access-lists \
  -d '{
    "label": "Corporate Network",
    "list_type": "ALLOW",
    "ip_addresses": ["203.0.113.0/24"]
  }' 

3. Retrieve Current Lists

curl -X GET \
  -H "Authorization: Bearer <your_pat_token>" \
  https://<your-databricks-instance>/api/2.0/ip-access-lists 

4. Remove an IP Access List

curl -X DELETE \
  -H "Authorization: Bearer <your_pat_token>" \
  https://<your-databricks-instance>/api/2.0/ip-access-lists/<ip_access_list_id> 

Using Terraform

You can also use Terraform to manage your Databricks IP access list.

Terraform Code

provider "databricks" {
  host  = "https://<your-databricks-instance>"
  token = var.databricks_pat_token
}

resource "databricks_ip_access_list" "corporate_network" {
  label       = "Corporate Network"
  list_type   = "ALLOW"
  ip_addresses = [
    "203.0.113.0/24"
  ]
} 

Steps

  1. Save the above configuration as main.tf.
  2. Initialize Terraform: terraform init
  3. Apply the configuration: terraform apply

Conclusion

The Databricks Workspace IP Access List is a critical feature for securing your environment, ensuring compliance, and protecting sensitive data. Whether using REST APIs or Terraform, it’s easy to implement and highly effective in controlling access to your Databricks workspace. By leveraging this feature, you can significantly reduce the attack surface and ensure that only authorized users can interact with your Databricks resources.imresizer-1733377644213.jpg

Ajay Kumar Pandey
0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group