Skip to main content
GitHub is a leading platform for hosting and collaborating on code repositories. It provides developers with tools for version control, CI/CD workflows, and collaboration across teams. The GitHubHandler allows secure integration with the GitHub API using a personal access token. It enables governance, risk, and compliance (GRC) data collection, such as repository metadata, MFA checks, and other organizational details.

Example

To create the GitHubHandler object with the GitHub credentials: The GitHubHandler connects to the GitHub API using an access token and base URL. It enables seamless interaction with repositories, users, and organizational data.
Fetch All Pages:
The fetch_all_pages method retrieves data across paginated GitHub API responses, such as repositories, branches, pull requests, or secrets. url = f”/user/repos” headers = github_handler._common_headers
Organization Details:
Fetches details about the authenticated GitHub organization.
User Details:
Retrieves information about the authenticated GitHub user.
Single MFA Evidence (Internal):
Checks MFA configuration for a single user (internal helper).
MFA Evidence:
Collects MFA enforcement evidence across organization members.
Process Repositories (Internal):
Processes repositories internally for compliance checks.
Repository Summary:
Summarizes details about a given repository.
List Organization Members:
Lists all members in an organization.
Fetch Repo Branches (Internal):
Fetches branch details for a repository (internal helper).
Repository Branches:
Gets all branches of a repository.
Single Branch Protection (Internal):
Fetches branch protection rules for a branch (internal helper).
Branch Protection:
Gets branch protection details for all branches in a repository.
Fetch Pull Requests for Repo (Internal):
Fetches pull requests for a given repository (internal helper).
Pull Requests:
Gets all pull requests for a repository.
Fetch Dependabot Alerts for Repo (Internal):
Retrieves Dependabot alerts for a repository (internal helper).
Get Dependabot Alerts:
Fetches Dependabot alerts across repositories.
Get Repository Dependabot Secrets:
Lists Dependabot secrets for a repository.
Fetch Dependencies for Repo (Internal):
Retrieves dependencies for a repository (internal helper).
List Repository Dependencies:
Lists dependencies across repositories.
Get Packages:
Fetches packages for an organization or user.