← Back to Pull requests

docs: Mention immutable subject claims #1787

Merged
pavelzw merged 1 files (57 lines) on Oct 27, 2026 19:10 UTC
View on GitHub
pavelzw pavelzw commented on Oct 21, 2026 08:43 UTC
Author

a couple of months ago, github introduced immutable subject claims: https://github.blog/changelog/2026-04-23-immutable-subject-claims-for-github-actions-oidc-tokens/

we should adjust the readme to use those as they are the new default.

Diff: 57 lines (+55 / -2) across 1 files Reviewer: jmeridth Review duration: 9266m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.27) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.27 · 57 lines diff across 1 files
0.27
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.75 · 5 substantive comment(s)
0.75
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
85%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.243
Real PR Conversation Timeline
10 items
pavelzw pavelzw commented on Oct 21, 2026 08:44 UTC
Author

@jmeridth could you take a look at this PR?

cpanato cpanato commented on code on Oct 21, 2026 15:03 UTC
Code Review
README.md:1
@@ -123,8 +136,9 @@ recreated under a deleted one's name does not inherit its access. Get an ID with
 To rename a repository scoped by name, rename it first, then update
 `repositories` right away. Adding the new name ahead of the rename breaks the
 policy: GitHub refuses the whole token request while any listed repository does
-not exist. Patterns on the repository name, such as `subject`, change on rename
-too. Matching the `repository_id` claim, as above, avoids that.
+not exist. Subjects that contain only the repository name change on rename
+too. Using [immutable subject claims](https://docs.github.com/en/actions/reference/security/oidc#immutable-subject-claims),
+as above, or matching the `repository_id` claim avoids that.

:robot: (medium)
Thanks for writing this up! I think immutable subjects still break on rename, because the subject keeps the owner and repo names next to the IDs (repo:chainguard-dev@87436699/foo@123456789). Matching repository_id or using repository_ids survives a rename, but an exact subject doesn't. What do you think about dropping "Using immutable subject claims, as above" from this sentence?

cpanato cpanato commented on code on Oct 21, 2026 15:03 UTC
Code Review
README.md:1
@@ -105,9 +120,7 @@ instead of by name with `repositories`. A policy sets at most one of the two.
 # yaml-language-server: $schema=https://raw.githubusercontent.com/octo-sts/app/refs/heads/main/pkg/octosts/octosts.OrgTrustPolicy.json
 
 issuer: https://token.actions.githubusercontent.com
-subject_pattern: "repo:chainguard-dev/[^:]+:ref:refs/heads/main"
-claim_pattern:
-  repository_id: "123456789"
+subject: repo:chainguard-dev@87436699/foo@123456789:ref:refs/heads/main

:robot: (medium)
Existing repos keep the name-only subject unless someone opts in, so a copied example like this one won't match their tokens. Could the immutable subject go in as a second example next to the current one? This org example also used to show subject_pattern with a repository_id claim across the org, which seems worth keeping.

cpanato cpanato commented on code on Oct 21, 2026 15:05 UTC
Code Review
README.md:1
@@ -105,9 +120,7 @@ instead of by name with `repositories`. A policy sets at most one of the two.
 # yaml-language-server: $schema=https://raw.githubusercontent.com/octo-sts/app/refs/heads/main/pkg/octosts/octosts.OrgTrustPolicy.json
 
 issuer: https://token.actions.githubusercontent.com
-subject_pattern: "repo:chainguard-dev/[^:]+:ref:refs/heads/main"
-claim_pattern:
-  repository_id: "123456789"
+subject: repo:chainguard-dev@87436699/foo@123456789:ref:refs/heads/main

:robot: (medium)
Some more context: per GitHub's changelog, only repos created, renamed or transferred after July 15, 2026 get the immutable subject by default, and older repos keep repo:owner/name:... until someone opts in. The same applies to the examples at lines 70 and 502. A copied policy fails closed rather than opening access, but users of older repos would see token exchanges fail with no obvious reason. Would it make sense to show both forms and note which repos emit which?

jmeridth jmeridth commented on Oct 22, 2026 14:23 UTC
Contributor

@jmeridth could you take a look at this PR?

@pavelzw @cpanato beat me to it 😄.

pavelzw pavelzw commented on Oct 26, 2026 06:22 UTC
Author

@jmeridth could you take another look?

jmeridth jmeridth commented on code on Oct 27, 2026 15:38 UTC
Code Review
README.md:1
@@ -644,7 +695,9 @@ To ensure secure and effective use of octo-sts, follow these recommended practic
 
 - **Regular policy reviews**: Periodically review and audit your trust policies (`.github/chainguard/*.sts.yaml`) to ensure they still align with your security requirements.
 
-- **Use specific subject matching**: Prefer exact subject matches over broad patterns when possible. For example, use `repo:org/repo:ref:refs/heads/main` instead of `repo:org/repo:.*`.
+- **Use specific subject matching**: Prefer exact subject matches over broad patterns when possible. For example, use `repo:org@<org-id>/repo@<repo-id>:ref:refs/heads/main` instead of `repo:org@<org-id>/repo@<repo-id>:.*`.
+
+- **Use immutable subject claims**: For GitHub Actions, enable [immutable subject claims](https://docs.github.com/en/actions/reference/security/oidc#immutable-subject-claims) so a policy cannot be satisfied by a different repository or organization that reuses the same name.

:robot: (low, non-blocking)
Turning the setting on for an existing repo switches its tokens to the immutable subject right away, so any name-only policy stops matching until it's updated. Maybe worth saying so here, since this bullet is what people skim?

- **Use immutable subject claims**: For GitHub Actions, enable [immutable subject claims](https://docs.github.com/en/actions/reference/security/oidc#immutable-subject-claims) so a policy cannot be satisfied by a different repository or organization that reuses the same name. On an existing repository, update its trust policies to the immutable subject at the same time, since tokens stop matching name-only subjects once the setting is on.

jmeridth jmeridth commented on Oct 27, 2026 15:38 UTC
Reviewer

:robot: (summary)
LGTM, thanks for reworking this. Keeping the name-only examples and adding the immutable form next to them reads well, and cpanato's two points look covered by 9d2764d. One small note inline on the best-practices bullet.

jmeridth jmeridth approved these changes on Oct 27, 2026 18:12 UTC
Approved Reviewer

:robot: (summary)
Thanks for applying the suggestion. LGTM.

Reviewers
Assignees
pavelzw pavelzw
Labels
risk: low confidence: 85.1% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 27.3% (LOW) · Higher = larger blast radius
27.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 85.1% · Lower = rushed or shallow review
85.1%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 4.1% · Safe to merge
4.1%
Repository