> For the complete documentation index, see [llms.txt](https://docs.lightbeam.ai/lxqobxw6ak7CTnsQjikH/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lightbeam.ai/lxqobxw6ak7CTnsQjikH/core-features/spectra-ai/data-sources/databases-and-datalakes/aurora-postgresql.md).

# Aurora (PostgreSQL)

Connecting Aurora (PostgreSQL) to LightBeam

***

## Overview

LightBeam Spectra users can connect various data sources to the LightBeam application and these data sources will be continuously monitored for PII, PHI data.

**Example**: PostgreSQL, Snowflake, SMB, etc.

***

### Onboarding Aurora (PostgreSQL) Data Source

1. Login to your LightBeam Instance.<br>
2. Click on **DATASOURCES** on the Top Navigation Bar.<br>
3. Click on **“Add a data source”.**

<figure><img src="https://682442409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0FnJiPbEPpkm5U4tiZUM%2Fuploads%2FYKiOta051Pbtm6SgvqWH%2FScreenshot%202024-08-22%20at%204.23.21%20PM.png?alt=media&amp;token=14c234f2-a9a6-491e-8432-200f56d3cc82" alt="" width="298"><figcaption><p>Figure 1. Add a Datasource</p></figcaption></figure>

2\. Search for Aurora (PostgreSQL).

<figure><img src="https://682442409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0FnJiPbEPpkm5U4tiZUM%2Fuploads%2FORFN91Pmb0ofKZHL9I9W%2Fimage.png?alt=media&amp;token=da81701a-ccc0-4549-a042-b131a512d32f" alt="" width="179"><figcaption><p>Figure 2. Search for Aurora PostgreSQL </p></figcaption></figure>

<figure><img src="https://682442409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0FnJiPbEPpkm5U4tiZUM%2Fuploads%2Fn1uKjXzRSAuRyAq5O0c4%2Fimage.png?alt=media&amp;token=b30ffc38-cf7e-446b-9507-1cf71c88c3b5" alt="" width="230"><figcaption><p>Figure 2.1 PostgreSQL Data Source</p></figcaption></figure>

3\. **Configure Basic Details**

1. In the **Basic Details** section, enter the following information:

   * **Instance Name**: Provide a unique name for the Aurora PostgreSQL data source (e.g., `aurora postgreSQL`).
   * **Primary Owner**: Enter the email address of the individual responsible for this data source (e.g., `demo@lightbeam.ai`).
   * **Source of Truth (Optional)**: Toggle this option **on** if this database serves as a **single source of truth** for entity validation.
   * **Description** (Optional): Add a brief description of the database (e.g., "Aurora PostgreSQL instance").

   <figure><img src="https://682442409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0FnJiPbEPpkm5U4tiZUM%2Fuploads%2FmuGmsDoVCZVf4UEr1LXj%2Fimage.png?alt=media&amp;token=0f946ebd-3eff-4c52-9a47-e1533a4e68c2" alt=""><figcaption><p>Figure 4. Aurora (PostgreSQL) - Basic Information &#x26; Connection Details</p></figcaption></figure>

4\. **Enter Connection Details**

Provide the following details in the **Connection** section:

* **Username**: The username for database authentication.
* **Password**: The corresponding password for the username.
* **Host**: The **Aurora PostgreSQL cluster endpoint** (e.g., `aurora-cluster-1.cluster-xxxxxxxxxxxx.us-east-1.rds.amazonaws.com`).
* **Port**: The PostgreSQL connection port (**default 5432** or a custom port).<br>

5. Click **Test Connection** to validate the credentials.\ <br>
6. **Additional Details (Optional)**&#x20;

In this section, you can specify metadata attributes related to the data source:&#x20;

* **Location**: The location of the data source.&#x20;
* **Purpose**: The purpose of the data being collected/processed.&#x20;
* **Stage**: The stage of the data source. Example: Source, Processing, Archival, etc.

7. Verify that you get the message **Connection Success!** on the screen. Click on **Next**.

8. On the next screen, select databases that you wish to scan from the list.<br>

<figure><img src="https://682442409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0FnJiPbEPpkm5U4tiZUM%2Fuploads%2FviD9crSjQ5ymlvd1Jn9S%2FScreenshot%202024-08-26%20at%207.09.33%20PM.png?alt=media&amp;token=54669aee-c116-4a03-91e4-b723b053b9b2" alt=""><figcaption><p>Figure 5. Scan conditions</p></figcaption></figure>

\
9\. Click on **Start Sampling**.

***

## APPENDIX

### Troubleshooting

If you don’t see any data being scanned without error, it might be a permission issue. Consider running a  `SELECT *` query on a table and see if you are able to see the data. If you see a message of permission denied, consider granting permission to the user.

### Minimal permissions setup&#x20;

We require the following permissions to scan only a subset of the databases for the instance:

* `CONNECT` permissions
* For each database - `CONNECT` and `SELECT` permissions

Use the following script to create a user with such permissions. In this example, we are creating a user with the permissions to connect to the LightBeam database.

#### User with restricted permissions for a single database

`-- CREATE USER test1 WITH PASSWORD 'lbadmin12345';`

`-- GRANT SELECT ON ALL TABLES IN SCHEMA public TO test1;`

`-- GRANT CONNECT ON DATABASE lightbeam to test1;`

`-- GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO test1;`<br>

Use the user you just created to register **Aurora** **PostgreSQL** datasource.

#### Full permissions setup

If you want to, you can scan all the databases and allow wider scope permissions. LightBeam recommends a full **read-only** user that can access a list of databases, connect to every database, and read data.

### Validate permissions to the database

Next, the user needs to validate these permissions to the database. This ensures authorized access to the database by the credentials provided by the user. After validating the permissions to the database, the user can configure LightBeam Spectra on the system.

#### Prerequisite

The following tools need to be installed on the system in order to verify database permissions:

* **`Git`**
* **`PSQL tool`**

#### Steps

1. First, clone the repository [`https://github.com/lightbeamai/lb-installer`](https://github.com/lightbeamai/lb-installer)
2. Go into `sql_user_check_postgres` directory
3. Please refer to the **`README.md`** file in the directory for detailed instructions.

***

## About LightBeam

LightBeam automates Privacy, Security, and AI Governance, so businesses can accelerate their growth in new markets. Leveraging generative AI, LightBeam has rapidly gained customers’ trust by pioneering a unique *privacy-centric* and *automation-first* approach to security. Unlike siloed solutions, LightBeam ties together sensitive data cataloging, control, and compliance across structured and unstructured data applications providing 360-visibility, redaction, self-service DSRs, and automated ROPA reporting ensuring ultimate protection against ransomware and accidental exposures while meeting data privacy obligations efficiently. \
\
LightBeam is on a mission to create a secure privacy-first world helping customers automate compliance against a patchwork of existing and emerging regulations.

For any questions or suggestions, please get in touch with us at: <support@lightbeam.ai>.<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.lightbeam.ai/lxqobxw6ak7CTnsQjikH/core-features/spectra-ai/data-sources/databases-and-datalakes/aurora-postgresql.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
