# Create and grant access to Protecto user

A user needs to be created (protecto\_user) and access to certain tables need to be given for extracting the Redshift data source metadata.

User needs to have read access to the below tables:

1\) To take Table details: &#x20;

* information\_schema.tables &#x20;
* svv\_tables &#x20;
* svv\_table\_info  &#x20;

2\) To take Log details:&#x20;

* stl\_query  &#x20;
* svl\_user\_info  &#x20;

3\) To take User details:  &#x20;

* pg\_user  &#x20;

4\) To take Group details: &#x20;

* pg\_group  &#x20;

5\) To take User access privilege details: &#x20;

* pg\_tables &#x20;
* pg\_internal &#x20;
* pg\_views  &#x20;

6\) To take Schema details: &#x20;

* pg\_catalog.pg\_namespace &#x20;
* pg\_catalog.pg\_user &#x20;

&#x20;**Reference queries:**&#x20;

&#x20;CREATE USER protecto\_user WITH PASSWORD '\<password>';&#x20;

GRANT USAGE ON SCHEMA information\_schema TO protecto\_user;&#x20;

GRANT SELECT ON information\_schema.tables TO protecto\_user;&#x20;

GRANT SELECT ON svv\_tables TO protecto\_user;&#x20;

GRANT SELECT ON svv\_table\_info TO protecto\_user;&#x20;

GRANT SELECT ON stl\_query TO protecto\_user;&#x20;

GRANT SELECT ON svl\_user\_info TO protecto\_user;&#x20;

GRANT SELECT ON pg\_user TO protecto\_user;&#x20;

GRANT SELECT ON pg\_group TO protecto\_user;&#x20;

GRANT SELECT ON pg\_tables TO protecto\_user; &#x20;

GRANT USAGE ON SCHEMA pg\_internal TO protecto\_user;&#x20;

GRANT SELECT ON pg\_views TO protecto\_user;&#x20;

GRANT SELECT ON pg\_catalog.pg\_namespace TO protecto\_user;&#x20;

GRANT SELECT ON pg\_catalog.pg\_user TO protecto\_user;&#x20;

ALTER USER protecto\_user WITH SYSLOG ACCESS UNRESTRICTED;&#x20;

**List of accesses needed for tables:**&#x20;

* Grant "SELECT" and "USAGE" privilege for all schemas and tables in the database for protecto\_user. &#x20;

**Reference queries:**&#x20;

GRANT USAGE ON SCHEMA \<schema\_name> TO protecto\_user;&#x20;

GRANT SELECT ON ALL TABLES IN SCHEMA \<schema\_name> TO protecto\_user;&#x20;

**Note:** &#x20;

* The above commands should be executed on all the future schemas and tables on which Protecto should analyze.&#x20;
* Once select access is given, if any new table is added in future, the select access should be given for all newly added tables to perform scanning.

&#x20;

&#x20;
