Disable harmful commands at databricks cluster/workspace level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:41 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 04:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 05:10 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 06:09 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 04:32 AM
Currently we do not have a way to disable harmful dbutils commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2023 09:52 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2024 03:01 AM
Can We Embed this in topmost INIT file?
alias rm='echo "rm is disabled, please check with the admin."'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2024 01:06 AM - edited 02-28-2024 01:07 AM
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

