The following custom Cypher queries can be imported into BloodHound to enhance visibility. Each query is defined in a JSON file located in the this directory of the GitLabHound repository.
Note
This file is automatically generated from the JSON query files
that are bundled with the GitLabHound collector.
Returns all GitLab related nodes.
MATCH (n:GL_Base) RETURN nThis query can be imported into BloodHound from the all-gitlab-nodes.json file.
List all users who can push to a branch which has an OIDC trust relationship.
MATCH p = (:GL_User)-[:GL_HasRole|GL_HasBaseRole|GL_InheritRole*1..]->(:GL_ProjectRole)-[:GL_CanPush]->(:GL_Branch)-[:GL_CanAssumeIdentity]->(:AZServicePrincipal) RETURN pThis query can be imported into BloodHound from the attack-path-federated-identities.json file.
Returns all GitLab bots (subtypes of GL_User) nodes.
MATCH (b:GL_Bot) RETURN bThis query can be imported into BloodHound from the bots.json file.
List all users who can push to a branch.
MATCH p = (:GL_User)-[:GL_HasRole|GL_HasBaseRole|GL_InheritRole*1..]->(:GL_ProjectRole)-[:GL_CanPush]->(:GL_Branch {objectid:'GIT.PWN.GIFT/PROJECT/1/REPOSITORY/BRANCHES/MAIN'}) RETURN pThis query can be imported into BloodHound from the branch-push-rights.json file.
Returns branches built on Windows runners with a shell executor resulting in code execution as SYSTEM.
MATCH p = (:GL_Branch)-[:GL_BuildsAsSystem]->(:Computer) RETURN pThis query can be imported into BloodHound from the branches-built-as-system.json file.
List all users who can push to a branch which has an OIDC trust relationship.
MATCH p=(GL_Branch)-[:GL_CanAssumeIdentity]->(:AZServicePrincipal) RETURN pThis query can be imported into BloodHound from the federated-identities.json file.
Displays the GitLab group hierarchy.
MATCH p = (:GL_Instance)-[:GL_HasGroup]->(:GL_Group)-[:GL_MemberOf|GL_InvitedTo*0..]->(:GL_Group) RETURN pThis query can be imported into BloodHound from the group-hierarchy.json file.
Returns all external identities (e.g., Active Directory or Entra ID users) that are associated with GitLab users.
MATCH p = ()-[:GL_SyncedTo]->(u:GL_User) RETURN pThis query can be imported into BloodHound from the hybrid-identities.json file.
Returns all GitLab instance administrators.
MATCH p = (:GL_User)-[:GL_HasRole|GL_HasBaseRole]->(:GL_InstanceRole {short_name: 'admin'}) RETURN pThis query can be imported into BloodHound from the instance-admins.json file.
Displays the GitLab instance role hierarchy.
MATCH p = (:GL_InstanceRole)-[:GL_HasBaseRole]->(:GL_InstanceRole) RETURN pThis query can be imported into BloodHound from the instance-role-hierarchy.json file.
Returns all external identities (e.g., Active Directory or Entra ID users) that have GitLab administrator privileges.
MATCH p = ()-[:GL_SyncedTo]->(:GL_User)-[:GL_HasRole|GL_HasBaseRole]->(:GL_InstanceRole {short_name: 'admin'}) RETURN pThis query can be imported into BloodHound from the privileged-hybrid-identities.json file.
Return possible Renovate project configurations based on defined CI/CD jobs.
MATCH (p:GL_Project) WHERE p.renovate_config <> '' RETURN pThis query can be imported into BloodHound from the renovate-bot-configuration-projects.json file.
Return possible takeover of Renovate bots configured with auto discovery.
MATCH p = ()-[:GL_RenovateInviteAndTakeover]->() RETURN pThis query can be imported into BloodHound from the renovate-bot-takeover.json file.
Return possible Renovate bot users, based on branch push heuristics.
MATCH (u:GL_User {renovate:true}) RETURN uThis query can be imported into BloodHound from the renovate-bot-users.json file.
Returns runners that are configured with a shell executor.
MATCH p = (:GL_Runner)-[:GL_ManagedBy]->(:GL_RunnerManager {executor:'shell'}) RETURN pThis query can be imported into BloodHound from the shell-runners.json file.
Any user can sign-up and create an account without administrator approval.
MATCH p = (:GL_InstanceRole {short_name:'noauth'})-[:GL_CanSignUp {require_admin_approval:false}]->(:GL_Instance) RETURN pThis query can be imported into BloodHound from the signup-restrictions.json file.
Returns all branches a user can push to.
MATCH p = (:GL_User {username:'root'})-[:GL_HasRole|GL_HasBaseRole|GL_InheritRole*1..]->(:GL_ProjectRole)-[:GL_CanPush]->(:GL_Branch) RETURN pThis query can be imported into BloodHound from the user-push-rights.json file.
Return all GitLab users which do not have a second authentication factor configured (within GitLab).
MATCH (u:GL_User) WHERE u.two_factor_enabled = false RETURN uThis query can be imported into BloodHound from the users-without-2fa.json file.