Code Monkey home page Code Monkey logo

github-pat-saml-auths-report's Introduction

github-pat-saml-auths-report

This Python script checks all or selected orgs that you have access to for classic PATs with SAML authorization in them and generates a JSON report with such tokens sorted by org. It does not include fine-grained tokens. There is a separate API endpoint and UI for those.

Requirements

  • Python 3
  • requests library (install with pip install requests)

Usage

  1. Create a classic GitHub personal access token with read:org scope and SAML authorize it to orgs that you want to check.

  2. Run the script with the following command:

export GITHUB_PAT_SAML_AUTHS_REPORT_TOKEN="<your token>"

# Get classic PATs with SAML authorization from all orgs that the token can access
python3 github-pat-saml-auths-report.py
# OR
# Check specific org(s)
python3 github-pat-saml-auths-report.py -o org1 org2 org3

# OPTIONAL, get only classic PATs with SAML authorization in org2 from report
cat github_orgs_saml_auths_YYYY-MM-DD_HH-MM-SS.json | jq '.org2'

Options

  • -o or --orgs: List of GitHub organizations to check. If not specified, all organizations that the token can access will be checked.
  • -j or --json: Filename for JSON report. Default: github_orgs_saml_auths_YYYY-MM-DD_HH-MM-SS.json

Environment variables

  • GITHUB_PAT_SAML_AUTHS_REPORT_TOKEN: GitHub personal access token with read:org scope

github-pat-saml-auths-report's People

Contributors

va1entin avatar

Watchers

Kostas Georgiou avatar  avatar  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.