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
Valued Contributor II
Valued Contributor II

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

Vinay_M_R
Valued Contributor II
Valued Contributor II

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
Valued Contributor II
Valued Contributor II

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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!