Skip to content

Commit 6d25c89

Browse files
authored
Merge pull request #22488 from github/repo-sync
repo sync
2 parents 9b0537d + 945bff9 commit 6d25c89

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

content/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ After this setting is applied, the JWT will contain the updated `iss` value. In
283283

284284
To help improve security, compliance, and standardization, you can customize the standard claims to suit your required access conditions. If your cloud provider supports conditions on subject claims, you can create a condition that checks whether the `sub` value matches the path of the reusable workflow, such as `"job_workflow_ref: "octo-org/octo-automation/.github/workflows/oidc.yml@refs/heads/main""`. The exact format will vary depending on your cloud provider's OIDC configuration. To configure the matching condition on {% data variables.product.prodname_dotcom %}, you can can use the REST API to require that the `sub` claim must always include a specific custom claim, such as `job_workflow_ref`. You can use the [OIDC REST API](/rest/actions/oidc) to apply a customization template for the OIDC subject claim; for example, you can require that the `sub` claim within the OIDC token must always include a specific custom claim, such as `job_workflow_ref`.
285285

286+
{% note %}
287+
288+
**Note**: When the organization template is applied, it will not affect any workflows in existing repositories that already use OIDC. For existing repositories, as well as any new repositories that are created after the template has been applied, the repository owner will need to opt-in to receive this configuration, or alternatively could apply a different configuration specific to the repo. For more information, see "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)."
289+
290+
{% endnote %}
291+
286292
Customizing the claims results in a new format for the entire `sub` claim, which replaces the default predefined `sub` format in the token described in "[Example subject claims](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#example-subject-claims)."
287293

288294
The following example templates demonstrate various ways to customize the subject claim. To configure these settings on {% data variables.product.prodname_dotcom %}, admins use the REST API to specify a list of claims that must be included in the subject (`sub`) claim.
@@ -291,12 +297,6 @@ The following example templates demonstrate various ways to customize the subjec
291297

292298
To customize your subject claims, you should first create a matching condition in your cloud provider's OIDC configuration, before customizing the configuration using the REST API. Once the configuration is completed, each time a new job runs, the OIDC token generated during that job will follow the new customization template. If the matching condition doesn't exist in the cloud provider's OIDC configuration before the job runs, the generated token might not be accepted by the cloud provider, since the cloud conditions may not be synchronized.
293299

294-
{% note %}
295-
296-
**Note**: When the organization template is applied, it will not affect any action workflows in existing repositories that already use OIDC. For existing repositories, as well as any new repositories that are created after the template has been applied, the repository owner will need to opt-in to receive this configuration, or alternatively could apply a different configuration specific to the repo. For more information, see "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)."
297-
298-
{% endnote %}
299-
300300
#### Example: Allowing repository based on visibility and owner
301301

302302
This example template allows the `sub` claim to have a new format, using `repository_owner` and `repository_visibility`:
@@ -431,14 +431,28 @@ In your cloud provider's OIDC configuration, configure the `sub` condition to re
431431

432432
#### Using the default subject claims
433433

434-
For repositories that can receive a subject claim policy from their organization, the repository owner can later choose to opt-out and instead use the default `sub` claim format. To configure this, the repository admin must use the REST API endpoint at "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)" with the following request body:
434+
For repositories that can receive a subject claim policy from their organization, the repository owner can later choose to opt-out and instead use the default `sub` claim format. This means that the repository will not use the organization's customized template.
435+
436+
To configure the repository to use the default `sub` claim format, a repository admin must use the REST API endpoint at "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)" with the following request body:
435437

436438
```json
437439
{
438440
"use_default": true
439441
}
440442
```
441443

444+
#### Example: Configuring a repository to use an organization template
445+
446+
A repository administrator can configure their repository to use the template created by the administrator of their organisation.
447+
448+
To configure the repository to use the organization's template, a repository admin must use the REST API endpoint at "[Set the customization template for an OIDC subject claim for a repository](/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository)" with the following request body:
449+
450+
```json
451+
{
452+
"use_default": false
453+
}
454+
```
455+
442456
{% endif %}
443457

444458
## Updating your workflows for OIDC

0 commit comments

Comments
 (0)