Skip to content

Commit 2333f37

Browse files
ramonpetgrave64renovate-botdependabot[bot]
authored
feat: produce sigstore Bundles for generic generator and go builder workflows (#3777)
# Summary fixes #3750 pending slsa-framework/slsa-verifier#799 Changes the internal go code to produce Sigstore Bundles, instead of only signed DSSE envelopes. This means that the generic generator and go builder workflows now produce Sigstore Bundles, just like the other BYOB-type workflows. ## Testing Process Testing done on a previous commit with a test workflow. It's using a slightly modified slsa-verifier that respects sls-aw workflows from non-main branches. - https://github.com/slsa-framework/slsa-github-generator/actions/runs/10425271660 ## Followup [ ] Produce the provenance in v1 format, rather than the current v0.2 format. [ ] fix initialism of `[build]invocationID` to `[build]invocationId` #3876 ## Checklist - [x] Review the contributing [guidelines](https://github.com/slsa-framework/slsa-github-generator/blob/main/CONTRIBUTING.md) - [x] Add a reference to related issues in the PR description. - [x] Update documentation if applicable. - [x] Add unit tests if applicable. - [x] Add changes to the [CHANGELOG](https://github.com/slsa-framework/slsa-github-generator/blob/main/CHANGELOG.md) if applicable. --------- Signed-off-by: Ramon Petgrave <[email protected]> Signed-off-by: Ramon Petgrave <[email protected]> Signed-off-by: Mend Renovate <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Mend Renovate <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent edb0d82 commit 2333f37

File tree

12 files changed

+341
-172
lines changed

12 files changed

+341
-172
lines changed

.github/workflows/generator_generic_slsa3.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
with:
161161
repository: "${{ needs.detect-env.outputs.repository }}"
162162
ref: "${{ needs.detect-env.outputs.ref }}"
163-
go-version: "1.21"
163+
go-version: "1.23.1"
164164
binary: "${{ env.BUILDER_BINARY }}"
165165
compile-builder: "${{ inputs.compile-generator }}"
166166
directory: "${{ env.BUILDER_DIR }}"

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
<!-- toc -->
1111

1212
- [Unreleased](#unreleased)
13+
- [Unreleased: Sigstore Bundles for Generic Generator and Go Builder](#unreleased-sigstore-bundles-for-generic-generator-and-go-builder)
1314
- [Unreleased: Vars context recorded in provenance](#unreleased-vars-context-recorded-in-provenance)
1415
- [v2.0.0](#v200)
1516
- [v2.0.0: Breaking Change: upload-artifact and download-artifact](#v200-breaking-change-upload-artifact-and-download-artifact)
@@ -106,6 +107,15 @@ duplication."
106107

107108
## Unreleased
108109

110+
### Unreleased: Sigstore Bundles for Generic Generator and Go Builder
111+
112+
The workflows `generator_generic_slsa3.yml` and `builder_go_slsa3.yml`
113+
have been updated to produce signed Sigstore Bundles, just like all the other builders
114+
that use the BYOB framework.
115+
116+
The workflow logs will now print a LogIndex, rather than a LogUUID. Both are equally searchanble on
117+
https://search.sigstore.dev/.
118+
109119
### Unreleased: Vars context recorded in provenance
110120

111121
- **Updated**: GitHub `vars` context is now recorded in provenance for the generic and

github/oidc.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ const (
3939

4040
// OIDCToken represents the contents of a GitHub OIDC JWT token.
4141
type OIDCToken struct {
42+
// Expiry is the expiration date of the token.
43+
Expiry time.Time
44+
4245
// Issuer is the token issuer.
4346
Issuer string
4447

@@ -54,8 +57,8 @@ type OIDCToken struct {
5457
// ActorID is the unique ID of the actor who triggered the build.
5558
ActorID string `json:"actor_id"`
5659

57-
// Expiry is the expiration date of the token.
58-
Expiry time.Time
60+
// RawToken is the unparsed oidc token.
61+
RawToken string
5962

6063
// Audience is the audience for which the token was granted.
6164
Audience []string
@@ -247,6 +250,8 @@ func (c *OIDCClient) Token(ctx context.Context, audience []string) (*OIDCToken,
247250
return nil, err
248251
}
249252

253+
token.RawToken = tokenPayload
254+
250255
return token, nil
251256
}
252257

go.mod

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/slsa-framework/slsa-github-generator
33
go 1.23.1
44

55
require (
6-
github.com/coreos/go-oidc/v3 v3.10.0
6+
github.com/coreos/go-oidc/v3 v3.11.0
77
github.com/go-openapi/strfmt v0.23.0
88
github.com/go-openapi/swag v0.23.0
99
github.com/google/go-cmp v0.6.0
@@ -13,9 +13,10 @@ require (
1313
github.com/secure-systems-lab/go-securesystemslib v0.8.0
1414
github.com/sigstore/cosign/v2 v2.2.4
1515
github.com/sigstore/rekor v1.3.6
16-
github.com/sigstore/sigstore v1.8.3
17-
github.com/spf13/cobra v1.8.0
18-
golang.org/x/oauth2 v0.20.0
16+
github.com/sigstore/sigstore v1.8.8
17+
github.com/sigstore/sigstore-go v0.6.0
18+
github.com/spf13/cobra v1.8.1
19+
golang.org/x/oauth2 v0.22.0
1920
gopkg.in/square/go-jose.v2 v2.6.0
2021
gopkg.in/yaml.v3 v3.0.1
2122
)
@@ -43,26 +44,26 @@ require (
4344
github.com/alibabacloud-go/debug v1.0.0 // indirect
4445
github.com/alibabacloud-go/endpoint-util v1.1.1 // indirect
4546
github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
46-
github.com/alibabacloud-go/tea v1.2.1 // indirect
47+
github.com/alibabacloud-go/tea v1.2.2 // indirect
4748
github.com/alibabacloud-go/tea-utils v1.4.5 // indirect
4849
github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
4950
github.com/aliyun/credentials-go v1.3.1 // indirect
5051
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
51-
github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect
52-
github.com/aws/aws-sdk-go-v2/config v1.27.9 // indirect
53-
github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect
54-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect
55-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect
56-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect
52+
github.com/aws/aws-sdk-go-v2 v1.27.2 // indirect
53+
github.com/aws/aws-sdk-go-v2/config v1.27.18 // indirect
54+
github.com/aws/aws-sdk-go-v2/credentials v1.17.18 // indirect
55+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 // indirect
56+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 // indirect
57+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 // indirect
5758
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
5859
github.com/aws/aws-sdk-go-v2/service/ecr v1.20.2 // indirect
5960
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2 // indirect
60-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect
61-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect
62-
github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect
63-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect
64-
github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 // indirect
65-
github.com/aws/smithy-go v1.20.1 // indirect
61+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
62+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 // indirect
63+
github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 // indirect
64+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 // indirect
65+
github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 // indirect
66+
github.com/aws/smithy-go v1.20.2 // indirect
6667
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231024185945-8841054dbdb8 // indirect
6768
github.com/blang/semver v3.5.1+incompatible // indirect
6869
github.com/buildkite/agent/v3 v3.62.0 // indirect
@@ -88,7 +89,7 @@ require (
8889
github.com/fsnotify/fsnotify v1.7.0 // indirect
8990
github.com/go-chi/chi v4.1.2+incompatible // indirect
9091
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
91-
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
92+
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
9293
github.com/go-logr/logr v1.4.1 // indirect
9394
github.com/go-logr/stdr v1.2.2 // indirect
9495
github.com/go-openapi/analysis v0.23.0 // indirect
@@ -105,9 +106,9 @@ require (
105106
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
106107
github.com/golang/protobuf v1.5.4 // indirect
107108
github.com/golang/snappy v0.0.4 // indirect
108-
github.com/google/certificate-transparency-go v1.1.8 // indirect
109+
github.com/google/certificate-transparency-go v1.2.1 // indirect
109110
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
110-
github.com/google/go-containerregistry v0.19.1 // indirect
111+
github.com/google/go-containerregistry v0.20.1 // indirect
111112
github.com/google/go-github/v55 v55.0.0 // indirect
112113
github.com/google/go-querystring v1.1.0 // indirect
113114
github.com/google/gofuzz v1.2.0 // indirect
@@ -118,13 +119,14 @@ require (
118119
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
119120
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
120121
github.com/imdario/mergo v0.3.16 // indirect
122+
github.com/in-toto/attestation v1.1.0 // indirect
121123
github.com/inconshreveable/mousetrap v1.1.0 // indirect
122124
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
123125
github.com/jmespath/go-jmespath v0.4.0 // indirect
124126
github.com/josharian/intern v1.0.0 // indirect
125127
github.com/json-iterator/go v1.1.12 // indirect
126128
github.com/klauspost/compress v1.17.4 // indirect
127-
github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // indirect
129+
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec // indirect
128130
github.com/magiconair/properties v1.8.7 // indirect
129131
github.com/mailru/easyjson v0.7.7 // indirect
130132
github.com/miekg/pkcs11 v1.1.1 // indirect
@@ -149,6 +151,7 @@ require (
149151
github.com/segmentio/ksuid v1.0.4 // indirect
150152
github.com/shibumi/go-pathspec v1.3.0 // indirect
151153
github.com/sigstore/fulcio v1.4.5 // indirect
154+
github.com/sigstore/protobuf-specs v0.3.2 // indirect
152155
github.com/sigstore/timestamp-authority v1.2.2 // indirect
153156
github.com/sirupsen/logrus v1.9.3 // indirect
154157
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
@@ -162,6 +165,7 @@ require (
162165
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
163166
github.com/thales-e-security/pool v0.0.2 // indirect
164167
github.com/theupdateframework/go-tuf v0.7.0 // indirect
168+
github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect
165169
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
166170
github.com/tjfoc/gmsm v1.4.1 // indirect
167171
github.com/transparency-dev/merkle v0.0.2 // indirect
@@ -170,28 +174,28 @@ require (
170174
github.com/zeebo/errs v1.3.0 // indirect
171175
go.mongodb.org/mongo-driver v1.14.0 // indirect
172176
go.opencensus.io v0.24.0 // indirect
173-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
174-
go.opentelemetry.io/otel v1.24.0 // indirect
175-
go.opentelemetry.io/otel/metric v1.24.0 // indirect
176-
go.opentelemetry.io/otel/trace v1.24.0 // indirect
177+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
178+
go.opentelemetry.io/otel v1.27.0 // indirect
179+
go.opentelemetry.io/otel/metric v1.27.0 // indirect
180+
go.opentelemetry.io/otel/trace v1.27.0 // indirect
177181
go.step.sm/crypto v0.44.2 // indirect
178182
go.uber.org/multierr v1.11.0 // indirect
179183
go.uber.org/zap v1.27.0 // indirect
180-
golang.org/x/crypto v0.22.0 // indirect
181-
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 // indirect
182-
golang.org/x/mod v0.16.0 // indirect
183-
golang.org/x/net v0.23.0 // indirect
184-
golang.org/x/sync v0.7.0 // indirect
185-
golang.org/x/sys v0.20.0 // indirect
186-
golang.org/x/term v0.19.0 // indirect
187-
golang.org/x/text v0.14.0 // indirect
184+
golang.org/x/crypto v0.26.0 // indirect
185+
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
186+
golang.org/x/mod v0.20.0 // indirect
187+
golang.org/x/net v0.27.0 // indirect
188+
golang.org/x/sync v0.8.0 // indirect
189+
golang.org/x/sys v0.23.0 // indirect
190+
golang.org/x/term v0.23.0 // indirect
191+
golang.org/x/text v0.17.0 // indirect
188192
golang.org/x/time v0.5.0 // indirect
189-
golang.org/x/tools v0.19.0 // indirect
193+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
190194
google.golang.org/api v0.172.0 // indirect
191-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
192-
google.golang.org/grpc v1.62.1 // indirect
193-
google.golang.org/protobuf v1.33.0 // indirect
194-
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
195+
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
196+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect
197+
google.golang.org/grpc v1.64.1 // indirect
198+
google.golang.org/protobuf v1.34.2 // indirect
195199
gopkg.in/inf.v0 v0.9.1 // indirect
196200
gopkg.in/ini.v1 v1.67.0 // indirect
197201
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)