This Python script helps detect drifts in SCIM provisioning within a GitHub organization by comparing organization members against SCIM-provisioned identities.
This script can only be used in enterprise organizations where Single Sign-On (SSO) and SCIM are enabled.
The script uses a GitHub App to authenticate against both GitHub REST and GraphQL APIs. It:
- Retrieves all organization members and their verified emails via GraphQL
- Gets all SCIM-provisioned identities via REST API
- Compares both lists to identify any discrepancies
To mitigate identity drifts between your Identity Provider (IdP) and GitHub that can lead to security issues and access management problems.
This script helps you:
- Identify users without SCIM provisioning
- Find users without verified organization emails
- Maintain alignment between your IdP and GitHub user base
- Create a GitHub App in your organization with these permissions:
- Organization permissions:
members
: read-onlyadministration
: read-only
- Organization permissions:
- Generate a private key for the GitHub App
- Install the GitHub App in your organization
- Note down:
App ID
Installation ID
- Private key (base64 encoded or as a file)
GH_ORG
: GitHub organization nameGH_APP_ID
: GitHub App IDGH_INSTALL_ID
: GitHub App Installation ID- Either:
GH_PEM_KEY
: private key as plain text or base64 encodedGH_PEM_KEY_PATH
: Path to private key file
-o
,--out-format
: Output format (table ortxt
). Default: table--no-color
: Disable colored output
python compare-org-scim-users.py [-o {table,txt}] [--no-color]]
- name: Compare SCIM Identities
uses: tentwentyone/github-org-members-verify-scim-identities@v1.0.2
with:
# GitHub App credentials
gh_app_id: ${{ secrets.GH_APP_ORG_READ_ID }}
gh_pem_key: ${{ secrets.GH_APP_ORG_READ_PEM_KEY }}
gh_install_id: ${{ secrets.GH_APP_ORG_READ_INSTALL_ID }}
The script generates a report showing:
- Users without SCIM IDs
- Users without verified organization emails
When run in a GitHub Action, results are added to the workflow summary.
Output when drifts or unverified emails are detected:
Output when no drifts / unverified emails are detected:
We welcome contributions! Please check our contribution guidelines for details.
Please see our guidelines for details on our security policy and reporting security vulnerabilities.
This project is released under the MIT License.