Skip to content

Commit 85a0761

Browse files
HaydenHayden-IO
andauthored
Update verification instructions for bundle (#397)
Mostly just renames the bundle example to be a JSON file. Also updated some text regarding the contents of the bundle being more than just a signature and certificate. Signed-off-by: Hayden <8418760+haydentherapper@users.noreply.github.com> Signed-off-by: Hayden <haydentherapper@users.noreply.github.com> Co-authored-by: Hayden <8418760+haydentherapper@users.noreply.github.com>
1 parent cee9305 commit 85a0761

File tree

4 files changed

+28
-26
lines changed

4 files changed

+28
-26
lines changed

content/en/cosign/signing/signing_with_blobs.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ You can use Cosign for signing and verifying standard files and blobs (or binary
1212
Cosign supports identity-based signing, associating an ephemeral signing key with an identity from an OpenID Connect provider. We refer to this process as "keyless signing". You use `cosign sign-blob` to sign standard files as well as blobs. You can store signature and certificate information either as separate file, or in a bundled text file, but using a bundle is the recommended way of signing a blob, as users can specify just the bundle name instead of separate files for the signature and certificate. Use the `cosign` command to sign:
1313

1414
```shell
15-
$ cosign sign-blob <file> --bundle cosign.bundle
15+
$ cosign sign-blob <file> --bundle artifact.sigstore.json
1616
```
17-
The bundle is output as a `base64` encoded string that contains the certificate and signature. In addition, signatures are output as `base64` encoded strings to stdout by default.
17+
The bundle contains verification metadata, including an artifact's signature, certificate and proof of transparency log inclusion.
1818

19-
When using `cosign sign-blob` in keyless mode, you need to store the bundle for verification. If you don't want to use the bundle, you can direct the output of the certificate by using the `--output-certificate` and `--output-signature` flags. The result from using the output flags:
19+
When using `cosign sign-blob` in keyless mode, you need to store the bundle for verification. If you don't want to use the bundle, you can direct the output of the certificate by using the `--output-certificate` and `--output-signature` flags. Note that this will be removed in future versions of Cosign, as the
20+
bundle format is standardized across Sigstore clients. The result from using the output flags:
2021

2122
```shell
22-
$ cosign sign-blob README.md --output-certificate cert.pem --output-signature sig
23+
$ cosign sign-blob README.md --new-bundle-format=false --output-certificate cert.pem --output-signature sig
2324
Using payload from: README.md
2425
Generating ephemeral keys...
2526
Retrieving signed certificate...
@@ -56,7 +57,7 @@ Certificate wrote in the file cert.pem
5657
While keyless signing is recommended, you may specify your own keys for signing. You will need the password for the private key to sign:
5758

5859
```shell
59-
$ cosign sign-blob --key cosign.key README.md
60+
$ cosign sign-blob --key cosign.key --bundle artifact.sigstore.json README.md
6061
Using payload from: README.md
6162
Enter password for private key:
6263
MEQCIAU4wPBpl/U5Vtdx/eJFgR0nICiiNCgyWPWarupH0onwAiAv5ycIKgztxHNVG7bzUjqHuvK2gsc4MWxwDgtDh0JINw==
@@ -101,5 +102,5 @@ $ cosign sign gcr.io/user/demo/artifact
101102
In situations where automated signing is required, such as within CI/CD pipelines, the `--yes` flag becomes essential. This flag, when used with signing commands, bypasses any confirmation prompts, enabling a smooth, uninterrupted signing process. This is particularly crucial in automated environments where manual input isn't feasible. The `--yes` flag ensures that your signing operations can proceed without manual intervention, maintaining the efficiency and speed of your automated workflows.
102103

103104
```
104-
cosign sign-blob --yes -key cosign.key myregistry/myimage:latest
105+
cosign sign-blob --yes --key cosign.key --bundle artifact.sigstore.json myregistry/myimage:latest
105106
```

content/en/cosign/verifying/verify.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ cosign verify <image URI> --certificate-identity=name@example.com
2828

2929
The oidc-issuer for Google is https://accounts.google.com, Microsoft is https://login.microsoftonline.com, GitHub is https://github.com/login/oauth, and GitLab is https://gitlab.com.
3030

31-
The following example verifies the signature on file.txt from user name@example.com issued by accounts@example.com. It uses a provided bundle cosign.bundle that contains the certificate and signature.
31+
The following example verifies the signature on file.txt from user name@example.com issued by accounts@example.com. It uses a provided bundle `artifact.sigstore.json` that contains the certificate and signature.
3232

3333
```shell
34-
cosign verify-blob <file> --bundle cosign.bundle --certificate-identity=name@example.com
35-
--certificate-oidc-issuer=https://accounts.example.com
34+
cosign verify-blob <file> --bundle artifact.sigstore.json \
35+
--certificate-identity=name@example.com --certificate-oidc-issuer=https://accounts.example.com
3636
```
3737

3838
With container images, the signature and certificate are attached to the container. For blobs, the signature and certificate can be stored in a bundle file that is created at the time of signing. Either the bundle must be specified, or the individual signature and certificate must be specified.

content/en/quickstart/quickstart-ci.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
id-token: write
4444
steps:
4545
# This step ensures that your project is available in the workflow environment.
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
4747
with:
4848
persist-credentials: false
4949

@@ -180,10 +180,10 @@ The cosign-installer GitHub Action can also do simpler tasks, like signing a blo
180180
```yaml
181181
# This step makes sure your project is available in the workflow environment.
182182
- name: Import project
183-
uses: actions/checkout@v4
183+
uses: actions/checkout@v5
184184
# This step signs a blob (a text file in the root directory named to_be_signed.txt). The `--yes` flag agrees to Sigstore's terms of use.
185185
- name: Sign Blob
186-
run: cosign sign-blob to_be_signed.txt --bundle cosign.bundle --yes
186+
run: cosign sign-blob to_be_signed.txt --bundle artifact.sigstore.json --yes
187187
```
188188
189189
### Verifying a blob
@@ -193,7 +193,7 @@ To verify the signature that you just created, add the following step to your wo
193193
```yaml
194194
- name: Verify blob
195195
run: >
196-
cosign verify-blob README.md --bundle cosign.bundle
196+
cosign verify-blob README.md --bundle artifact.sigstore.json
197197
--certificate-identity=https://github.com/USERNAME/REPOSITORY_NAME/.github/workflows/WORKFLOW_NAME@refs/heads/BRANCH_NAME
198198
--certificate-oidc-issuer=https://token.actions.githubusercontent.com
199199
```

content/en/quickstart/quickstart-cosign.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ To sign software artifacts and verify signatures using Sigstore, you need to ins
2626

2727
The basic signing format for a blob is as follows:
2828

29-
```
30-
$ cosign sign-blob <file> --bundle cosign.bundle
29+
```bash
30+
cosign sign-blob <file> --bundle artifact.sigstore.json
3131
```
3232

33-
The bundle contains signing metadata, including the signature and certificate.
33+
The bundle contains signing metadata, including the signature, certificate, timestamp and proof of transparency log inclusion.
3434

35-
The Cosign command requests a certificate from the Sigstore certificate authority, Fulcio. Fulcio checks your identity by using an authentication protocol (OpenID Connect) to confirm your email address. If your identity is correct, Fulcio grants a short-lived, time-stamped certificate. The certificate is bound to the public key to attest to your identity. This activity is logged using the Sigstore transparency and timestamping log, Rekor.
35+
The Cosign command requests a certificate from the Sigstore certificate authority, Fulcio. Fulcio checks your identity by using an authentication protocol (OpenID Connect) to confirm your email address. If your identity is correct, Fulcio grants a short-lived, time-stamped certificate. The certificate is bound to the public key to attest to your identity. This activity is logged using the Sigstore signature transparency log, Rekor.
3636

3737
Note that you don’t need to use a key to sign. Currently, you can authenticate with Google, GitHub, or Microsoft, which will associate your identity with a short-lived signing key.
3838

@@ -46,20 +46,21 @@ cosign sign-blob --help
4646

4747
To verify a signed blob, you need to provide three pieces of information:
4848

49-
- The certificate
50-
- The signature
49+
- The artifact blob
50+
- The verification bundle, containing the signature, certificate, and proof of log inclusion
5151
- The identity used in signing
5252

53-
You may be provided with a bundle that includes the certificate and signature. The blob maintainer should provide the trusted identity.
54-
55-
The following example verifies the signature on `file.txt` from user `name@example.com` issued by `accounts@example.com`. It uses a provided bundle `cosign.bundle` that contains the certificate and signature.
53+
The following example verifies the signature on `file.txt` from user `name@example.com` issued by `accounts@example.com`. It uses a provided bundle `artifact.sigstore.json` that contains the certificate and signature.
5654

57-
```
58-
$ cosign verify-blob <file> --bundle cosign.bundle --certificate-identity=name@example.com
59-
--certificate-oidc-issuer=https://accounts.example.com
55+
```bash
56+
cosign verify-blob file.txt --bundle artifact.sigstore.json \
57+
--certificate-identity=name@example.com --certificate-oidc-issuer=https://accounts.example.com
6058
```
6159

62-
To verify, Cosign queries the transparency log (Rekor) to compare the public key bound to the certificate, and checks the timestamp on the signature against the artifact’s entry in the transparency log. The signature is valid if its timestamp falls within the small window of time that the key pair and certificate issued by the certificate authority were valid.
60+
Cosign verifies the signed timestamp in the bundle, and uses the timestamp when verifying the short-lived code signing certificate containing the ephemeral public key.
61+
A signature is valid if the timestamp falls within the small time window of certificate issuance.
62+
Cosign then uses the certificate's public key to verify the artifact signature. Cosign also verifies the proof of transparency log inclusion
63+
artifact and its certificate.
6364

6465
## Example: Working with containers
6566

0 commit comments

Comments
 (0)