-
Notifications
You must be signed in to change notification settings - Fork 1
BED-9677: model workflow job interception by runners #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jaredcatkinson
merged 18 commits into
main
from
feature/BED-9677-runner-job-interception
Sep 8, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5938e29
BED-9674: link workflow jobs to eligible runners
jaredcatkinson 7d89b3c
Merge pull request #58 from jaredcatkinson/feature/BED-9674-link-work…
jaredcatkinson 11e7731
BED-9674: suppress runner matches when actions disabled
jaredcatkinson 2b939b7
Merge pull request #60 from jaredcatkinson/feature/BED-9674-link-work…
jaredcatkinson ddc6f46
BED-9674: normalize self-hosted selector casing
jaredcatkinson 914b0a3
Merge remote-tracking branch 'upstream/feature/BED-9674-link-workflow…
jaredcatkinson 682c93a
BED-9675: model effective GitHub token permissions
jaredcatkinson d0a366c
Merge pull request #61 from jaredcatkinson/feature/BED-9675-effective…
jaredcatkinson d974094
BED-9675: address workflow permission review feedback
jaredcatkinson 9cbdf2b
Merge pull request #63 from jaredcatkinson/feature/BED-9675-effective…
jaredcatkinson 0b37c09
BED-9677: model workflow job interception by runners
jaredcatkinson 80dc31e
BED-9677: preserve inherited runner group restriction lookup
jaredcatkinson 88725c7
Merge upstream/main into feature/BED-9674-link-workflow-jobs-runners
jaredcatkinson 42a934c
Merge upstream/main into feature/BED-9675-effective-github-token-perm…
jaredcatkinson 71ce547
Merge feature/BED-9674-link-workflow-jobs-runners into feature/BED-96…
jaredcatkinson 13b104e
BED-9675: clarify workflow job permission docs
jaredcatkinson 99b40c0
Merge feature/BED-9675-effective-github-token-permissions into featur…
jaredcatkinson dfb2685
BED-9677: clarify dynamic runner interception status
jaredcatkinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # GH_CanAccessSecret | ||
|
|
||
| ## General Information | ||
|
|
||
| The traversable GH_CanAccessSecret edge represents that a GitHub Actions workflow job execution context can access a statically referenced secret. | ||
|
|
||
| This edge is derived from the existing non-traversable GH_UsesSecret relationships on the job's contained steps and from job-level `env` declarations. It is intended for attack-path analysis from a compromised job execution context to the secrets that context can read. | ||
|
|
||
| The collector only emits this edge when one of the workflow job's modeled steps or the job's `env` block statically references the secret. The existence of a secret in the repository, organization, or environment scope alone is not enough. For this initial implementation, secrets passed through `jobs.<job_id>.secrets` to reusable workflows are retained as structural references but are not projected as runtime access for the caller job. | ||
|
|
||
| ## Edge Schema | ||
|
|
||
| | Source | Destination | Traversable | | ||
| | --- | --- | --- | | ||
| | `GH_WorkflowJob` | `GH_EnvironmentSecret` | `true` | | ||
| | `GH_WorkflowJob` | `GH_OrgSecret` | `true` | | ||
| | `GH_WorkflowJob` | `GH_RepoSecret` | `true` | | ||
|
|
||
| ## Diagram | ||
|
|
||
| ```mermaid | ||
| graph LR | ||
| n0["GH_WorkflowJob"] | ||
| n1["GH_EnvironmentSecret"] | ||
| n2["GH_OrgSecret"] | ||
| n3["GH_RepoSecret"] | ||
| n0 -->|GH_CanAccessSecret| n1 | ||
| n0 -->|GH_CanAccessSecret| n2 | ||
| n0 -->|GH_CanAccessSecret| n3 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # GH_CanInterceptJob | ||
|
|
||
| ## General Information | ||
|
|
||
| The traversable GH_CanInterceptJob edge represents that a self-hosted runner not explicitly marked ephemeral can intercept a GitHub Actions workflow job that GitHub could schedule on it. | ||
|
|
||
| This edge is derived from GH_RunsOn and is intended for attack-path analysis. It does not mean that the job has historically executed on the runner. It means that control of the runner may expose the future execution context of the job when the runner is not ephemeral. | ||
|
|
||
| The collector does not emit this edge for runners GitHub explicitly marks as ephemeral. | ||
|
|
||
| ## Edge Schema | ||
|
|
||
| | Source | Destination | Traversable | | ||
| | --- | --- | --- | | ||
| | `GH_Runner` | `GH_WorkflowJob` | `true` | | ||
|
|
||
| ## Diagram | ||
|
|
||
| ```mermaid | ||
| graph LR | ||
| n0["GH_Runner"] | ||
| n1["GH_WorkflowJob"] | ||
| n0 -->|GH_CanInterceptJob| n1 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # GH_RunsOn | ||
|
|
||
| ## General Information | ||
|
|
||
| The non-traversable GH_RunsOn edge represents that a GitHub Actions workflow job can be scheduled on a self-hosted runner based on the job's statically declared `runs-on` selector and the runner topology visible to the containing repository. | ||
|
|
||
| This edge is schedulability evidence, not historical execution evidence. It does not mean that the job has previously executed on the runner. It means that the runner satisfies the job's static label and runner-group requirements and is reachable through the repository's current runner access policy. | ||
|
|
||
| The collector emits GH_RunsOn only for static selectors. Dynamic selectors that contain GitHub Actions expressions such as `${{ matrix.runner }}` or `${{ inputs.runner }}` are intentionally left unresolved in this first implementation. | ||
|
|
||
| ## Edge Schema | ||
|
|
||
| | Source | Destination | Traversable | | ||
| | --- | --- | --- | | ||
| | `GH_WorkflowJob` | `GH_Runner` | `false` | | ||
|
|
||
| ## Diagram | ||
|
|
||
| ```mermaid | ||
| graph LR | ||
| n0["GH_WorkflowJob"] | ||
| n1["GH_Runner"] | ||
| n0 -.->|GH_RunsOn| n1 | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Use effective permissions for the GITHUB_TOKEN impact.
The resolver in
src/openhound_github/models/workflow.pyapplies repository defaults, workflow permissions, and job permissions. The attack-impact text at Line 38 still says thatGITHUB_TOKENhas the workflow's declared permissions. Update that text to reference the job's calculatedeffective_github_token_permissions, so the documented token access matches the graph model.Proposed wording
🧰 Tools
🪛 LanguageTool
[uncategorized] ~44-~44: The official name of this software platform is spelled with a capital “H”.
Context: ...if the pwn-requestable job's calculated
effective_github_token_permissionsincludes `id-token:w...(GITHUB)
[uncategorized] ~44-~44: The official name of this software platform is spelled with a capital “H”.
Context: ...sions
on GH_WorkflowJob, and the job'seffective_github_token_permissions` to understand how th...(GITHUB)
🤖 Prompt for AI Agents