-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign images using Sigstore #3707
Changes from 2 commits
d4a2a98
23769bf
d844b46
7c66e10
f91aaed
6499281
b2c1753
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,19 +4,29 @@ on: | |||||
# Random minute number to avoid GH scheduler stampede | ||||||
- cron: '37 21 * * *' | ||||||
workflow_dispatch: {} | ||||||
permissions: | ||||||
contents: read | ||||||
packages: write | ||||||
|
||||||
env: | ||||||
NIGHTLY: true | ||||||
|
||||||
jobs: | ||||||
build-and-publish-images: | ||||||
runs-on: ubuntu-20.04 | ||||||
|
||||||
permissions: | ||||||
contents: read | ||||||
id-token: write | ||||||
packages: write | ||||||
|
||||||
env: | ||||||
COSIGN_EXPERIMENTAL: 1 | ||||||
|
||||||
steps: | ||||||
- name: Checkout | ||||||
uses: actions/checkout@v3 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a good practice is to use the git hash instead of the tag and have a comment to which release is pointing to. Dependabot when update the release can also update the comment :)
Suggested change
same applies to the other actions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is another PR adressing this practice already. #3727 |
||||||
- name: Install cosign | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so, we'll be signing only release and nightly builds, how about regular builds images? (the ones generated when running PRs) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, you can sign the image that you generate in the main branch build There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For that there is already a nightly in place. On the main branch no images are released, so also nothing to sign there. Or is there a way to sign an image that hasn't been pushed to a registry? Basically offline signature? I'm not aware you can sign without pushing to a registry. |
||||||
uses: sigstore/[email protected] | ||||||
with: | ||||||
cosign-release: v1.13.1 | ||||||
- name: Build images | ||||||
run: make images scratch-images | ||||||
- name: Log in to GCR | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ jobs: | |
cache-deps: | ||
name: cache-deps (linux) | ||
runs-on: ubuntu-20.04 | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -28,6 +32,10 @@ jobs: | |
name: lint (linux) | ||
runs-on: ubuntu-20.04 | ||
needs: cache-deps | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -62,6 +70,10 @@ jobs: | |
OS: [ubuntu-20.04, macos-latest] | ||
runs-on: ${{ matrix.OS }} | ||
needs: cache-deps | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -81,6 +93,10 @@ jobs: | |
name: unit-test (linux with race detection) | ||
runs-on: ubuntu-20.04 | ||
needs: cache-deps | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -100,6 +116,10 @@ jobs: | |
name: artifacts (linux) | ||
runs-on: ubuntu-20.04 | ||
needs: [cache-deps] | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -131,6 +151,10 @@ jobs: | |
name: images (linux) | ||
runs-on: ubuntu-20.04 | ||
needs: [cache-deps] | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -164,6 +188,10 @@ jobs: | |
name: images (windows) | ||
runs-on: windows-2022 | ||
needs: artifact-windows | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -187,6 +215,10 @@ jobs: | |
scratch-images: | ||
runs-on: ubuntu-20.04 | ||
needs: [cache-deps] | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -220,6 +252,10 @@ jobs: | |
name: integration (linux) | ||
runs-on: ubuntu-20.04 | ||
needs: [cache-deps, images, scratch-images] | ||
|
||
permissions: | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -287,6 +323,10 @@ jobs: | |
name: integration (windows) | ||
runs-on: windows-2022 | ||
needs: images-windows | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
@@ -334,6 +374,10 @@ jobs: | |
cache-deps-windows: | ||
name: cache-deps (windows) | ||
runs-on: windows-2022 | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -353,6 +397,10 @@ jobs: | |
name: lint (windows) | ||
runs-on: windows-2022 | ||
needs: cache-deps-windows | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
@@ -396,6 +444,10 @@ jobs: | |
name: unit-test (windows) | ||
runs-on: windows-2022 | ||
needs: cache-deps-windows | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
@@ -428,6 +480,10 @@ jobs: | |
name: artifact (windows) | ||
runs-on: windows-2022 | ||
needs: cache-deps-windows | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
@@ -478,6 +534,10 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
needs: [lint, unit-test, unit-test-race-detector, artifacts, integration, | ||
lint-windows, unit-test-windows, artifact-windows, integration-windows] | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
@@ -501,9 +561,22 @@ jobs: | |
publish-images: | ||
runs-on: ubuntu-20.04 | ||
needs: [lint, unit-test, unit-test-race-detector, artifacts, integration] | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
packages: write | ||
|
||
env: | ||
COSIGN_EXPERIMENTAL: 1 | ||
marcofranssen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install cosign | ||
uses: sigstore/[email protected] | ||
with: | ||
cosign-release: v1.13.1 | ||
- name: Download archived images | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this to use keyless approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, although experimental, haven't faced any issue in the last year I have been using it on various repos. I think they are close to making this feature GA, so with new release of cosign, this might not be required anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sigstore is now GA so the env var here is no longer needed 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still required until we cut a cosign release v2