Skip to content

Commit 034386c

Browse files
authored
Merge pull request #8 from data-platform-hq/feat/disable-access-to-dbfs-root
feat: disable access to DBFS root
2 parents b70df80 + 2a37a71 commit 034386c

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ No modules.
374374
| [databricks_cluster_policy.overrides](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster_policy) | resource |
375375
| [databricks_cluster_policy.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster_policy) | resource |
376376
| [databricks_database_instance.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/database_instance) | resource |
377+
| [databricks_disable_legacy_dbfs_setting.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/disable_legacy_dbfs_setting) | resource |
377378
| [databricks_entitlements.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/entitlements) | resource |
378379
| [databricks_group.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/group) | resource |
379380
| [databricks_ip_access_list.allowed_list](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/ip_access_list) | resource |
@@ -387,7 +388,6 @@ No modules.
387388
| [databricks_secret_scope.main](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/secret_scope) | resource |
388389
| [databricks_secret_scope.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/secret_scope) | resource |
389390
| [databricks_sql_endpoint.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_endpoint) | resource |
390-
| [databricks_system_schema.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/system_schema) | resource |
391391
| [databricks_token.pat](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/token) | resource |
392392
| [databricks_workspace_conf.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/workspace_conf) | resource |
393393
| [databricks_current_metastore.this](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/current_metastore) | data source |
@@ -403,6 +403,7 @@ No modules.
403403
| <a name="input_custom_cluster_policies"></a> [custom\_cluster\_policies](#input\_custom\_cluster\_policies) | Provides an ability to create custom cluster policy, assign it to cluster and grant CAN\_USE permissions on it to certain custom groups<br/>name - name of custom cluster policy to create<br/>can\_use - list of string, where values are custom group names, there groups have to be created with Terraform;<br/>definition - JSON document expressed in Databricks Policy Definition Language. No need to call 'jsonencode()' function on it when providing a value; | <pre>list(object({<br/> name = string<br/> can_use = list(string)<br/> definition = any<br/> }))</pre> | <pre>[<br/> {<br/> "can_use": null,<br/> "definition": null,<br/> "name": null<br/> }<br/>]</pre> | no |
404404
| <a name="input_custom_config"></a> [custom\_config](#input\_custom\_config) | Map of AD databricks workspace custom config | `map(string)` | <pre>{<br/> "enable-X-Content-Type-Options": "true",<br/> "enable-X-Frame-Options": "true",<br/> "enable-X-XSS-Protection": "true",<br/> "enableDbfsFileBrowser": "false",<br/> "enableExportNotebook": "false",<br/> "enableIpAccessLists": "true",<br/> "enableNotebookTableClipboard": "false",<br/> "enableResultsDownloading": "false",<br/> "enableUploadDataUis": "false",<br/> "enableVerboseAuditLogs": "true",<br/> "enforceUserIsolation": "true",<br/> "storeInteractiveNotebookResultsInCustomerAccount": "true"<br/>}</pre> | no |
405405
| <a name="input_default_cluster_policies_override"></a> [default\_cluster\_policies\_override](#input\_default\_cluster\_policies\_override) | Provides an ability to override default cluster policy<br/>name - name of cluster policy to override<br/>family\_id - family id of corresponding policy<br/>definition - JSON document expressed in Databricks Policy Definition Language. No need to call 'jsonencode()' function on it when providing a value; | <pre>list(object({<br/> name = string<br/> family_id = string<br/> definition = any<br/> }))</pre> | <pre>[<br/> {<br/> "definition": null,<br/> "family_id": null,<br/> "name": null<br/> }<br/>]</pre> | no |
406+
| <a name="input_disable_legacy_dbfs"></a> [disable\_legacy\_dbfs](#input\_disable\_legacy\_dbfs) | Disables access to DBFS root and mounts in your existing Databricks workspace.<br/>When set to true:<br/>- Access to DBFS root and mounted paths is blocked.<br/>- Manual restart of all-purpose compute clusters and SQL warehouses is required after enabling this setting.<br/>- Note: This setting only takes effect when disabling access. Re-enabling must be done manually via the Databricks UI. | `bool` | `false` | no |
406407
| <a name="input_iam_account_groups"></a> [iam\_account\_groups](#input\_iam\_account\_groups) | List of objects with group name and entitlements for this group | <pre>list(object({<br/> group_name = optional(string)<br/> entitlements = optional(list(string))<br/> }))</pre> | `[]` | no |
407408
| <a name="input_iam_workspace_groups"></a> [iam\_workspace\_groups](#input\_iam\_workspace\_groups) | Used to create workspace group. Map of group name and its parameters, such as users and service principals added to the group. Also possible to configure group entitlements. | <pre>map(object({<br/> user = optional(list(string))<br/> service_principal = optional(list(string))<br/> entitlements = optional(list(string))<br/> }))</pre> | `{}` | no |
408409
| <a name="input_ip_addresses"></a> [ip\_addresses](#input\_ip\_addresses) | A map of IP address ranges | `map(string)` | <pre>{<br/> "all": "0.0.0.0/0"<br/>}</pre> | no |
@@ -415,8 +416,6 @@ No modules.
415416
| <a name="input_secret_scope"></a> [secret\_scope](#input\_secret\_scope) | Provides an ability to create custom Secret Scope, store secrets in it and assigning ACL for access management<br/>scope\_name - name of Secret Scope to create;<br/>acl - list of objects, where 'principal' custom group name, this group is created in 'Premium' module; 'permission' is one of "READ", "WRITE", "MANAGE";<br/>secrets - list of objects, where object's 'key' param is created key name and 'string\_value' is a value for it; | <pre>list(object({<br/> scope_name = string<br/> scope_acl = optional(list(object({<br/> principal = string<br/> permission = string<br/> })))<br/> secrets = optional(list(object({<br/> key = string<br/> string_value = string<br/> })))<br/> }))</pre> | `[]` | no |
416417
| <a name="input_sql_endpoint"></a> [sql\_endpoint](#input\_sql\_endpoint) | Set of objects with parameters to configure SQL Endpoint and assign permissions to it for certain custom groups | <pre>set(object({<br/> name = string<br/> cluster_size = optional(string, "2X-Small")<br/> min_num_clusters = optional(number, 0)<br/> max_num_clusters = optional(number, 1)<br/> auto_stop_mins = optional(string, "30")<br/> enable_photon = optional(bool, false)<br/> enable_serverless_compute = optional(bool, false)<br/> spot_instance_policy = optional(string, "COST_OPTIMIZED")<br/> warehouse_type = optional(string, "PRO")<br/> permissions = optional(set(object({<br/> group_name = string<br/> permission_level = string<br/> })), [])<br/> }))</pre> | `[]` | no |
417418
| <a name="input_suffix"></a> [suffix](#input\_suffix) | Optional suffix that would be added to the end of resources names. | `string` | `""` | no |
418-
| <a name="input_system_schemas"></a> [system\_schemas](#input\_system\_schemas) | Set of strings with all possible System Schema names | `set(string)` | <pre>[<br/> "access",<br/> "compute",<br/> "marketplace",<br/> "storage",<br/> "serving",<br/> "query",<br/> "lakeflow"<br/>]</pre> | no |
419-
| <a name="input_system_schemas_enabled"></a> [system\_schemas\_enabled](#input\_system\_schemas\_enabled) | System Schemas only works with assigned Unity Catalog Metastore. Boolean flag to enabled this feature | `bool` | `false` | no |
420419
| <a name="input_workspace_admin_token_enabled"></a> [workspace\_admin\_token\_enabled](#input\_workspace\_admin\_token\_enabled) | Boolean flag to specify whether to create Workspace Admin Token | `bool` | n/a | yes |
421420

422421
## Outputs

main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ resource "databricks_token" "pat" {
1616
lifetime_seconds = var.pat_token_lifetime_seconds
1717
}
1818

19-
resource "databricks_system_schema" "this" {
20-
for_each = var.system_schemas_enabled ? var.system_schemas : toset([])
21-
22-
schema = each.value
19+
resource "databricks_disable_legacy_dbfs_setting" "this" {
20+
disable_legacy_dbfs {
21+
value = var.disable_legacy_dbfs
22+
}
2323
}

variables.tf

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,18 +215,6 @@ variable "mountpoints" {
215215
default = {}
216216
}
217217

218-
variable "system_schemas" {
219-
type = set(string)
220-
description = "Set of strings with all possible System Schema names"
221-
default = ["access", "compute", "marketplace", "storage", "serving", "query", "lakeflow"]
222-
}
223-
224-
variable "system_schemas_enabled" {
225-
type = bool
226-
description = "System Schemas only works with assigned Unity Catalog Metastore. Boolean flag to enabled this feature"
227-
default = false
228-
}
229-
230218
variable "default_cluster_policies_override" {
231219
type = list(object({
232220
name = string
@@ -292,3 +280,16 @@ To deploy and use an OLTP database instance in Databricks:
292280
- Database instances can only be deleted manually through the Databricks UI or using the Databricks CLI with the --purge option.
293281
DESCRIPTION
294282
}
283+
284+
# Disable access to DBFS root
285+
variable "disable_legacy_dbfs" {
286+
type = bool
287+
default = false
288+
description = <<DESCRIPTION
289+
Disables access to DBFS root and mounts in your existing Databricks workspace.
290+
When set to true:
291+
- Access to DBFS root and mounted paths is blocked.
292+
- Manual restart of all-purpose compute clusters and SQL warehouses is required after enabling this setting.
293+
- Note: This setting only takes effect when disabling access. Re-enabling must be done manually via the Databricks UI.
294+
DESCRIPTION
295+
}

0 commit comments

Comments
 (0)