Git Product home page Git Product logo

pathfinder's Introduction

pathfinder

Python script that queries the Okta and Vault APIs and determines what Okta groups grant human access to what Vault paths. This script assumes your humans are authenticating to Vault via Okta. You can query by path or by user!

Do this before using script

$> pip install -r requirements.txt
  • Set an environment variable called OKTA_TOKEN to an Okta API key that can read the group membership of all users in Okta.
  • Set an environment variable called VAULT-ADDR to the URL of your Vault instance
  • Make sure you are in an Okta group that has has Read,List access to all secrets engine paths in Vault
  • Log into Vault using the Vault CLI. User authentication looks like this:
$> vault login -method=okta username=clazarou # MFA via Okta Verify required

Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.

Key                  Value
---                  -----
token                foo
token_accessor       bar
token_duration       768h
token_renewable      true
token_policies         ["default" "some-policy-1" "some-policy-2" "some-policy-3"]
identity_policies      []
policies               ["default" "some-policy-1" "some-policy-2" "some-policy-3"]
token_meta_policies    "some-policy-1" "some-policy-2" "some-policy-3"
token_meta_username    clazarou

Run pathfinder.py: Find all the Vault paths a specific user can access

Run the script and provide the user's email as an argument

python pathfinder.py [email protected]

Run pathfinder.py: Find all the users that can access a specific Vault path

python pathfinder.py -path <some path>

Common Errors

$> python pathfinder.py [email protected]

User's Okta account is ACTIVE

Traceback (most recent call last):
  File "/Users/clazarou/blah/blah/pathfinder.py", line 66, in <module>
    all_mapped_groups = vault_groups_response["data"]["keys"]
KeyError: 'data'

If you see a KeyError like the above, you may need to authenticate to Vault again and save your new token to the VAULT_TOKEN environment variable.

pathfinder's People

Watchers

Candace Lazarou 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.