Skip to content

Commit 30aa015

Browse files
Sync from github/github-well-architected-internal (main)
Source Repository: github/github-well-architected-internal Source Branch: main Source SHA: 5bbd17ea6b2a1eb92b652b6fd41c5e9cad33802d
1 parent 4c3ae95 commit 30aa015

File tree

1 file changed

+5
-2
lines changed
  • content/library/application-security/recommendations/actions-security

1 file changed

+5
-2
lines changed

content/library/application-security/recommendations/actions-security/index.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To secure GitHub Actions workflows, consider the following strategies:
9393

9494
## Assumptions and preconditions
9595

96-
This article assumes readers are familiar with [GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions/about-github-actions/understanding-github-actions) and have experience creating and managing workflows. It also assumes a basic understanding of security best practices and concepts such as authentication and authorization.
96+
This article assumes readers are familiar with [GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions/about-github-actions/understanding-github-actions) and have experience creating and managing workflows. It also assumes a basic understanding of security best practices and concepts such as authentication, authorization, and OIDC.
9797

9898
## Recommended implementation
9999

@@ -110,7 +110,9 @@ When [configuring OIDC trust relationships with cloud providers](https://docs.gi
110110
- **`sub` claim**: The primary OIDC subject identifier, uniquely representing the repository that requested the token. Use this claim to restrict access to specific repositories and environments. Prefer an exact match on a complete claim instead of wildcard matches.
111111
- **`job_workflow_ref` claim**: Specifies the exact workflow file path and commit SHA. Note that only a limited number of cloud providers support this custom claim (e.g. [Azure](https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-flexible-federated-identity-credentials?tabs=github)).
112112

113-
Use the most specific claims possible when establishing the trust relationship to prevent unauthorized access—even from legitimate repositories.
113+
Define the most granular trust conditions wherever possible to prevent unauthorized access, even from legitimate repositories. [Customize the `sub` claim](https://docs.github.com/en/enterprise-cloud@latest/actions/reference/security/oidc#customizing-the-token-claims) when the cloud provider's OIDC implementation does not support matching **custom claims** or you need immutable identifiers in the `sub`.
114+
115+
- Prefer **immutable identifiers** (e.g., `repository_owner_id:12345:repository_id:67890`) over mutable ones (e.g., `repo:github/some-repo`).
114116

115117
#### Scaling with reusable workflows
116118

@@ -280,6 +282,7 @@ Specific helpful articles:
280282
- [Security Hardening for GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions)
281283
- [Self-hosted runner security](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners#self-hosted-runner-security)
282284
- [Events that trigger workflows](https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows)
285+
- [OIDC token claims](https://docs.github.com/en/enterprise-cloud@latest/actions/reference/security/oidc#oidc-token-claims)
283286
- [Secure use reference](https://docs.github.com/en/enterprise-cloud@latest/actions/reference/security/secure-use)
284287

285288
### External Resources

0 commit comments

Comments
 (0)