Skip to content

A project which integrates the Alation Data Catalog with ALTR's automated policy enforcement

License

Notifications You must be signed in to change notification settings

altrsoftware/altr-alation-tag-policy

Repository files navigation

ALTR log

ALTR + Alation Tag Policy Integration

The ALTR + Alation Tag Policy integration is a tool to pass policy tags in Alation to Snowflake and ALTR.

The tool grabs tags of each column from a custom field in Alation, applies those tag values to the corresponding column in Snowflake, imports Snowflake Object Tags into ALTR and adds said columns to ALTR to be governed.

This tool is plumbing between two available API's:

and Snowflake.

How it works

The tool:

  1. Gets columns from Alation that have 'ALTR Policy Tag' applied
  2. Gets columns from Snowflake that have 'ALATION_TAG' applied
  3. If the Snowflake column and Alation column tag values do not match it un-sets the tag in Snowflake and updates it with the correct tag values to match Alation 'ALTR Policy Tag'
  4. For any new column that's tagged in Alation, it sets the same tag in snowflake and adds the column to ALTR to be governed
  5. For any database in ALTR that contained a column that had a tag change, it updates the database to pull tag changes
  6. For any column in Alation/Snowflake that had a tag change and does not belong to an ALTR database, it adds said database to ALTR

Why use it

ALTR partnered with Alation to fill a gap between data cataloging and data governance.

With this powerful tool, you can apply tags to columns in Alation and automatically have those tags applied to the corresponding Snowflake columns. If ALTR is already applying policy on those tags, the new columns will automatically have the same policies applied via ALTR. If not, you can easily create a tag-based policy in ALTR on that new tag.

Visuals

Integration Flowchart:

Integration Flowchart

Installation

Install From Source

$ git clone https://github.com/altrsoftware/altr-alation-tag-policy.git

$ cd altr-alation-tag-policy

Install npm packages

$ npm install

Before using the tool

1. Fill out the .env file environment variables

// ALATION
ALATION_API_ACCESS_TOKEN = "Your Alation API Access Token"
ALATION_DOMAIN = "Your Alation domain (example-prod.alationcatalog.com)"
ALATION_EMAIL = "The email used to sign in and create the API Access Token"

// SNOWFLAKE
SF_ACCOUNT = "Snowflake account identifier (exampleorg.us-east-1)"
SF_DB_USERNAME = "Your Snowflake username that has admin rights AND must have ALTR service role granted (PC_ALTR_ROLE or ALTR_SERVICE_ROLE)"
SF_DB_PASSWORD = "Your Snowflake password"

SF_HOSTNAME = "The hostname of your Snowflake instance (example.us-west-3.snowflakecomputing.com)"
SF_WAREHOUSE = "Default warehouse your ALTR service role uses"
SF_ROLE = "If you connected to ALTR through Snowflake Partner Connect (PC_ALTR_ROLE) | If you created a ALTR service user (ALTR_SERVICE_ROLE)"

//ALTR
ALTR_DOMAIN = "Your ALTR domain (altrnet.live.altr.com)"
ALTR_KEY_NAME = "Your ALTR Management API key name"
ALTR_KEY_PASSWORD = "Your ALTR Management API key password"

2. Grant Role to Snowflake User

GRANT ROLE <PC_ALTR_ROLE | ALTR_SERVICE_ROLE> TO USER <SF_DB_USERNAME>; 
  • The Snowflake user (SF_DB_USERNAME) you put in .env variables file must have the role of PC_ALTR_ROLE or ALTR_SERVICE_ROLE granted to it depending if you connected to ALTR using Snowflake Partner Connect or created your own ALTR Service User.

3. You must add a custom field to your Alation environment for this application to work successfully

$ node createCustomField.js --domain=<Alation Domain> --account=<Alation Login Email> --password=<Alation Login Password>
  1. Click the Settings icon at the top right of your Alation environment

  2. In the Catalog Admin section, click Customize Catalog

  3. Click the Custom Templates tab

  4. Under the Data Object Templates section, click Column

  5. On the right side of the template, click Insert -> Custom Field -> ALTR Policy Tags

  6. At the top of the template, click Save

Note: You can add more / any tags by going to Customize Catalog and editing options in ALTR Policy Tags custom field

4. Please consider the Snowflake Object Tags named 'ALATION_TAG' created and used by this integration as 'sacred'. If you manually alter/delete these tags in Snowflake it could cause problems when using the integration.

How To Use

Warning: You must complete the Before using the tool section; otherwise, the integration will not work correctly.

Method 1: Docker

This method will install the necessary packages needed to run the application for you.

$ docker build -t altr/altr-alation-tag-policy .

$ docker run -d altr/altr-alation-tag-policy

Method 2: Manually

$ npm install

$ node index.js

Dependencies

This application was built using the following node packages and their respected version:

Support

Need support to get this application running? Have questions, concerns or comments?

Email application-engineers@altr.com with a subject line of "ALTR + Alation Tags Policy Integration".

License

GNU General Public License

Additional Resources

https://docs.altr.com/

https://www.youtube.com/channel/UCcqDY0wrRlQ8hQ_mjJNfkAA

https://www.altr.com/resources

About

A project which integrates the Alation Data Catalog with ALTR's automated policy enforcement

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published