cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

Disable harmful commands at databricks cluster/workspace level

PallaviVetal
New Contributor II

Hi,

I want to prevent user from executing harmful commands like dbutils.fs.rm at cluster level/workspace level.

Can we do this in databricks? Are there any classes/APIs that we can override?

7 REPLIES 7

Vinay_M_R
Databricks Employee
Databricks Employee

Hi @PallaviVetal 

Are you using Python or SQL in your notebook?

Regards,

Vinay M R

Both additionally scala also. Basically I want to override inbuilt functions like dbutils.fs.rm. For shell commands, I can disable harmful commands by simply removing execute permission. For scala, I found the jar which has implementation of dbutils.fs.rm but I am not sure how I can override this function

Hi @PallaviVetal 

Currently we do not have a way to disable harmful dbutils commands. 

But you can try setting access controls to restrict users from performing any harmful operation: https://docs.databricks.com/security/auth-authz/access-control/index.html 

Vinay_M_R
Databricks Employee
Databricks Employee

Currently we do not have a way to disable harmful dbutils commands.

Anonymous
Not applicable

Hi @PallaviVetal 

We haven't heard from you since the last response from @Vinay_M_R ​, and I was checking back to see if her suggestions helped you.

Or else, If you have any solution, please share it with the community, as it can be helpful to others. 

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Nikhil_2800
New Contributor II

Can We Embed this in topmost INIT file?

alias rm='echo "rm is disabled, please check with the admin."'

 

Nikhil_2800
New Contributor II

Hi ,
I got the similar kind of problem too.
I followed this 
put chmod -x /bin/rm in init.sh in workspace and add it at cluster your cluster level init script or global init script.
this restricts the users to use rm command.

Regards,

Nikhil Srivastava

@PallaviVetal

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