Skip to content
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

Make the transparency log upload non-fatal. #1116

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

mattmoor
Copy link
Member

@mattmoor mattmoor commented Dec 1, 2021

When keyless signing a private image today we prompt the user about uploading to Rekor, but in automation this prompt fails and on error this code panics (today).

This change rewords the prompt, and makes the error path non-fatal (emits a WARNING, see below):

COSIGN_EXPERIMENTAL=true cosign sign ghcr.io/mattmoor/bundles < /dev/null
Generating ephemeral keys...
Retrieving signed certificate...
Non-interactive mode detected, using device flow.
Enter the verification code MVRL-JKVG in your browser at: https://oauth2.sigstore.dev/auth/device?user_code=MVRL-JKVG
Code will be valid for 300 seconds
Token received!
Successfully verified SCT...
"ghcr.io/mattmoor/bundles" appears to be a private repository, please confirm uploading to the transparency log at "https://rekor.sigstore.dev" [Y/N]:
WARNING: skipping transparency log upload (use --force to upload from scripts): EOF
MEYCIQCnyOa+oSLABA07Eb79eJ0/fmN0o0mUKUEXok/j3l7A3AIhAOH/fk7/bG8rO7mid2Iys4KIx8HKwznDbAAsO0sYHRWUmain

After this change, it should be possible to use cosign in keyless mode without --force on private images!

Signed-off-by: Matt Moore [email protected]

Ticket Link

Related: actions/starter-workflows#1255

Release Note

cosign will no longer fail to sign private images in keyless mode without --force.

When keyless signing a private image today we prompt the user about uploading to Rekor, but in automation this prompt fails and on error this code panics (today).

This change rewords the prompt, and makes the error path non-fatal (emits a WARNING, see below):

```
COSIGN_EXPERIMENTAL=true cosign sign ghcr.io/mattmoor/bundles < /dev/null
Generating ephemeral keys...
Retrieving signed certificate...
Non-interactive mode detected, using device flow.
Enter the verification code MVRL-JKVG in your browser at: https://oauth2.sigstore.dev/auth/device?user_code=MVRL-JKVG
Code will be valid for 300 seconds
Token received!
Successfully verified SCT...
"ghcr.io/mattmoor/bundles" appears to be a private repository, please confirm uploading to the transparency log at "https://rekor.sigstore.dev" [Y/N]:
WARNING: skipping transparency log upload (use --force to upload from scripts): EOF
MEYCIQCnyOa+oSLABA07Eb79eJ0/fmN0o0mUKUEXok/j3l7A3AIhAOH/fk7/bG8rO7mid2Iys4KIx8HKwznDbAAsO0sYHRWUmain
```

After this change, it should be possible to use cosign in keyless mode without `--force` on private images!

Signed-off-by: Matt Moore <[email protected]>
@dlorenc dlorenc merged commit ec00f69 into sigstore:main Dec 1, 2021
@github-actions github-actions bot added this to the v1.4.0 milestone Dec 1, 2021
@mattmoor mattmoor deleted the prompt-non-fatal branch December 1, 2021 02:04
@vaikas
Copy link
Contributor

vaikas commented Dec 1, 2021

this change it's great, but if it's only for automation, just curious if we could've just prefixed the automation with something like:
yes | cosign...

@dekkagaijin
Copy link
Member

dekkagaijin commented Dec 1, 2021

@vaikas we also rely on user input elsewhere, e.g. password for private keys

This was just an unnecessary and weird place for an interaction to occur

@vaikas
Copy link
Contributor

vaikas commented Dec 1, 2021

Thanks @dekkagaijin thanks for the info, as I said was just curious :)

@dekkagaijin
Copy link
Member

@vaikas I meant the user prompt was weird and unnecessary! Interactions with you are always necessary and properly placed (especially when there's lager)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants