# Secrets

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="warning" %}
*<mark style="color:orange;">Pre-requisite:</mark>*&#x20;

* *The users must configure the* [***Secret Management*** ](https://docs.bdb.ai/administrative-settings-4/admin-panel-options/configurations/secret-management)*using the **Admin module** of the platform before attempting the Secret option inside the DS Lab module.*
* The configured Secrets must be shared with a user group to access it inside the Data Science Lab module.
* Make sure that the user account selected for this activity belongs to the same user group to which the configured secrets were shared.
  {% endhint %}

{% hint style="success" %}
*Check out this walk-through on how to map the Secrets function inside a Notebook.*
{% endhint %}

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QeOywZjV1cHo55cMW8u%2Fuploads%2FIyF6gSQb3OEJjXOv5ir6%2FSecret%20in%20DSL%20RSP.mp4?alt=media&token=a6c92dd0-a545-4ecd-abd8-ccdea35acabb>" %}
***Secrets Tab inside the Notebook Page***
{% endembed %}

## Accessing the Secrets tab under a DS 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://4082649235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QeOywZjV1cHo55cMW8u%2Fuploads%2FSTM7zQ3JS1KnwSjPCL0g%2Fimage.png?alt=media&#x26;token=7cb24606-40da-4a9b-96be-375661f96662" 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*** is listed below.
* Click the drop-down icon next to the Secret Key name.
* The details of the selected ***Secret Key*** get opened.​​

<figure><img src="https://4082649235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QeOywZjV1cHo55cMW8u%2Fuploads%2FmF9dkm9ZEV3ofJvsVFLv%2Fimage.png?alt=media&#x26;token=e7711d54-d0cd-4771-bc3a-1e9b2bf44aee" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4082649235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QeOywZjV1cHo55cMW8u%2Fuploads%2Fxya1wOB0uXwJ4c8tNwoU%2Fimage.png?alt=media&#x26;token=8045d65b-8507-4ea1-9c04-43aaa0cc20a5" alt=""><figcaption></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, and Database by copying them.
* Run the cell.
* The data frame will be written to the selected writer's database.

<figure><img src="https://4082649235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1QeOywZjV1cHo55cMW8u%2Fuploads%2FucYwylDLMVDTJVVTgvtC%2Fimage.png?alt=media&#x26;token=315bb202-5658-4b67-bb15-768966dc83f9" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
*<mark style="color:green;">Please Note:</mark> Refer to 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.*&#x20;
{% endhint %}
