Skip to main content
Applies to BloodHound Enterprise and CE This page covers downloading and running the GitHound collector against your GitHub organization.

Prerequisites

Required Permissions

Both PAT and GitHub App authentication methods require the same set of Read-only permissions. The table below maps each permission to the collection functions it enables. Repository permissions:
PermissionCollection Functions
ActionsGit-HoundWorkflow, Git-HoundEnvironment
AdministrationGit-HoundBranch, Git-HoundRepositoryRole
ContentsGit-HoundBranch
EnvironmentsGit-HoundEnvironment
MetadataGit-HoundRepository, Git-HoundRepositoryRole
Secret scanning alertsGit-HoundSecretScanningAlert
SecretsGit-HoundSecret
VariablesGit-HoundVariable
Organization permissions:
PermissionCollection Functions
AdministrationGit-HoundOrganization, Git-HoundRepository, Git-HoundRepositoryRole, Git-HoundAppInstallation
Custom organization rolesGit-HoundOrganization
Custom repository rolesGit-HoundRepository
MembersGit-HoundTeam, Git-HoundUser, Git-HoundOrganization
Personal access tokensGit-HoundPersonalAccessToken
Personal access token requestsGit-HoundPersonalAccessTokenRequest
SecretsGit-HoundOrganizationSecret, Git-HoundSecret
VariablesGit-HoundOrganizationSecret

Load GitHound

Retrieve the latest PowerShell version of the GitHound collector from the GitHub repo. Load the collector script and create an authenticated session.

With a Personal Access Token

. ./githound.ps1
$session = New-GitHubSession -OrganizationName "YourOrgName" -Token (Get-Clipboard)

With a GitHub App Installation

. ./githound.ps1
$session = New-GitHubJwtSession -OrganizationName "YourOrgName" -ClientId "your-client-id" -PrivateKeyPath "./your-app.pem" -AppId 123456789

Run the Collector

Invoke-GitHound -Session $session

Parameters

ParameterTypeDefaultDescription
-SessionGitHound.Session(required)Authentication session created above
-ResumeSwitch$falseLoad completed steps from disk instead of re-collecting
-CheckpointPathString"."Directory for output files and intermediate checkpoints
-CleanupIntermediatesSwitch$falseDelete per-step files after final consolidation
-CollectAllSwitch$falseInclude optional steps (Workflows, Environments, Repo Secrets, Repo Variables, App Installs, PATs)

Collect All Data

By default, GitHound collects core organizational data. Use -CollectAll to include optional collection steps such as Workflows, Environments, Repository Secrets, Repository Variables, App Installations, and PATs:
Invoke-GitHound -Session $session -CollectAll

Resume an Interrupted Collection

If a collection is interrupted, use -Resume to continue from where it stopped. GitHound writes a per-step output file after each collection function completes. The -Resume flag detects existing files on disk and skips completed steps.
Invoke-GitHound -Session $session -Resume
Functions with internal checkpointing (RepositoryRole, Workflow, Secret, Variable) save intermediate chunk files, so they can resume mid-function rather than starting over.

Custom Checkpoint Path

Use -CheckpointPath to specify a directory for output and checkpoint files:
Invoke-GitHound -Session $session -CheckpointPath "./output"

Clean Up Intermediate Files

Use -CleanupIntermediates to delete per-step files after the final consolidated JSON is generated:
Invoke-GitHound -Session $session -CleanupIntermediates

Rate Limits

Authentication MethodRate LimitBest For
Personal Access Token5,000/hourSmall to medium organizations (< 500 repos)
GitHub App Installation15,000/hourLarge organizations (500+ repos)
GitHound monitors rate limit headers and automatically pauses collection when limits are exhausted. You can check your current rate limit status:
Invoke-GitHubRestMethod -Session $session -Uri "https://api.github.com/rate_limit" | ConvertTo-Json

Manual Step-by-Step Collection

For very large environments, you can run individual collection functions instead of using Invoke-GitHound. This gives you maximum control over the process and lets you monitor each step independently.
FunctionAPIScaling FactorEstimated RequestsCheckpointing
Git-HoundOrganizationRESTCustom Org Roles (C)3 + 2CNo
Git-HoundUserGraphQLUser Count (U)ceil(U / 100)No
Git-HoundTeamGraphQLTeam Count (T)ceil(T / 100) + overflow pagesNo
Git-HoundRepositoryRESTRepository Count (R)3 + ceil(R / 30)No
Git-HoundRepositoryRoleRESTRepository Count (R)2RYes
Git-HoundBranchGraphQLRepository Count (R)ceil(R / 10) + overflow + protected reposYes
Git-HoundWorkflowRESTActions-Enabled Repos (A)AYes
Git-HoundEnvironmentRESTRepository Count (R)R + environments + branch policiesYes
Git-HoundOrganizationSecretRESTSelected Secrets/Variables (S)2 + SNo
Git-HoundSecretRESTRepository Count (R)RYes
Git-HoundVariableRESTRepository Count (R)RYes
Git-HoundSecretScanningAlertRESTAlert Countceil(Count / 100)No
Git-HoundAppInstallationRESTInstallation Count (I)1 + unique app slugsNo
Git-HoundPersonalAccessTokenRESTPAT Count (P)ceil(P / 100)No
Git-HoundPersonalAccessTokenRequestRESTRequest Countceil(Count / 100)No
Git-HoundGraphQlSamlProviderGraphQLSAML Identities (I)ceil(I / 100)No
Functions marked with checkpointing are also rate limit aware and will automatically pause and resume when API limits are exhausted.

Collection Output

GitHound generates a githound_<orgId>.json file that you can upload to BloodHound.

Next Steps