Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-all-repo-admin-role.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_all_repo_admin_role",
"name": "GitHub: Tier Zero All-Repo Admin Role",
"description": "The synthetic all_repo_admin role grants admin access to every repository in the organization. This role is inherited by the owners role via GH_HasBaseRole and cascades admin permissions including branch protection editing, secret access, and deploy key management to all repositories.",
"cypher": "MATCH (n:GH_OrgRole)\nWHERE n.name CONTAINS 'all_repo_admin'\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_app_installations_all_repos",
"name": "GitHub: Tier Zero App Installations (All Repositories)",
"description": "GitHub App installations scoped to all repositories in the organization that have repository-control write permissions. A compromised app credential may grant code, workflow, Actions, or administrative control across every repository. Installations with only read or lower-impact write permissions are excluded.",
"cypher": "MATCH (n:GH_AppInstallation)-[:GH_CanAccess]->(:GH_Scope {scope_type:'repository', scope:'all'})\nWHERE ANY(permission IN n.permissions WHERE permission IN ['contents:write', 'administration:write', 'workflows:write', 'actions:write'])\nRETURN n",
Expand Down
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-apps-all-repos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_apps_all_repos",
"name": "GitHub: Tier Zero Apps (All-Repository Installations)",
"description": "GitHub App definitions whose installations have repository-control write permissions across all repositories. The app owner controls the private key that can generate tokens for any installation. Compromise of the app's private key may grant code, workflow, Actions, or administrative control across every repository in organizations where it is installed. Apps whose installations have only read or lower-impact write permissions are excluded.",
"cypher": "MATCH (n:GH_App)-[:GH_InstalledAs]->(i:GH_AppInstallation)-[:GH_CanAccess]->(:GH_Scope {scope_type:'repository', scope:'all'})\nWHERE ANY(permission IN i.permissions WHERE permission IN ['contents:write', 'administration:write', 'workflows:write', 'actions:write'])\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_enterprise_owners_role",
"name": "GitHub: Tier Zero Enterprise Owners Role",
"description": "The enterprise owners role grants administrative control over the GitHub Enterprise account, including enterprise organizations, members, identity provider configuration, and enterprise-wide security settings.",
"cypher": "MATCH (n:GH_EnterpriseRole {short_name:'owners'})\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_external_identities_owners",
"name": "GitHub: Tier Zero External Identities (Owner-Mapped)",
"description": "External identities from SAML/SCIM providers that map to GitHub users holding the owners role. Compromise of these external identities in the identity provider grants organizational owner access to GitHub via SSO.",
"cypher": "MATCH (n:GH_ExternalIdentity)-[:GH_MapsToUser]->(:GH_User)-[:GH_HasRole]->(:GH_OrgRole {short_name:'owners'})\nRETURN n",
Expand Down
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-organizations.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_organizations",
"name": "GitHub: Tier Zero Organizations",
"description": "GitHub organizations are the root trust boundary for all repositories, teams, users, and settings. Compromise of the organization grants full administrative control over all contained assets.",
"cypher": "MATCH (n:GH_Organization)\nRETURN n",
Expand Down
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-owner-users.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_owner_users",
"name": "GitHub: Tier Zero Owner Users",
"description": "Users who hold the organization owners role have full administrative control over the GitHub organization. Compromise of any owner account grants control over all repositories, secrets, SSO configuration, and cloud identities.",
"cypher": "MATCH (n:GH_User)-[:GH_HasRole]->(:GH_OrgRole {short_name:'owners'})\nRETURN n",
Expand Down
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-owners-role.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_owners_role",
"name": "GitHub: Tier Zero Owners Role",
"description": "The owners organization role grants full administrative control including all repository admin, member management, SSO configuration, app management, and billing. Owners inherit all_repo_admin, cascading admin access to every repository, secret, environment, and cloud identity in the organization.",
"cypher": "MATCH (n:GH_OrgRole {short_name:'owners'})\nRETURN n",
Expand Down
1 change: 1 addition & 0 deletions extension/privilege_zone_rules/t0-pats-all-repos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_pats_all_repos",
"name": "GitHub: Tier Zero PATs (All Repositories)",
"description": "Fine-grained personal access tokens scoped to all repositories in the organization that have repository-control write permissions. A single compromised token may grant code, workflow, Actions, or administrative control across every repository. PATs with only read or lower-impact write permissions are excluded.",
"cypher": "MATCH (n:GH_PersonalAccessToken {token_expired:false})-[:GH_CanAccess]->(:GH_Scope {scope_type:'repository', scope:'all'})\nWHERE ANY(permission IN n.repository_permissions WHERE permission IN ['contents:write', 'administration:write', 'workflows:write', 'actions:write'])\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_privilege_escalation_roles",
"name": "GitHub: Tier Zero Privilege Escalation Roles",
"description": "Custom organization roles with write_organization_custom_org_role permission can modify organization role definitions, including setting the base_role to inherit all_repo_admin. Since this permission only exists on custom organization roles, the holder can escalate the role they already hold — a guaranteed self-escalation path to full organizational control.",
"cypher": "MATCH (n:GH_OrgRole)-[:GH_WriteOrganizationCustomOrgRole]->(:GH_Organization)\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_privilege_escalation_users",
"name": "GitHub: Tier Zero Privilege Escalation Users",
"description": "Users who hold custom organization roles with write_organization_custom_org_role permission. These users can modify organization role definitions — including the role they hold — to set the base_role to all_repo_admin, granting themselves admin access to every repository in the organization.",
"cypher": "MATCH (n:GH_User)-[:GH_HasRole|GH_HasBaseRole*1..]->(:GH_OrgRole)-[:GH_WriteOrganizationCustomOrgRole]->(:GH_Organization)\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"key": "GH_t0_saml_identity_providers",
"name": "GitHub: Tier Zero SAML Identity Providers",
"description": "SAML identity providers control authentication for all organization members via SSO. Compromise of the identity provider grants the ability to impersonate any user, including organization owners, by manipulating SAML assertions or resetting credentials.",
"cypher": "MATCH (n:GH_SamlIdentityProvider)\nRETURN n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_actions_sha_pinning_not_required",
"name": "GitHub: Actions SHA Pinning Not Required",
"query": "MATCH (org:GH_Organization {actions_sha_pinning_required: false})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations that do not require SHA pinning for GitHub Actions. Without pinning, actions referenced by tag can be silently replaced with malicious versions."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/active-leaked-secrets.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_active_leaked_secrets",
"name": "GitHub: Active Leaked Secrets",
"query": "MATCH p=(:GH_Repository)-[:GH_Contains]->(alert:GH_SecretScanningAlert {state: 'open', validity: 'active'})\nRETURN p\nLIMIT 1000",
"description": "Finds secret scanning alerts that are both unresolved and confirmed active. These are valid, usable credentials committed to source code and represent an immediate compromise risk."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_advanced_security_disabled_new_repos",
"name": "GitHub: Advanced Security Disabled for New Repositories",
"query": "MATCH (org:GH_Organization {advanced_security_enabled_for_new_repositories: false})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where GitHub Advanced Security is not automatically enabled for new repositories. New repositories will lack code scanning, secret scanning, and other GHAS features."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/all-actions-allowed.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_all_actions_allowed",
"name": "GitHub: All GitHub Actions Allowed",
"query": "MATCH (org:GH_Organization {actions_allowed_actions: 'all'})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations that allow all GitHub Actions to run, including third-party actions from the marketplace. This creates supply chain risk if a malicious or compromised action is used."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/app-installations-all-repos.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_app_installations_all_repos",
"name": "GitHub: App Installations with Access to All Repositories",
"query": "MATCH (app:GH_AppInstallation {repository_selection: 'all'})\nRETURN app\nLIMIT 1000",
"description": "Finds GitHub App installations that have access to every repository in the organization. A compromised app credential would affect all repositories."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_admins_not_enforced",
"name": "GitHub: Branch Protection Rules - Admins Not Enforced",
"query": "MATCH p=(:GH_BranchProtectionRule {enforce_admins: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branch protection rules where administrators can bypass all protections. Admins can push directly, skip reviews, and override status checks on these branches."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_deletions_allowed",
"name": "GitHub: Branch Protection Rules - Deletions Allowed",
"query": "MATCH p=(:GH_BranchProtectionRule {allows_deletions: true})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds protected branches that can be deleted. Branch deletion can result in loss of code and removal of audit history."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_force_pushes",
"name": "GitHub: Branch Protection Rules - Force Pushes Allowed",
"query": "MATCH p=(:GH_BranchProtectionRule {allows_force_pushes: true})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where force pushes are allowed. Force pushes can rewrite commit history, potentially hiding malicious changes or destroying audit trails."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_no_code_owner_reviews",
"name": "GitHub: Branch Protection Rules - No Code Owner Reviews",
"query": "MATCH p=(:GH_BranchProtectionRule {require_code_owner_reviews: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where code owner reviews are not required. Changes to security-critical paths can be merged without authorization from the designated code owners."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_no_pr_reviews",
"name": "GitHub: Branch Protection Rules - No Pull Request Reviews Required",
"query": "MATCH p=(:GH_BranchProtectionRule {required_pull_request_reviews: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where pull request reviews are not required. Code can be merged directly without peer review, increasing the risk of undetected vulnerabilities or malicious changes."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_no_status_checks",
"name": "GitHub: Branch Protection Rules - No Status Checks Required",
"query": "MATCH p=(:GH_BranchProtectionRule {requires_status_checks: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where CI/CD status checks are not required before merging. Code with failing tests or security scans can be merged into protected branches."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_self_approval",
"name": "GitHub: Branch Protection Rules - Self-Approval Allowed",
"query": "MATCH p=(:GH_BranchProtectionRule {require_last_push_approval: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where the author of the last push can approve their own pull request. This allows a single person to both write and approve code changes."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_branch_protection_stale_reviews",
"name": "GitHub: Branch Protection Rules - Stale Reviews Not Dismissed",
"query": "MATCH p=(:GH_BranchProtectionRule {dismisses_stale_reviews: false})-[:GH_ProtectedBy]->(:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds branches where stale reviews are not dismissed when new commits are pushed. An attacker could get a review approved, then push additional malicious commits that inherit the stale approval."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/bypass-pr-requirements.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_bypass_pr_requirements",
"name": "GitHub: Users Who Can Bypass Pull Request Requirements",
"query": "MATCH p=(actor)-[:GH_BypassPullRequestAllowances]->(rule:GH_BranchProtectionRule)-[:GH_ProtectedBy]->(branch:GH_Branch)\nRETURN p\nLIMIT 1000",
"description": "Finds users and teams that can bypass pull request review requirements on protected branches. These actors can merge code without any reviews."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/dangerous-branch-perms.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_dangerous_branch_perms",
"name": "GitHub: Dangerous Branch Permissions",
"query": "MATCH p=(:GH_User)-[:GH_HasRole|GH_HasBaseRole|GH_MemberOf*1..]->(:GH_RepoRole)-[:GH_PushProtectedBranch|GH_BypassBranchProtection]-(r:GH_Repository)\nMATCH p1=(:GH_User)-[:GH_BypassPullRequestAllowances|GH_RestrictionsCanPush]->(rule:GH_BranchProtectionRule)-[:GH_ProtectedBy]->(b:GH_Branch)\nRETURN p,p1\nLIMIT 1000",
"description": "Identifies users with dangerous branch permissions in a GitHub organization, including bypass allowances on protection rules."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_default_repository_permissions",
"name": "GitHub: Organizations with default repository permission",
"query": "MATCH (o:GH_Organization)\nWHERE o.default_repository_permission <> 'none'\nRETURN o\nLIMIT 1000",
"description": "Returns organizations that have a default repository permission other than 'none'."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/demo-sso-to-cloud-round-trip.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_demo_sso_to_cloud_round_trip",
"name": "[Demo] SSO Round-Trip: Azure/Okta \u2192 GitHub \u2192 Cloud Identity",
"query": "MATCH p1=(extUser)-[:SyncedToGHUser]->(ghUser:GH_User)\nMATCH p2=(ghUser)-[:GH_HasRole|GH_HasBaseRole|GH_MemberOf*1..]->(:GH_RepoRole)-[:GH_WriteRepoContents]->(:GH_Repository)-[:GH_CanAssumeIdentity]->(cred:AZFederatedIdentityCredential)\nRETURN p1, p2\nLIMIT 1000",
"description": "The cloud-to-cloud pivot through GitHub: a compromised Azure or Okta identity syncs to a GitHub user via SSO. That GitHub user has write access to repositories configured with OIDC federation to Azure workload identities. The attacker pivots from one cloud identity through GitHub into a completely different Azure identity — crossing cloud boundaries twice in a single attack chain."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_dependabot_alerts_disabled_new_repos",
"name": "GitHub: Dependabot Alerts Disabled for New Repositories",
"query": "MATCH (org:GH_Organization {dependabot_alerts_enabled_for_new_repositories: false})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where Dependabot alerts are not enabled for new repositories. Vulnerable dependencies in new repositories will go undetected."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_dependabot_updates_disabled_new_repos",
"name": "GitHub: Dependabot Security Updates Disabled for New Repositories",
"query": "MATCH (org:GH_Organization {dependabot_security_updates_enabled_for_new_repositories: false})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where Dependabot security update PRs are not enabled for new repositories. Known vulnerable dependencies will not receive automated fix PRs."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_dependency_graph_disabled_new_repos",
"name": "GitHub: Dependency Graph Disabled for New Repositories",
"query": "MATCH (org:GH_Organization {dependency_graph_enabled_for_new_repositories: false})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where the dependency graph is not enabled for new repositories. Without the dependency graph, transitive dependency vulnerabilities cannot be tracked."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/environments-admin-bypass.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_environments_admin_bypass",
"name": "GitHub: Environments Where Admins Can Bypass Protections",
"query": "MATCH p=(:GH_Repository)-[:GH_Contains]->(env:GH_Environment {can_admins_bypass: true})\nRETURN p\nLIMIT 1000",
"description": "Finds deployment environments where administrators can bypass protection rules such as required reviewers and wait timers. Admins can deploy to these environments without any approval."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/expired-pats.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_expired_pats",
"name": "GitHub: Expired Personal Access Tokens",
"query": "MATCH (token)\nWHERE (token:GH_PersonalAccessToken AND token.token_expired = true) OR (token:GH_ClassicPersonalAccessToken AND token.credential_state = 'expired')\nOPTIONAL MATCH p=(:GH_User)-[:GH_HasPersonalAccessToken]->(token)\nRETURN token, p\nLIMIT 1000",
"description": "Finds expired fine-grained and classic personal access tokens, including tokens whose owner could not be resolved. Expired tokens should be cleaned up to reduce credential inventory and audit noise."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_external_identities_without_scim",
"name": "GitHub: External Identities Without SCIM Provisioning",
"query": "MATCH (ei:GH_ExternalIdentity)\nWHERE ei.scim_identity_username = ''\nRETURN ei\nLIMIT 1000",
"description": "Finds external identities that lack SCIM synchronization. Without SCIM, user deprovisioning in the identity provider will not automatically revoke GitHub access."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/github-to-azure-identity.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_github_to_azure_identity",
"name": "GitHub: GitHub-to-Azure Identity Assumptions",
"query": "MATCH p=(src)-[:GH_CanAssumeIdentity]->(cred:AZFederatedIdentityCredential)\nRETURN p\nLIMIT 1000",
"description": "Finds GitHub entities (repositories, branches, environments) that can assume Azure identities via OIDC federation. Verify that each trust relationship is intentional and scoped appropriately."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/global-repo-perms.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_global_repo_perms",
"name": "GitHub: Global Repo Permissions",
"query": "MATCH p=(:GH_User)-[:GH_HasBaseRole|GH_HasRole|GH_MemberOf*1..3]->(role:GH_OrgRole)\nWHERE role.short_name CONTAINS 'all_repo_'\nRETURN p\nLIMIT 1000",
"description": "Returns all users who hold a global repository permission role (i.e., roles that are not default)."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/hybrid-identities.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_hybrid_identities",
"name": "GitHub: External Identities",
"query": "MATCH p=(s)-[]->(d:GH_User)\nWHERE s:AZUser\nOR s:Okta_User\nRETURN p\nLIMIT 1000",
"description": "Returns all external identities (e.g., Azure or Okta users) that are associated with GitHub users."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_members_can_change_repo_visibility",
"name": "GitHub: Members Can Change Repository Visibility",
"query": "MATCH (org:GH_Organization {members_can_change_repo_visibility: true})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where members can change repository visibility. This allows any member to make a private repository public, potentially exposing source code and secrets."
Expand Down
1 change: 1 addition & 0 deletions extension/saved_searches/members-can-create-pages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_members_can_create_pages",
"name": "GitHub: Members Can Create GitHub Pages",
"query": "MATCH (org:GH_Organization {members_can_create_pages: true})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where members can create GitHub Pages sites. Pages can be used to host phishing content, data exfiltration endpoints, or other malicious resources."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"query_key": "GH_members_can_create_public_repos",
"name": "GitHub: Members Can Create Public Repositories",
"query": "MATCH (org:GH_Organization {members_can_create_public_repositories: true})\nRETURN org\nLIMIT 1000",
"description": "Finds organizations where members can create internet-facing public repositories. This increases the risk of accidental exposure of proprietary code or secrets."
Expand Down
Loading