Overview
The goal of this notebook is to scan your notebooks for any arbitrary string.
Configuration
To configure this notebook, see the next cell "Configuration." Then can go to the final cell and modify the %sh command to scan for what you want.
As this notebook will download all other notebooks, it must be run with the privileges of a user who can view all notebooks. Additionally, it is recommended that it be run on a single user cluster (or dedicated job cluster) rather than a shared cluster, as it will download potentially sensitive data and store it in shared ephemeral storage on the local machine. Leveraging Nitro instances on AWS for local disk encryption, and leveraging the encryption flag on Azure Databricks is prudent.
Configuring credentials
In order to use this notebook, you will need to have an admin-level personal access token. To practice secure coding practices, this should not be hardcoded in a notebook, and rather should be stored using the Databricks Secrets capability or using a third party secret manager. Configure the Databricks Secrets service using the databricks cli or use the API. (Docs for CLI and API)
Example for API, after configuring the CLI:
$ databricks secrets create-scope --scope YOUR_SCOPE_NAME
$ databricks secrets put --scope YOUR_SCOPE_NAME --key YOUR_KEY_NAME
The scope name and key name can be whatever you wish, just provide them below in the configuration section.
After each put, the CLI will open up the vi text editor. Press the letter 'i' to switch to "insert" mode and then type in the username (or password). To get out of "insert" mode, hit escape, and then save and quit by typing ':wq'. Databricks will automatically remove any leading or trailing whitespace. Confused by vi? You're not alone. vi for beginners
Warranty
No warranty is provided for this notebook, and it is not officially supported. For best effort support, ask your Databricks team to connect you with Security Field Engineering.