You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,22 +10,22 @@ Join us on our [Slack channel](https://sigstore.slack.com/). (Need an [invite](h
10
10
11
11
## Sigstore CI quickstart
12
12
13
-
Sigstore provides two GitHub Actions that make it easy to integrate signing and verifying into your CI system.
13
+
Sigstore provides two GitHub Actions that make it easy to integrate signing and verifying into your CI system.
14
14
15
-
- The [`gh-action-sigstore-python` GitHub Action](https://github.com/sigstore/gh-action-sigstore-python) provides the easiest way to generate Sigstore signatures within your CI system. It uses the Sigstore Python language client ([`sigstore-python`](https://github.com/sigstore/sigstore-python)), but can be used to generate Sigstore signatures regardless of your project's language.
16
-
- The [`consign-installer` GitHub Action](https://github.com/marketplace/actions/cosign-installer) installs cosign into your GitHub Action environment, making all features of Cosign available to be used within your CI System.
15
+
- The [`gh-action-sigstore-python` GitHub Action](https://github.com/sigstore/gh-action-sigstore-python) provides the easiest way to generate Sigstore signatures within your CI system. It uses the Sigstore Python language client ([`sigstore-python`](https://github.com/sigstore/sigstore-python)), but can be used to generate Sigstore signatures regardless of your project's language.
16
+
- The [`consign-installer` GitHub Action](https://github.com/marketplace/actions/cosign-installer) installs cosign into your GitHub Action environment, making all features of Cosign available to be used within your CI System.
17
17
18
-
This quickstart will walk you through the use of the `gh-action-sigstore-python` to [sign](#signing-files-using-your-ci-system) files, which is the quickest way to integrate Sigstore into your CI system. This quickstart also includes a [walkthrough](#using-cosign-within-your-ci-system) of using basic Cosign features in your workflows.
18
+
This quickstart will walk you through the use of the `gh-action-sigstore-python` to [sign](#signing-files-using-your-ci-system) files, which is the quickest way to integrate Sigstore into your CI system. This quickstart also includes a [walkthrough](#using-cosign-within-your-ci-system) of using basic Cosign features in your workflows.
19
19
20
20
## Using `gh-action-sigstore-python` to sign files within your CI System
21
21
22
-
This quickstart will show you how to integrate the `gh-action-sigstore-python` GitHub Action into your workflow to generate Sigstore Signatures. The example workflow will sign the file `to_be_signed.txt` in the project's root directory whenever a push is made to the main branch.
22
+
This quickstart will show you how to integrate the `gh-action-sigstore-python` GitHub Action into your workflow to generate Sigstore Signatures. The example workflow will sign the file `to_be_signed.txt` in the project's root directory whenever a push is made to the main branch.
23
23
24
24
Additional information and optional settings can be found in the [project's README](https://github.com/sigstore/gh-action-sigstore-python?tab=readme-ov-file#gh-action-sigstore-python).
25
25
26
26
### Signing files using your CI system
27
27
28
-
To following workflow will sign the file `to_be_signed.txt` in the project's root directory whenever a push is made to the main branch. To try it out, make sure to add the file `to_be_signed.txt` to your project, or substitute the file for one in your project.
28
+
To following workflow will sign the file `to_be_signed.txt` in the project's root directory whenever a push is made to the main branch. To try it out, make sure to add the file `to_be_signed.txt` to your project, or substitute the file for one in your project.
29
29
30
30
```
31
31
name: signing_files
@@ -42,16 +42,17 @@ jobs:
42
42
steps:
43
43
# This step ensures that your project is available in the workflow environment.
44
44
- uses: actions/checkout@v3
45
-
# This step uses 'gh-action-sigstore-python' to sign the file designated in the inputs field.
45
+
# This step uses 'gh-action-sigstore-python' to sign the file designated in the inputs field.
When run, this workflow returns the ephemeral certificate used to sign the file, as well as the index for the transparency log entry.
51
52
52
53
### Verifying your signed files
53
54
54
-
The `gh-action-sigstore-python` GitHub Action includes an option to verify your generated signature. This is optional but a great way to understand the GitHub Action as you are integrating it into your CI for the first time. To verify the signature you just created, set the `verify` setting to true and include your expected `verify-cert-identity` and `verify-oidc-issuer` settings.
55
+
The `gh-action-sigstore-python` GitHub Action includes an option to verify your generated signature. This is optional but a great way to understand the GitHub Action as you are integrating it into your CI for the first time. To verify the signature you just created, set the `verify` setting to true and include your expected `verify-cert-identity` and `verify-oidc-issuer` settings.
@@ -64,23 +65,26 @@ The `gh-action-sigstore-python` GitHub Action includes an option to verify your
64
65
65
66
## Using Cosign within your CI system
66
67
67
-
If you need functionality beyond simple signing of files and blobs, you can use the [`consign-installer` GitHub Action](https://github.com/marketplace/actions/cosign-installer) to integrate Sigstore into your CI system.
68
+
If you need functionality beyond simple signing of files and blobs, you can use the [`consign-installer` GitHub Action](https://github.com/marketplace/actions/cosign-installer) to [integrate Sigstore into your CI system](#installing-cosign-on-your-ci). This quickstart covers:
69
+
- How to [sign](#signing-a-blob) and [verify](#verifying-a-blob) a blob using `consign-installer`
70
+
- How to [sign and verify a container image](#signing-and-verifying-a-container-image) using your CI system
68
71
69
72
### Installing Cosign on your CI
70
73
71
-
The following workflow will install Cosign into your workflow environment.
74
+
The following workflow will install Cosign into your workflow environment.
72
75
73
76
```
74
-
name: install-and-check-cosign
77
+
name: install-cosign-and-use
75
78
on:
76
79
# This will trigger the workflow to run when commits are pushed to the main branch. This is easy for testing purposes, but for your final workflow use whatever event or schedule makes sense for your project.
77
80
push:
78
81
branches: [ main ]
79
-
# No special permissions are required to install cosign, but depending on what you want to do with it, you may need to add permissions.
80
-
permissions: read-all
82
+
# No special permissions are required to install cosign, but `id-token: write` is needed to sign with your workflow identity.
83
+
permissions:
84
+
id-token: write
81
85
82
86
jobs:
83
-
install-and-check-cosign:
87
+
install-cosign-and-use:
84
88
name: Install Cosign
85
89
runs-on: ubuntu-latest
86
90
steps:
@@ -90,21 +94,101 @@ jobs:
90
94
run: cosign version
91
95
```
92
96
93
-
### Signing a Blob
97
+
### Signing a blob
94
98
95
99
Now that we've installed Cosign and checked the installation, let's use Cosign to sign a blob. Add these steps to your workflow:
96
100
97
101
```
102
+
# This step makes sure your project is available in the workflow environment.
98
103
- name: Import project
99
104
uses: actions/checkout@v3
105
+
# 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.
In addition to signing and verifying blobs, you can sign and verify container images using the cosign-installer GitHub Action. The following is an example workflow that will build a container image with QEMU and Docker Buildx, push that image to the GitHub Container Registry, sign the image, and then verify it.
125
+
102
126
```
127
+
name: container-signing-and-verifying
128
+
on:
129
+
push:
130
+
branches: [ main ]
131
+
permissions:
132
+
contents: read
133
+
packages: write
134
+
id-token: write # needed for signing the images with GitHub OIDC Token
103
135
104
-
### Verifying a Blob
105
-
### Signing a container
106
-
### Verifying a container
136
+
jobs:
137
+
build-image:
138
+
runs-on: ubuntu-latest
107
139
140
+
permissions:
141
+
contents: read
142
+
packages: write
143
+
id-token: write # needed for signing the images with GitHub OIDC Token
0 commit comments