# 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="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 %}

{% hint style="info" %}
Check out this walk-through video on how to use Secret Management function in regards to Notebook.
{% endhint %}

![Secrets tab inside the Notebook](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FWwELFmBefwkBA8L0Qg62%2FSecret%20management.gif?alt=media\&token=a8627d80-bf2e-4b4e-814d-6620510ddaf9)

### Configuring the Secret Management

* Navigate to the ***Admin Module*** using the ***Apps*** menu.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FvHpKQRxBqYW8QuflmqXR%2Fimage.png?alt=media\&token=4b04dd9e-220d-49b5-b41c-afeb93d334ec)

* Click the ***Secret Management*** option from the ***Admin*** panel.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FnIUU2rbLhxBgaOFbejMs%2Fimage.png?alt=media\&token=41d82840-8c43-4770-b6fd-28eb1a248a97)

* The Secret Management page opens.

![The Secret Management Page ](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2F9iwwT8KkuyKOklv97y9W%2Fimage.png?alt=media\&token=1e27e5c2-ef66-4a20-b74e-569ef7727305)

### Creating a New Secret Key

* Click the ***New*** option to create a new Secret Key using the Secret Management page.

![New option to add a new Secret Key](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FncMVMXOwLCd7EiN62x8B%2Fimage.png?alt=media\&token=4c8b44b5-4215-484a-92ca-cce73a076b71)

* It redirects to ***add a new Secret Ke**y* option.
* Name the new Secret Key.
* Click the ***Save*** option.

![Adding a new Secret Key](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2Fr8VNidex28AhM3iYfZ4A%2Fimage.png?alt=media\&token=0a3760ad-4a70-4874-8e0b-cc34e332fa1a)

* The newly created ***Secret Key*** gets saved.
* A confirmation message appears to inform the completion of the action.

![A new Secret Key gets added](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FIdZFIeAQtFVIoWpI984I%2Fimage.png?alt=media\&token=3afee8d0-1efd-4453-8ff8-a57602180809)

### Adding more fields to a Secret Key

* Navigate to the Secret Management page.
* Select a Secret Key.
* Click the Add icon to add a new field below.
* The added fields appear below.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FgaqZFldjswrL7mV1K3EW%2Fimage.png?alt=media\&token=d7559a9f-696c-4ea1-95c0-73452fd68e88)

### Sharing the Secret Key

* Select a Secret Key from the ***Secret Management*** page.
* Click the ***Share*** icon.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FNOzQUO9VOhfubxZCypqK%2Fimage.png?alt=media\&token=bc0ab5db-9b78-4d52-9d52-38379402baff)

* The ***Share Secret Key*** dialog box opens.
* Select any one tab out of ***USER***, ***USERGROUP***, and ***EXCLUDE USER.***
* Search for a user using the ***Search*** space.
* Use arrow mark to move the user/user groups from the left side box to the box given on the right. It will appear as shown in the below given image.&#x20;
* Click the ***Save*** option.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2F71nwhFyIMLpDFWwlPi05%2Fimage.png?alt=media\&token=2845d8d1-6cdd-4c85-89aa-bbd29a2f071c)

* A confirmation message appears to inform about the completion of the share action.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FSxP9YcIvCXdqk9wg50Wt%2Fimage.png?alt=media\&token=90c1f0db-2d8d-4bc0-a9de-6af92575164b)

### Accessing the Secrets tab under Notebook

* Navigate to a Notebook.
* Open the ***Secrets*** tab from the right-side.
* The newly created ***Secret Key*** gets listed below.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FCc5PZU2hmqKNkttF3Z97%2Fimage.png?alt=media\&token=00de4794-0c3e-4ad0-8ca3-4604293dc0aa)

* Click the drop-down icon next to the Secret Key name.
* The details of the selected Secret Key gets opened.

![](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FVs6Fy7T0T97ZDFrytUOr%2Fimage.png?alt=media\&token=dc419cfb-2fe6-4d48-9b77-dba101011b9f)

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

![The encrypted secret key details gets accessible inside a code cell](https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2F478bTiDwmgfE0n9ntwsi%2Fimage.png?alt=media\&token=cfcdd5ea-6a31-46fa-a29b-bfdfea6173f9)

{% hint style="info" %} <mark style="color:green;">Please Note:</mark> The following image indicates how we can verify whether the database is connected successfully or not by using the encrypted credentials.
{% endhint %}

<figure><img src="https://4128708524-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGDmsjfjJBNqow7Fo97cO%2Fuploads%2FqOJXZ8ciUBP4Rcan1OAM%2Fimage.png?alt=media&#x26;token=5f6a9b0f-dc2d-44ab-b732-7a0c8bb837da" alt=""><figcaption></figcaption></figure>
