Skip to main content

Snowflake access drift scanner

Project description

✨ GrantAxis — “git init” for Snowflake RBAC

GrantAxis is a minimal, purpose-built CLI that snapshots the real grants in your Snowflake account and flags anything that drifts from that baseline.

What it does today (MVP)

✅ Captures a deterministic baseline.yml of every meaningful grant (system noise auto-filtered)

✅ Runs an instant diff (locally or in CI) to surface added, removed, changed, or transferred privileges

✅ Fails your pipeline with exit-code 2 when drift is detected

✅ Outputs a clean Markdown report (drift.md) you can read in any code review

Perfect for teams who…

use Terraform/Permifrost but still get “just-this-once” manual GRANTs

haven’t automated RBAC yet and want quick guard-rails without a full platform migration

need a tiny tool they can run anywhere (local, CI, Docker) with zero backend


🚀 Quick Start — Git-Style Drift Detection for Snowflake RBAC

pip install grantaxis-cli            #  ⏱ <10 s
export SNOWFLAKE_USER= SNOWFLAKE_ACCOUNT= SNOWFLAKE_PASSWORD=…
grantaxis init -o baseline.yml       #  snapshot prod
grantaxis diff -b baseline.yml       #  detect drift any time

1. Install the CLI

# one-liner install from PyPI
pip install grantaxis-cli

(No root? use pipx install grantaxis-cli or a venv.)


2. Set minimal Snowflake credentials

export SNOWFLAKE_USER=myservice
export SNOWFLAKE_ACCOUNT=acme-prod
export SNOWFLAKE_PASSWORD=********
export SNOWFLAKE_WAREHOUSE=MONITORING_WH   # optional

(OAuth or key-pair auth? set SNOWFLAKE_AUTHENTICATOR / SNOWFLAKE_PRIVATE_KEY_PATH instead.) (If you omit env-vars, GrantAxis will prompt for user / password interactively)


3. git init your RBAC baseline

# inside your repo
grantaxis init -o baseline.yml
git add baseline.yml
git commit -m "snapshot: initial Snowflake RBAC baseline"

baseline.yml is a deterministic, human-readable record of every grant that matters (system noise automatically excluded).


4. (Optional) Detect drift in CI

Add .github/workflows/grantaxis.yml:

name: Snowflake RBAC drift

on: [push, pull_request]

jobs:
  diff:
    runs-on: ubuntu-latest
    env:
      SNOWFLAKE_USER:      ${{ secrets.SNOWFLAKE_USER }}
      SNOWFLAKE_ACCOUNT:   ${{ secrets.SNOWFLAKE_ACCOUNT }}
      SNOWFLAKE_PASSWORD:  ${{ secrets.SNOWFLAKE_PASSWORD }}
      SNOWFLAKE_WAREHOUSE: ${{ secrets.SNOWFLAKE_WAREHOUSE }}

    steps:
      - uses: actions/checkout@v4

      - name: Install GrantAxis
        run: pip install grantaxis-cli

      - name: Capture live snapshot
        run: grantaxis init -o live.yml --quiet

      - name: Diff vs. baseline
        run: |
          grantaxis diff -b baseline.yml -s live.yml --report drift.md
          cat drift.md

🚨 If any new, removed, or modified grants are found, the job fails (exit 2). Review drift.md, commit intentional changes, or revoke rogue privileges.


5. What a drift report looks like

# Grant Drift Report

Summary: 3 changes detected (➕1 ➖1 🔄1)

| Type | Grantee               | Object                 | Priv | GrantOpt |
|------|-----------------------|------------------------|------|----------|
| ➕ Added   | dev_order_protected | SALES_DB.STAGING (SCHEMA) | USAGE | ❌ |
| ➖ Removed | dev_order_protected | ROLE data_engineer        | USAGE | ❌ |
| 🔄 Transfer| dev_order_protected | ROLE data_analyst         | USAGE | ❌ |

Push the fix or merge the PR to keep prod and Git in perfect sync.


That's it.

From now on any "just-this-once" manual GRANT shows up in the diff before it becomes tomorrow's incident. Enjoy the peace of mind.


🔒 Security

✅ No data leaves your environment ✅ CLI runs locally, no backend

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grantaxis_cli-0.1.3.tar.gz (28.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grantaxis_cli-0.1.3-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file grantaxis_cli-0.1.3.tar.gz.

File metadata

  • Download URL: grantaxis_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 28.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.6 CPython/3.11.10 Linux/6.2.16

File hashes

Hashes for grantaxis_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a15d90cafeb184daf7f3778dd40597fcaf0bf326371bbcfa5bce36e1a36c210d
MD5 43af21a294063384c85d31239f1d751f
BLAKE2b-256 59e7a7aae1de246fa5f58f832c5bd1fc919a984f0d36801153db584f5975bffc

See more details on using hashes here.

File details

Details for the file grantaxis_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: grantaxis_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.6 CPython/3.11.10 Linux/6.2.16

File hashes

Hashes for grantaxis_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 283c8873ba77052bcd9ee1d9b331e1f8da072717f3deb0c09b3db22132284560
MD5 6d5dd0e4c0cad5c09455948dc25ece5f
BLAKE2b-256 4bd719b852ad5e51c3755bee87b804561445791c98b89367d8f22b50cbb20554

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page