Skip to content

Commit 52f2d5b

Browse files
authored
Add a GitHub repository threat model for ty (#4481)
1 parent fd0d789 commit 52f2d5b

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
## Development
44

55
Parts of `.github/workflows/release.yml` are generated by cargo-dist from `dist-workspace.toml`. Before editing the release workflow, check whether the relevant section is generated. Prefer changing `dist-workspace.toml` or the referenced reusable workflow instead of editing generated YAML. After modifying cargo-dist configuration, regenerate the workflow with the cargo-dist version pinned in `dist-workspace.toml` and inspect the resulting diff to ensure the change will survive future regenerations.
6+
7+
## Security reviews
8+
9+
For reviews of this repository's GitHub automation, CI, and release process, use the [GitHub repository threat model](agents/references/repository-threat-model.md). The `ruff` submodule pins ty's Rust source for release builds; include it when tracing the source of release artifacts.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# GitHub repository threat model
2+
3+
## Overview
4+
5+
The GitHub repository holds source code, build and release workflows, and maintainer automation.
6+
7+
The repository-specific section below may add or override trust assumptions and boundaries. When it
8+
differs from a generic section, the repository-specific rule takes precedence for that repository.
9+
10+
A behavior is a security issue only when an independent attacker controls a concrete input,
11+
repository automation uses that input to cross a boundary defined below, and the crossing grants new
12+
power (such as repository write access), exposes publishing credentials or OpenID Connect (OIDC)
13+
tokens, compromises source history or release artifacts, or harms downstream users. Trusted-source
14+
compromise, intended behavior, and correctness defects that give an attacker no new power are not
15+
security issues.
16+
17+
## Trust boundaries and assumptions
18+
19+
Maintainers, their workflow dispatch inputs, reviewed changes, protected refs, repository settings,
20+
configured runners and environments, and explicitly trusted third-party actions are trusted. Changes
21+
from an untrusted contributor remain untrusted when a privileged workflow runs them before review.
22+
23+
First-party repositories used by automation are trusted sources when their relevant branches and
24+
workflow dispatches are restricted to trusted maintainers.
25+
26+
## CI and releases
27+
28+
Privileged workflows do not execute attacker-controlled code or promote attacker-controlled
29+
artifacts before review or explicit authorization. Untrusted code or refs must not run with
30+
privileged permissions or influence artifacts or other output consumed by a privileged step. The
31+
boundary is crossed when this gives the attacker a specific credential, permission, or privileged
32+
action that causes harm. The boundary depends on what starts each workflow, which code and artifacts
33+
each job accepts, and which permissions, credentials, and runners those jobs receive. Unpinned
34+
dependencies, mutable inputs, secret-shaped strings, and broad permissions do not cross it by
35+
themselves.
36+
37+
## Repository-specific additions
38+
39+
N/A
40+
41+
## Severity calibration
42+
43+
- **Critical:** With few prerequisites and safe defaults, a remote attacker or actor at a lower
44+
privilege level compromises releases or broad credentials without first compromising a declared
45+
trust root.
46+
- **High:** A complete, demonstrated path from independent attacker input crosses a stated integrity
47+
or privilege boundary, grants material new power, and causes substantial confidentiality or
48+
integrity harm. It cannot depend on a trusted maintainer selecting malicious input, trust-root
49+
compromise, or power the attacker already has. For example, a scheduled workflow automatically
50+
runs mutable third-party code with repository-write, publishing, or equivalent credentials.
51+
- **Medium:** A real but limited boundary crossing, an uncommon realistic setup, or limited
52+
credential or filesystem effect.
53+
- **Low:** A narrow safety gap, limited disclosure, or a robustness problem across a real but weak
54+
boundary.
55+
- **Informational:** A genuine **security** concern with no or negligible current impact.

0 commit comments

Comments
 (0)