Recommendations for working with DBFS root
Both DBFS root and DBFS mounts are deprecated and not recommended by Databricks. New workspaces are provisioned without access to these features. Databricks recommends using Unity Catalog volumes, external locations, or workspace files instead.
Databricks uses the DBFS root directory as a default location for some workspace actions. Databricks recommends against storing any production data or sensitive information in the DBFS root. This article focuses on recommendations to avoid accidental exposure of sensitive data on the DBFS root.
Databricks configures a separate private storage location for persisting data and configurations in customer-owned cloud storage, known as the internal DBFS. This location is not exposed to users.
Educate users not to store data on DBFS root
Because the DBFS root is accessible to all users in a workspace, all users can access any data stored here. It is important to instruct users to avoid using this location for storing sensitive data. The default location for managed tables in the Hive metastore on Databricks is the DBFS root; to prevent end users who create managed tables from writing to the DBFS root, declare a location on external storage when creating databases in the Hive metastore.
Unity Catalog managed tables use a secure storage location by default. Databricks recommends using Unity Catalog for managed tables.
Use audit logging to monitor activity
For details about DBFS audit events, see DBFS events.
Databricks recommends that you enable S3 object-level logging for your DBFS root bucket to allow faster investigation of issues. Be aware that enabling S3 object-level logging can increase your AWS usage cost.
Encrypt DBFS root data with a customer-managed key
You can encrypt DBFS root data with a customer-managed key. See Customer-managed keys for encryption. To add and verify the key, see Step 4: Add the key configuration to a workspace.
DBFS can't read files in the DBFS root bucket that are encrypted with an AWS Key Management Service (KMS) key other than the workspace storage key. To keep DBFS root data readable:
- Read and write DBFS root data through
dbfs:/paths or table names, not throughs3://paths that use an instance profile. Writes throughdbfs:/paths and table names use the workspace's encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) or the workspace storage key. - Grant instance profiles write access to the DBFS root bucket only if a job must write to it through an
s3://path. For that job, configure the S3 encryption of the compute to match the workspace. If the workspace uses a workspace storage key, also add the instance profile as a key user of that key. See Configure encryption for S3 using instance profiles (legacy). - Set the default encryption of the DBFS root bucket as described in Default encryption of the workspace storage bucket.