> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/data-science-lab-4/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/data-science-lab-4/project/tabs-for-a-data-science-lab-project/tabs-for-pyspark-environment/notebook/notebook-page/notebook-operations/secrets.md).

# Secrets

Generate Environment Variables to save your confidential information from getting exposed.

You can generate Environment variables for the confidential information of your database using the Secret Management function. Thus, it saves your secret information from getting exposed to all the accessible users.

{% hint style="info" %}
*<mark style="color:green;">Pre-requisite:</mark> It is mandatory for the users to configure the **Secret Management** using the **Admin module** of the platform before attempting the Secret option inside the DS Lab module.*
{% endhint %}

## Accessing the Secrets tab under Notebook <a href="#accessing-the-secrets-tab-under-notebook" id="accessing-the-secrets-tab-under-notebook"></a>

Once the ***Secret Management*** has been configured from the Admin module it will have the Secret Key and related fields as displayed below:

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/dQO4CL1S5TKR8TLk1FL1/image.png" alt=""><figcaption><p><em><strong>Secret Management page under the Admin module</strong></em></p></figcaption></figure>

* Navigate to a Notebook inside the Data Science Lab module.
* Open the ***Secrets*** tab from the right-side.
* The newly created ***Secret Key*** gets listed below.
* Click the drop-down icon next to the Secret Key name.
* The details of the selected ***Secret Key*** gets opened.​​

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/1jIh2zsMZtvWrfJzqoOb/image.png" alt=""><figcaption><p><em><strong>Details of the Secret Keys</strong></em></p></figcaption></figure>

* Add a new Code cell.
* Select the ***Secret Keys*** by using the given check boxes.
* The selected details get entered in the code cell.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/zeS5vAFhw8frCZBAuKTB/image.png" alt=""><figcaption><p><strong>The encrypted secret key details gets accessible inside a code cell</strong></p></figcaption></figure>

* Add a new ***Code*** cell.
* Open the ***Writers*** tab.
* Select a writer type using the checkbox. E.g., In this case, ***MySQL*** has been selected.
* Map the encrypted secret keys for the related configuration details like Username, Password, Port, Host, Database by copying them.
* Run the cell.
* The data frame will be written to the selected writer's database.

<figure><img src="https://content.gitbook.com/content/1QeOywZjV1cHo55cMW8u/blobs/3YvgFthRYiiUIjVWXk0q/image.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Refer the* [***Data Science Lab Quick Start Flow***](https://docs.bdb.ai/data-science-lab-4/data-science-lab-quick-start-flow) *page to get an overview of the **Data Science Lab** module in nutshell.*&#x20;
{% endhint %}
