|
17 | 17 | * [Secrets](#secrets-1) |
18 | 18 | * [Outputs](#outputs-1) |
19 | 19 | * [Notes](#notes) |
| 20 | + * [Signed GitHub Actions cache](#signed-github-actions-cache) |
20 | 21 | * [Runner mapping](#runner-mapping) |
21 | 22 | * [Metadata templates](#metadata-templates) |
22 | 23 |
|
|
48 | 49 | uses: docker/github-builder/.github/workflows/build.yml@v1 |
49 | 50 | permissions: |
50 | 51 | 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 |
52 | 53 | with: |
53 | 54 | output: image |
54 | 55 | push: ${{ github.event_name != 'pull_request' }} |
@@ -79,8 +80,10 @@ toward higher levels of security and trust. |
79 | 80 | * **Optimized cache warming & reuse.** |
80 | 81 | The builder can use the GitHub Actions cache backend to persist layers across |
81 | 82 | 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). |
84 | 87 |
|
85 | 88 | * **Centralized build configuration.** |
86 | 89 | Repositories no longer need to configure buildx drivers, tune storage, or |
@@ -118,6 +121,13 @@ toward higher levels of security and trust. |
118 | 121 | preventing untrusted workflow steps from modifying build logic, injecting |
119 | 122 | unexpected flags, or producing misleading provenance. |
120 | 123 |
|
| 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 | +
|
121 | 131 | ### Isolation & Reliability |
122 | 132 |
|
123 | 133 | * **Separation between user CI logic and build logic.** |
@@ -172,7 +182,7 @@ jobs: |
172 | 182 | uses: docker/github-builder/.github/workflows/build.yml@v1 |
173 | 183 | permissions: |
174 | 184 | 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 |
176 | 186 | with: |
177 | 187 | output: image |
178 | 188 | push: ${{ github.event_name != 'pull_request' }} |
@@ -286,7 +296,7 @@ jobs: |
286 | 296 | uses: docker/github-builder/.github/workflows/bake.yml@v1 |
287 | 297 | permissions: |
288 | 298 | 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 |
290 | 300 | with: |
291 | 301 | output: image |
292 | 302 | push: ${{ github.event_name != 'pull_request' }} |
@@ -368,6 +378,19 @@ with `builder-outputs: ${{ toJSON(needs.<job_id>.outputs) }}`. |
368 | 378 |
|
369 | 379 | ## Notes |
370 | 380 |
|
| 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 | + |
371 | 394 | ### Runner mapping |
372 | 395 |
|
373 | 396 | The `runner` input accepts either a single GitHub-hosted Linux runner label or a |
|
0 commit comments