Skip to content

Commit e7f5ab1

Browse files
committed
document signed GitHub Actions cache reuse
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 3b34e25 commit e7f5ab1

1 file changed

Lines changed: 28 additions & 5 deletions

File tree

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ___
1717
* [Secrets](#secrets-1)
1818
* [Outputs](#outputs-1)
1919
* [Notes](#notes)
20+
* [Signed GitHub Actions cache](#signed-github-actions-cache)
2021
* [Runner mapping](#runner-mapping)
2122
* [Metadata templates](#metadata-templates)
2223

@@ -48,7 +49,7 @@ jobs:
4849
uses: docker/github-builder/.github/workflows/build.yml@v1
4950
permissions:
5051
contents: read # to fetch the repository content
51-
id-token: write # for signing attestation(s) with GitHub OIDC Token
52+
id-token: write # for signing attestations and cache entries with GitHub OIDC
5253
with:
5354
output: image
5455
push: ${{ github.event_name != 'pull_request' }}
@@ -79,8 +80,10 @@ toward higher levels of security and trust.
7980
* **Optimized cache warming & reuse.**
8081
The builder can use the GitHub Actions cache backend to persist layers across
8182
branches, PRs, and rebuilds. This significantly reduces cold-start times and
82-
avoids repeating expensive dependency installations, even for external
83-
contributors' pull requests.
83+
avoids repeating expensive dependency installations. With GitHub OIDC
84+
available, cache entries are signed and verified before reuse so warm-cache
85+
builds do not accept unauthenticated cache contents as build inputs. See
86+
[Signed GitHub Actions cache](#signed-github-actions-cache).
8487
8588
* **Centralized build configuration.**
8689
Repositories no longer need to configure buildx drivers, tune storage, or
@@ -118,6 +121,13 @@ toward higher levels of security and trust.
118121
preventing untrusted workflow steps from modifying build logic, injecting
119122
unexpected flags, or producing misleading provenance.
120123
124+
* **Signed cache reuse.**
125+
With GitHub OIDC available, all GitHub Actions cache entries produced by these
126+
reusable workflows are signed and verified before import. This prevents cache
127+
entries produced outside the trusted workflow from being restored while still
128+
allowing cache warming and reuse. See
129+
[Signed GitHub Actions cache](#signed-github-actions-cache).
130+
121131
### Isolation & Reliability
122132
123133
* **Separation between user CI logic and build logic.**
@@ -172,7 +182,7 @@ jobs:
172182
uses: docker/github-builder/.github/workflows/build.yml@v1
173183
permissions:
174184
contents: read # to fetch the repository content
175-
id-token: write # for signing attestation(s) with GitHub OIDC Token
185+
id-token: write # for signing attestations and cache entries with GitHub OIDC
176186
with:
177187
output: image
178188
push: ${{ github.event_name != 'pull_request' }}
@@ -286,7 +296,7 @@ jobs:
286296
uses: docker/github-builder/.github/workflows/bake.yml@v1
287297
permissions:
288298
contents: read # to fetch the repository content
289-
id-token: write # for signing attestation(s) with GitHub OIDC Token
299+
id-token: write # for signing attestations and cache entries with GitHub OIDC
290300
with:
291301
output: image
292302
push: ${{ github.event_name != 'pull_request' }}
@@ -368,6 +378,19 @@ with `builder-outputs: ${{ toJSON(needs.<job_id>.outputs) }}`.
368378

369379
## Notes
370380

381+
### Signed GitHub Actions cache
382+
383+
When the workflow has GitHub OIDC available through `id-token: write`, BuildKit
384+
signs cache entries with Cosign and requires restored cache entries to match the
385+
expected workflow identity and source repository policy before import.
386+
387+
This verification matters because GitHub Actions cache is scoped to a
388+
repository, but repository writers can still create cache entries. For these
389+
reusable workflows, the Docker-owned workflow is the trusted build boundary.
390+
Without verification, a poisoned BuildKit cache could influence a later trusted
391+
build, which is the SLSA isolation concern described in
392+
[docker/github-builder#56](https://github.com/docker/github-builder/issues/56).
393+
371394
### Runner mapping
372395

373396
The `runner` input accepts either a single GitHub-hosted Linux runner label or a

0 commit comments

Comments
 (0)