Skip to content

Commit fe14077

Browse files
sabrowning1lecoursenjkylekelly
authored
Add content on immutable releases (#57225)
Co-authored-by: Laura Coursen <[email protected]> Co-authored-by: Kyle Kelly <[email protected]>
1 parent 58a6545 commit fe14077

File tree

11 files changed

+140
-6
lines changed

11 files changed

+140
-6
lines changed

content/actions/how-tos/create-and-publish-actions/manage-custom-actions.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ To use a specific action version, users can configure their {% data variables.pr
5656

5757
We recommend using tags for actions release management. Using this approach, your users can easily distinguish between major and minor versions:
5858

59-
* Create and validate a release on a release branch (such as `release/v1`) before creating the release tag (for example, `v1.0.2`).
60-
* Create a release using semantic versioning. For more information, see [AUTOTITLE](/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
61-
* Move the major version tag (such as `v1`, `v2`) to point to the Git ref of the current release. For more information, see [Git basics - tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
62-
* Introduce a new major version tag (`v2`) for changes that will break existing workflows. For example, changing an action's inputs would be a breaking change.
63-
* Major versions can be initially released with a `beta` tag to indicate their status, for example, `v2-beta`. The `-beta` tag can then be removed when ready.
59+
1. Create and validate a release on a release branch (such as `release/v1`) before creating the release tag (for example, `v1.0.2`).
60+
1. Create a release using semantic versioning. For more information, see [AUTOTITLE](/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
61+
1. Move the major version tag (such as `v1`, `v2`) to point to the Git ref of the current release. For more information, see [Git basics - tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging).
62+
63+
{% ifversion immutable-releases-preview %}
64+
> [!NOTE]
65+
> If you enable immutable releases, you can still move Git tags that are not linked to releases on {% data variables.product.github %}.
66+
{% endif %}
67+
68+
1. Introduce a new major version tag (`v2`) for changes that will break existing workflows. For example, changing an action's inputs would be a breaking change.
6469

6570
This example demonstrates how a user can reference a major release tag:
6671

content/actions/how-tos/create-and-publish-actions/release-and-maintain-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Here is an example process that you can follow to automatically run tests, creat
7272

7373
* When a release is published or edited, your release workflow will automatically take care of compilation and adjusting tags.
7474

75-
* We recommend creating releases using semantically versioned tags – for example, `v1.1.3` – and keeping major (`v1`) and minor (`v1.1`) tags current to the latest appropriate commit. For more information, see [AUTOTITLE](/actions/creating-actions/about-custom-actions#using-release-management-for-actions) and [About semantic versioning](https://docs.npmjs.com/about-semantic-versioning).
75+
* We recommend creating releases using semantically versioned tags – for example, `v1.1.3` – and keeping major (`v1`) and minor (`v1.1`) tags current to the latest appropriate commit. For more information, see [AUTOTITLE](/actions/how-tos/create-and-publish-actions/manage-custom-actions#using-release-management-for-actions) and [About semantic versioning](https://docs.npmjs.com/about-semantic-versioning).
7676

7777
### Results
7878

content/actions/how-tos/secure-your-work/use-artifact-attestations/use-artifact-attestations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,5 @@ gh attestation verify PATH/TO/YOUR/BUILD/ARTIFACT-BINARY \
190190
## Next steps
191191

192192
To keep your attestations relevant and manageable, you should delete attestations that are no longer needed. See [AUTOTITLE](/actions/how-tos/security-for-github-actions/using-artifact-attestations/managing-the-lifecycle-of-artifact-attestations).
193+
194+
You can also generate release attestations to help consumers verify the integrity and origin of your releases. For more information, see [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases).

content/code-security/supply-chain-security/end-to-end-supply-chain/securing-builds.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ How exactly you sign your build will depend on what sort of code you're writing,
5959

6060
For more information, see [AUTOTITLE](/actions/security-guides/encrypted-secrets){% ifversion fpt or ghec %}, [AUTOTITLE](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect),{% endif %} and [AUTOTITLE](/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners).
6161

62+
{% ifversion immutable-releases-preview %}
63+
64+
## Use immutable releases
65+
66+
If you are using release assets from other projects in your build system, or creating releases for your own work, you should reduce security risk by ensuring those releases are immutable, meaning they cannot be changed after publication. Immutable releases help prevent supply chain attacks and accidental breaking changes. For more information, see [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases).
67+
{% endif %}
68+
6269
## Harden security for {% data variables.product.prodname_actions %}
6370

6471
There are many further steps you can take to additionally secure {% data variables.product.prodname_actions %}. In particular, be careful when evaluating third-party workflows, and consider using `CODEOWNERS` to limit who can make changes to your workflows.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Immutable releases
3+
intro: 'Learn about immutable releases and how they can help you maintain the integrity of your software supply chain.'
4+
versions:
5+
feature: immutable-releases-preview
6+
type: overview
7+
topics:
8+
- Code Security
9+
- Vulnerabilities
10+
- Dependencies
11+
---
12+
13+
{% data reusables.releases.immutable-releases-preview-note %}
14+
15+
**Immutable releases** are releases where the assets and associated Git tag cannot be changed after publication. They increase security by blocking:
16+
* Supply chain attacks where attackers inject vulnerabilities or malware into current project releases
17+
* Accidental changes to assets and tags that may break developer workflows
18+
19+
Additionally, creating an immutable release automatically generates a **release attestation**, which is a cryptographically verifiable record of a release containing the release tag, commit SHA, and release assets. Consumers can use this attestation to make sure the releases and artifacts they are using exactly match the published {% data variables.product.github %} releases.
20+
21+
If a release is immutable, you will see "{% octicon "lock" aria-hidden="true" %} Immutable" below the title on the release page.
22+
23+
## Next steps
24+
25+
To learn how to enable immutable releases for your repository or organization, see [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/preventing-changes-to-your-releases).
26+
27+
To learn how to ensure a release and local assets have not been changed, see [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/verifying-the-integrity-of-a-release).

content/code-security/supply-chain-security/understanding-your-software-supply-chain/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ children:
2323
- /enforcing-dependency-review-across-an-organization
2424
- /exploring-the-dependencies-of-a-repository
2525
- /troubleshooting-the-dependency-graph
26+
- /immutable-releases
27+
- /preventing-changes-to-your-releases
28+
- /verifying-the-integrity-of-a-release
2629
---
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Preventing changes to your releases
3+
shortTitle: Prevent release changes
4+
intro: 'You can enforce immutable releases for a repository or organization to prevent potential vulnerabilities.'
5+
versions:
6+
feature: immutable-releases-preview
7+
type: overview
8+
topics:
9+
- Code Security
10+
- Vulnerabilities
11+
- Dependencies
12+
---
13+
14+
{% data reusables.releases.immutable-releases-preview-note %}
15+
16+
## Enforcing immutable releases for your repository
17+
18+
{% data reusables.repositories.navigate-to-repo %}
19+
{% data reusables.repositories.sidebar-settings %}
20+
1. Scroll down to the "Releases" section, then select **Enable release immutability**. Be aware that immutability will only apply to future releases.
21+
22+
## Enforcing immutable releases for your organization
23+
24+
{% data reusables.organizations.navigate-to-org %}
25+
{% data reusables.organizations.org_settings %}
26+
1. In the "Code, planning, and automation" section of the sidebar, select the {% octicon "repo" aria-hidden="true" %} **Repository** dropdown menu, then click **General**.
27+
1. In the "Releases" section of the page, select the **No policy** {% octicon "triangle-down" aria-hidden="true" %} dropdown menu, then click either **All repositories** or **Selected repositories**. Be aware that immutability will only apply to future releases.
28+
1. If you chose **Selected repositories**, to the right of the dropdown menu, click {% octicon "gear" aria-label="Select repositories" %}. Select the repositories you want to include, then click **Select repositories**.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Verifying the integrity of a release
3+
shortTitle: Verify release integrity
4+
intro: 'You can avoid tampering and accidental changes by ensuring the releases you use have not been modified after publication.'
5+
versions:
6+
feature: immutable-releases-preview
7+
type: overview
8+
topics:
9+
- Code Security
10+
- Vulnerabilities
11+
- Dependencies
12+
defaultTool: cli
13+
---
14+
15+
{% data reusables.releases.immutable-releases-preview-note %}
16+
17+
{% cli %}
18+
19+
## Prerequisites
20+
21+
Before you can validate the authenticity of a release and its assets on the command line, you need to [install the {% data variables.product.prodname_cli %}](https://github.com/cli/cli?tab=readme-ov-file#installation).
22+
23+
## Verifying immutable releases and local artifacts
24+
25+
1. On the command line, open the repository containing the release you want to verify.
26+
1. To verify a release exists and is immutable, run the following command:
27+
28+
```bash copy
29+
gh release verify RELEASE-TAG
30+
```
31+
32+
1. To verify a local artifact is an exact match for a release asset, run the following command:
33+
34+
```bash copy
35+
gh release verify-asset RELEASE-TAG ARTIFACT-PATH
36+
```
37+
38+
> [!NOTE]
39+
> This command cannot be used to verify the source code zip file or tarball for a release, since these assets are only created when a download is requested.
40+
41+
{% endcli %}
42+
{% webui %}
43+
44+
{% data reusables.repositories.navigate-to-repo %}
45+
{% data reusables.repositories.releases %}
46+
1. To the left of the release you want to verify, below the release author, confirm that "{% octicon "lock" aria-hidden="true" %} Immutable" is present.
47+
48+
{% endwebui %}

content/repositories/releasing-projects-on-github/managing-releases-in-a-repository.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ If you @mention any {% data variables.product.github %} users in the notes, the
6767

6868
## Editing a release
6969

70+
{% ifversion immutable-releases-preview %}
71+
> [!NOTE]
72+
> If you have enabled immutable releases for your repository, you can only edit the title and release notes after a release is published. See [AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases).
73+
{% endif %}
74+
7075
{% webui %}
7176

7277
{% data reusables.repositories.navigate-to-repo %}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Reference: #18409
2+
# Documentation for the immutable releases public preview
3+
4+
versions:
5+
fpt: '*'
6+
ghec: '*'
7+
ghes: '>3.18'

0 commit comments

Comments
 (0)