argoproj / argoproj/argo-workflows

Use digest during `cosign` signing of releases

Open
#13,207 3 comments 0 reactions 0 assignees View on GitHub
area/build solution/suggested type/security
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

I happened to notice some warnings while releasing, specifically [this one from `cosign`](https://github.com/argoproj/argo-workflows/actions/runs/9558568569/job/26348421564) (during the "Push Multiarch Image" step):

```
WARNING: Image reference quay.io/***/argocli:v3.5.8 uses a tag, not a digest, to identify the image to sign.
This can lead you to sign a different image than the intended one. Please use a
digest (example.com/ubuntu@sha256:abc123...) rather than tag
(example.com/ubuntu:latest) for the input to cosign. The ability to refer to
images by tag will be removed in a future release.
```

## Use Cases

Forward compatibility with later versions of `cosign` and more secure releases resilient to more attack vectors. In this case, the attack surface is minimal, would either require a subtle CI change or access to registry credentials, but it is still worth proactively addressing either way -- and `cosign` will force us to as well.

## Implementation Details

Specifically [the `cosign sign` line](https://github.com/argoproj/argo-workflows/blob/66e64c86b9b7d24e2b1d181bf49722319b07c461/.github/workflows/release.yaml#L200) in the `release.yaml` GHA Workflow needs updating.

I didn't do this myself as it requires some testing to make sure that both the SHA and verification are correct -- that would be the bulk of the work here.

---

**Message from the maintainers**:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

Contributor guide

Open the contributing guide

Research direction

Start in .github/workflows/release.yaml at the `cosign sign` line around line 200, then inspect the preceding Push Multiarch Image steps to see how the image SHA is available. Verify that signing and verification use the digest and that the release workflow no longer produces the tag warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd, release, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.