Giter VIP home page Giter VIP logo

rbac-viewer's Introduction

Snowflake RBAC Viewer

Simple Python script that generates DOT and HTML files with the role hierarchy, and the user-role hierarchy from a Snowflake account. You can visualize directly the HTML files in your browser. The DOT files are just an alternative, to be used with either a Graphviz Preview VSC extension - alongside the Graphviz (dot) language support ... extension - or with a free online visualizer like viz-js.com.

Database Profile File

Create a profiles_db.conf copy of the profiles_db_template.conf file, and customize it with your own Snowflake connection parameters. Your top [default] profile is the active profile, considered by our tool. Below you may define other personal profiles, that you may override under [default] each time you want to change your active connection.

We connect to Snowflake with the Snowflake Connector for Python. We have code for (a) password-based connection, (b) connecting with a Key Pair, and (c) connecting with SSO. For password-based connection, save your password in a SNOWFLAKE_PASSWORD local environment variable. Never add the password or any other sensitive information to your code or to profile files. All names must be case sensitive, with no quotes.

We always collect RBAC-related data from the whole Snowflake account, so do not specify a database or a schema in the profile file. Also, while all collected data is metadata, there is no need for a virtual warehouse.

CLI Executable File

You can invoke the tool directly from a Terminal window in Visual Source Code, as it follows:

python rbac-viewer.py

To compile into a CLI executable:

pip install pyinstaller
pyinstaller --onefile rbac-viewer.py
dist/rbac-viewer

The Role Hierarchy

A graph with the role hierarchy - including the system roles - is saved in the output/account-roles DOT and HTML files:

Roles Hierarchy

The User-Role Hierarchy

A graph with the user-role hierarchy - including the system roles - is saved in the output/account-users DOT and HTML files:

Users Hierarchy

rbac-viewer's People

Contributors

cristiscu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.