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
4 changes: 3 additions & 1 deletion descriptions/edges/GH_CanEditProtection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## General Information

The traversable GH_CanEditProtection edge is a computed edge indicating that a role can modify or remove the branch protection rules governing a specific branch. This edge is emitted when the role has GH_EditRepoProtections or GH_AdminTo permissions and the branch is covered by at least one branch protection rule. The edge targets the protected branch (not the BPR itself) because the security impact is evaluated per-branch — a role that can weaken or remove protections on a branch can subsequently push code to it, representing a privilege escalation path.
The traversable GH_CanEditProtection edge is a computed edge indicating that a role can modify or remove branch protection rules in a repository. This edge is emitted when the role has GH_EditRepoProtections or GH_AdminTo permissions and the repository contains at least one protected branch. Repo-targeted edges model the repo-wide security impact for attack path traversal; branch-targeted edges are also emitted as supporting evidence for each protected branch governed by those rules.

## Scenarios

Expand All @@ -13,6 +13,7 @@ graph LR
role("GH_RepoRole admin") -->|GH_AdminTo| repo("GH_Repository")
repo -->|GH_HasBranch| branch("GH_Branch main")
bpr("GH_BranchProtectionRule") -->|GH_ProtectedBy| branch
role ==>|GH_CanEditProtection| repo
role ==>|GH_CanEditProtection| branch
```

Expand All @@ -25,5 +26,6 @@ graph LR
role("GH_RepoRole custom") -->|GH_EditRepoProtections| repo("GH_Repository")
repo -->|GH_HasBranch| branch("GH_Branch main")
bpr("GH_BranchProtectionRule") -->|GH_ProtectedBy| branch
role ==>|GH_CanEditProtection| repo
role ==>|GH_CanEditProtection| branch
```
2 changes: 1 addition & 1 deletion extension/privilege_zone_rules/t0-all-repo-admin-role.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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 ENDS\nWITH '/all_repo_admin'\nRETURN n",
"cypher": "MATCH (n:GH_OrgRole)\nWHERE n.name CONTAINS 'ALL_REPO_ADMIN'\nRETURN n",
"enabled": true,
"zone": "Tier Zero",
"allow_disable": true
Expand Down
4 changes: 2 additions & 2 deletions extension/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schema": {
"name": "SOGitHub",
"display_name": "GitHub Extension (by SpecterOps)",
"version": "v1.2.2",
"version": "v1.2.3",
"namespace": "GH"
},
"node_kinds": [
Expand Down Expand Up @@ -648,7 +648,7 @@
},
{
"name": "GH_CanEditProtection",
"description": "[Repository - Computed] Repo role can modify or remove the branch protection rules governing this branch (computed from GH_EditRepoProtections + GH_ProtectedBy)",
"description": "[Repository - Computed] Repo role can modify or remove branch protection rules for the repository/branch (computed from GH_EditRepoProtections + GH_ProtectedBy)",
"is_traversable": true
},
{
Expand Down