8000 🐛 fix: update release integrity notes endpoint by abahmed · Pull Request #494 · abahmed/kwatch · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
# Read from go.mod so the CI Go version can never drift from the repo.
go-version-file: go.mod
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
run: ./deploy/chart/test_helm.sh
- name: Create disposable Kubernetes cluster
if: steps.changes.outputs.chart == 'true'
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
uses: helm/kind-action@06c1ae10762d3b9c1644e7fe69596ae519e015a2 # v1.15.0
- name: CRD lifecycle integration test
if: steps.changes.outputs.chart == 'true'
run: ./deploy/chart/test_helm_lifecycle.sh
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
- 'go.sum'
- name: Set up QEMU
if: steps.changes.outputs.image == 'true'
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4
- name: Set up Docker Buildx
if: steps.changes.outputs.image == 'true'
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
echo "source_date_epoch=$(git show -s --format=%ct HEAD)" >> "$GITHUB_OUTPUT"

- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
> /tmp/kwatch-image-evidence/image.json

- name: Upload image release evidence
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: kwatch-image-evidence-${{ steps.rel.outputs.tag }}
path: /tmp/kwatch-image-evidence/image.json
Expand Down Expand Up @@ -221,11 +221,9 @@ jobs:
echo "docker pull ghcr.io/abahmed/kwatch:$TAG"
echo '```'
echo
echo "By digest, which cannot. Use this to pin a deployment:"
echo "The release digest is recorded in the release evidence for verification:"
echo
echo '```sh'
echo "docker pull ghcr.io/abahmed/kwatch@$DIGEST"
echo '```'
echo " $DIGEST"
fi
} >> "$GITHUB_STEP_SUMMARY"

Expand Down Expand Up @@ -281,7 +279,7 @@ jobs:
helm package deploy/chart --destination /tmp/kwatch-chart

- name: Upload Helm release evidence
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: kwatch-helm-evidence-${{ steps.rel.outputs.tag }}
path: /tmp/kwatch-chart/kwatch-${{ steps.rel.outputs.version }}.tgz
Expand Down Expand Up @@ -495,14 +493,14 @@ jobs:
fetch-depth: 0

- name: Download image evidence
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: kwatch-image-evidence-${{ needs.push_to_registry.outputs.tag }}
path: /tmp/kwatch-evidence/image

- name: Download Helm evidence
if: ${{ needs.publish_helm_chart.result == 'success' }}
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: kwatch-helm-evidence-${{ needs.push_to_registry.outputs.tag }}
path: /tmp/kwatch-evidence/helm
Expand Down Expand Up @@ -626,8 +624,9 @@ jobs:
cat /tmp/release-body.md /tmp/release-integrity.md > /tmp/release-body-updated.md
fi

release_id=$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" --jq .id)
jq -Rs '{body: .}' /tmp/release-body-updated.md |
gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/tags/$TAG" --input - >/dev/null
gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/$release_id" --input - >/dev/null

verify_published_artifacts:
name: Verify published artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Without --platform=$BUILDPLATFORM this stage runs under QEMU for arm64,
# arm/v7 and arm/v6, which is what made a release build take over an hour.
# Go cross-compiles fine and CGO is off, so emulation buys nothing.
FROM --platform=$BUILDPLATFORM golang:1.27-alpine@sha256:4c9fe60190a2a3350ddc51de80d0224b8a6698d12bdfc999fee45ea9d6c46dbc AS builder
FROM --platform=$BUILDPLATFORM golang:1.27-alpine@sha256:cf6fca6641884b8433441b2b0652976f975e1d0fdd26d177eaaf8596087f3125 AS builder

ARG RELEASE_VERSION="dev"
ARG GIT_COMMIT="none"
Expand Down
16 changes: 9 additions & 7 deletions docs/release-integrity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ Every published container release includes a source commit, image digest, checks
and a release manifest. The image is signed with Cosign using GitHub Actions
OIDC; kwatch does not connect to Sigstore at runtime.

## Pin the image
## Use the release image

Use the immutable digest from the GitHub Release instead of a mutable tag:
Use the published version tag for installation and normal operation:

```shell
docker pull ghcr.io/abahmed/kwatch@sha256:<digest>
docker pull ghcr.io/abahmed/kwatch:vX.Y.Z
```

The release manifest records the relationship between the version tag, source commit,
image digest, and (for stable releases) Helm package checksum.
image digest, and (for stable releases) Helm package checksum. The digest is release
evidence for verification, not a separate operational image tag.

## Verify an image

Install Cosign, then verify the digest from the release:
Install Cosign, then verify the digest recorded in the release evidence:

```shell
cosign verify \
Expand All @@ -29,7 +30,8 @@ cosign verify \
ghcr.io/abahmed/kwatch@sha256:<digest>
```

The command should be run against the exact digest, not `latest` or another mutable tag.
The command verifies the image behind the version tag; do not use the `sha256-...`
provenance tag as an operational image.

## Verify checksums

Expand All @@ -47,7 +49,7 @@ and its `image.digest` must match the digest used for the Cosign verification.
The image embeds its version and source commit:

```shell
docker run --rm ghcr.io/abahmed/kwatch@sha256:<digest> version --json
docker run --rm ghcr.io/abahmed/kwatch:vX.Y.Z version --json
```

The returned `version` and `commit` should match the release tag and manifest.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/google/uuid v1.6.0
github.com/robfig/cron/v3 v3.0.1
github.com/slack-go/slack v0.29.0
github.com/stretchr/testify v1.11.1
github.com/stretchr/testify v1.12.1
golang.org/x/exp v0.0.0-20260824195058-e88cd73687aa
gopkg.in/mail.v2 v2.3.1
gopkg.in/yaml.v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE=
github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
Expand Down
0