Skip to content

Commit 086d027

Browse files
authored
Merge pull request #1806 from tkatila/workflow-add-release-signing
workflow: sign release containers
2 parents a91d43a + b300594 commit 086d027

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

.github/workflows/devel.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848

4949
# devel image push
5050
publish:
51+
permissions:
52+
contents: read
53+
id-token: write
5154
needs:
5255
- e2e
5356
- build

.github/workflows/lib-publish.yaml

+25-5
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ on:
66
default: "devel"
77
required: false
88
type: string
9+
registry:
10+
default: "docker.io/intel"
11+
required: false
12+
type: string
913
env:
1014
no_base_check: "['intel-qat-plugin-kerneldrv', 'intel-idxd-config-initcontainer', 'crypto-perf', 'opae-nlb-demo']"
1115

1216
permissions:
1317
contents: read
18+
id-token: write
1419

1520
jobs:
1621
image:
1722
name: Build image
18-
runs-on: ubuntu-24.04
23+
runs-on: ubuntu-22.04
24+
permissions:
25+
contents: read
26+
id-token: write
1927
strategy:
2028
fail-fast: false
2129
matrix:
@@ -52,21 +60,33 @@ jobs:
5260
env:
5361
IMAGE_NAME: ${{ matrix.image }}
5462
run: |
55-
REG=intel/ make ${IMAGE_NAME} BUILDER=docker
63+
ORG=${{ inputs.registry }} TAG=${{ inputs.image_tag }} make ${IMAGE_NAME} BUILDER=docker
5664
- name: Trivy scan for image
5765
uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # 0.24.0
5866
with:
5967
scan-type: image
60-
image-ref: intel/${{ matrix.image }}:${{ inputs.image_tag }}
68+
image-ref: ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
6169
exit-code: 1
6270
- name: Test image base layer
6371
# Don't run base layer check for selected images
6472
if: ${{ !contains(fromJson(env.no_base_check), matrix.image) }}
65-
run: IMG=intel/${{ matrix.image }}:${{ inputs.image_tag }} make test-image-base-layer BUILDER=docker
73+
run: IMG=${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }} make test-image-base-layer BUILDER=docker
6674
- name: Login
6775
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
6876
with:
6977
username: ${{ secrets.DOCKERHUB_USER }}
7078
password: ${{ secrets.DOCKERHUB_PASS }}
7179
- name: Push
72-
run: docker push intel/${{ matrix.image }}:${{ inputs.image_tag }}
80+
run: docker push ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }}
81+
- name: Get image digest
82+
if: ${{ inputs.image_tag != 'devel' }}
83+
id: digest
84+
run: |
85+
echo "image_sha=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ inputs.registry }}/${{ matrix.image }}:${{ inputs.image_tag }})" >> $GITHUB_OUTPUT
86+
- name: Install cosign
87+
if: ${{ inputs.image_tag != 'devel' }}
88+
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 #v3.6.0
89+
- name: Keyless image sign
90+
if: ${{ inputs.image_tag != 'devel' }}
91+
run: |
92+
cosign sign --yes ${{ steps.digest.outputs.image_sha }}

.github/workflows/release.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535

3636
build:
3737
name: Build & Publish
38+
permissions:
39+
contents: read
40+
id-token: write
3841
needs:
3942
- trivy
4043
- tag_fix

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Table of Contents
3131
* [Supported Kubernetes versions](#supported-kubernetes-versions)
3232
* [Release procedures](#release-procedures)
3333
* [Pre-built plugin images](#pre-built-plugin-images)
34+
* [Signed container images](#signed-container-images)
3435
* [License](#license)
3536
* [Helm charts](#helm-charts)
3637

@@ -291,6 +292,12 @@ the branches and releases in this repository.
291292
[imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#updating-images)
292293
```IfNotPresent``` and can be changed with ```scripts/set-image-pull-policy.sh```.
293294

295+
### Signed container images
296+
297+
Starting from 0.31 release, the images (`0.31.0` etc., not `devel`) are signed with keyless signing using `cosign`. The signing proof is stored in [rekor.sigstore.dev](https://rekor.sigstore.dev) in an append-only transparency log. The signature is also stored within the dockerhub.
298+
299+
To verify the signing in Kubernetes, one can use [policy managers](https://docs.sigstore.dev/policy-controller/overview/) with [keyless authorities](https://docs.sigstore.dev/policy-controller/overview/#configuring-keyless-authorities).
300+
294301
## License
295302

296303
All of the source code required to build intel-device-plugins-for-kubernetes

0 commit comments

Comments
 (0)