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

feat: produce sigstore Bundles for generic generator and go builder workflows #3777

Merged
merged 105 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
42311b5
fix: maven e2e: remove verify job (#3748)
ramonpetgrave64 Jul 26, 2024
ec2ef9d
debug: print a message
ramonpetgrave64 Jul 31, 2024
26f0792
debug: print token payload
ramonpetgrave64 Jul 31, 2024
8aac1ea
debug: make sigstore bundle
ramonpetgrave64 Aug 1, 2024
0ec6b32
debug: add checks for err
ramonpetgrave64 Aug 1, 2024
5c4c4ec
full bundle print
ramonpetgrave64 Aug 1, 2024
576a078
debug: timout and retires
ramonpetgrave64 Aug 1, 2024
d3be460
debug: no trusted root, no verifying the bundle upon creation
ramonpetgrave64 Aug 1, 2024
a74d494
debug: marshall the bunlde
ramonpetgrave64 Aug 1, 2024
2cce51b
debug: attempt to produce real artifact
ramonpetgrave64 Aug 1, 2024
0cbf195
debug: attempt to verify with slsa-verifier
ramonpetgrave64 Aug 1, 2024
3b56d15
debug: SLSA_VERIFIER_TESTING
ramonpetgrave64 Aug 1, 2024
a81286f
debug: unpinned ul/dl artifact
ramonpetgrave64 Aug 1, 2024
5011d90
debug: ul/dl artifact @v4
ramonpetgrave64 Aug 1, 2024
0a0f065
debug: no additonal TSAs
ramonpetgrave64 Aug 1, 2024
aff495e
debug: back to setting trusted root
ramonpetgrave64 Aug 1, 2024
d5b1fc3
debug: compile
ramonpetgrave64 Aug 1, 2024
dc2df0f
debug: derference attestation
ramonpetgrave64 Aug 1, 2024
8f3bbff
debug: use plain data for bundle content
ramonpetgrave64 Aug 1, 2024
6ded4e7
debug: back to dsse data, nil trusted root so we don't try to verify,…
ramonpetgrave64 Aug 1, 2024
6b0cb35
sign the envelope directly
ramonpetgrave64 Aug 1, 2024
8188b61
back to trying to verify the bundle
ramonpetgrave64 Aug 1, 2024
f89fbd8
init: generic byob
ramonpetgrave64 Aug 2, 2024
5209a01
debug: generic as byob
ramonpetgrave64 Aug 2, 2024
97fc5b6
idtoken write
ramonpetgrave64 Aug 2, 2024
6d7727f
all perms
ramonpetgrave64 Aug 2, 2024
020af23
rel dir
ramonpetgrave64 Aug 2, 2024
bf28520
lahR
ramonpetgrave64 Aug 2, 2024
01f3035
add go.mod
ramonpetgrave64 Aug 7, 2024
745df85
subshell cd
ramonpetgrave64 Aug 7, 2024
0c1dc7a
go1.22
ramonpetgrave64 Aug 7, 2024
c4bb969
dir
ramonpetgrave64 Aug 7, 2024
86d4ecb
add veridy
ramonpetgrave64 Aug 7, 2024
cec43c8
upload the artifacts
ramonpetgrave64 Aug 7, 2024
c8aec50
set attestation-name variable
ramonpetgrave64 Aug 7, 2024
766c35d
named output
ramonpetgrave64 Aug 7, 2024
7281e3f
use env
ramonpetgrave64 Aug 7, 2024
17f9ec1
ls -lahr
ramonpetgrave64 Aug 7, 2024
7ab495d
prov--name, not prov-download-name
ramonpetgrave64 Aug 7, 2024
628ab62
secure download atts
ramonpetgrave64 Aug 7, 2024
e3936c0
actual prov name
ramonpetgrave64 Aug 7, 2024
98632b1
rename prov
ramonpetgrave64 Aug 7, 2024
9e23996
rename all to .build.slsa
ramonpetgrave64 Aug 7, 2024
d7d920b
full prov path
ramonpetgrave64 Aug 7, 2024
3465a62
--source branch
ramonpetgrave64 Aug 7, 2024
1e0ba53
alternate slsa-verifier build
ramonpetgrave64 Aug 8, 2024
914d2f7
by commit sha
ramonpetgrave64 Aug 8, 2024
c0edc87
install slsa-verifier directly with the branch
ramonpetgrave64 Aug 8, 2024
ed1e0ec
setup-go
ramonpetgrave64 Aug 8, 2024
3935105
alt generator_generic
ramonpetgrave64 Aug 8, 2024
53e0470
add it
ramonpetgrave64 Aug 8, 2024
08eed9f
typo
ramonpetgrave64 Aug 8, 2024
10a794d
fix input
ramonpetgrave64 Aug 8, 2024
29a669b
contents: writer
ramonpetgrave64 Aug 8, 2024
258c8e0
action ref
ramonpetgrave64 Aug 8, 2024
de08ee1
fix path
ramonpetgrave64 Aug 8, 2024
4036af2
pwd
ramonpetgrave64 Aug 8, 2024
b997c22
cd
ramonpetgrave64 Aug 8, 2024
f5bd695
again
ramonpetgrave64 Aug 8, 2024
32a8152
checkout
ramonpetgrave64 Aug 8, 2024
1f7255c
original, no trusted root, custom slsa-verifier
ramonpetgrave64 Aug 9, 2024
1c2f8e9
run directly not as action
ramonpetgrave64 Aug 9, 2024
bd82eb3
explitly use v1 provenance
ramonpetgrave64 Aug 9, 2024
d5b3b90
build3
ramonpetgrave64 Aug 9, 2024
dcb4c54
ls
ramonpetgrave64 Aug 9, 2024
8223b26
add original wokrflow
ramonpetgrave64 Aug 12, 2024
419a686
back to nil provider
ramonpetgrave64 Aug 12, 2024
ea4500a
alt verifier branch
ramonpetgrave64 Aug 12, 2024
a1fdee8
add BundleSigner()
ramonpetgrave64 Aug 12, 2024
8562c8c
cleanup
ramonpetgrave64 Aug 12, 2024
0a43423
debug cleanup
ramonpetgrave64 Aug 12, 2024
b02f9e6
cleanup
ramonpetgrave64 Aug 12, 2024
e6e15d6
changelog
ramonpetgrave64 Aug 12, 2024
1b2cd9e
lint
ramonpetgrave64 Aug 12, 2024
58675b5
lint
ramonpetgrave64 Aug 12, 2024
7f2186f
add bundles for go packages
ramonpetgrave64 Aug 12, 2024
ea05345
test workflows
ramonpetgrave64 Aug 12, 2024
4f20057
perms
ramonpetgrave64 Aug 12, 2024
1526416
compile builder
ramonpetgrave64 Aug 12, 2024
22d3cb1
add config file
ramonpetgrave64 Aug 12, 2024
b8cc29f
undo typo
ramonpetgrave64 Aug 12, 2024
0ef3049
ls
ramonpetgrave64 Aug 12, 2024
ec5b2ae
verify v3
ramonpetgrave64 Aug 12, 2024
6d66d8c
correct source branch
ramonpetgrave64 Aug 12, 2024
777f1fc
lint
ramonpetgrave64 Aug 12, 2024
b38f9d6
modularize the fulcio and rekor URLs
ramonpetgrave64 Aug 12, 2024
fe81c3a
lint
ramonpetgrave64 Aug 14, 2024
7127022
print the rekor log index
ramonpetgrave64 Aug 14, 2024
e9b04be
chore(deps): update github-actions (#3753)
renovate-bot Aug 2, 2024
c4cd932
chore(deps): bump github.com/docker/docker from 24.0.9+incompatible t…
dependabot[bot] Aug 2, 2024
f636fb3
chore(config): migrate renovate config (#3774)
renovate-bot Aug 14, 2024
76ca145
lint
ramonpetgrave64 Aug 14, 2024
e04b6f8
fix help text
ramonpetgrave64 Aug 15, 2024
769ff49
remove debug fiel
ramonpetgrave64 Aug 15, 2024
2f0a04d
Revert "remove debug fiel"
ramonpetgrave64 Aug 16, 2024
0f3b0b9
remove unused rekor addr, use trusted root for partial inline
ramonpetgrave64 Aug 16, 2024
ee41a79
remove debug workflow
ramonpetgrave64 Aug 16, 2024
5f8b841
Update pre-submit.lint.yml
ramonpetgrave64 Sep 3, 2024
447cfe0
upgrade golancilint
ramonpetgrave64 Sep 3, 2024
c399674
lint
ramonpetgrave64 Sep 3, 2024
78b455f
lowercase
ramonpetgrave64 Oct 8, 2024
b23bcf2
correct print string
ramonpetgrave64 Oct 8, 2024
60e98e9
Merge branch 'main' into ramonpetgrave64-internal-builder-sigstore-bu…
ramonpetgrave64 Oct 8, 2024
739ec4a
Merge branch 'main' into ramonpetgrave64-internal-builder-sigstore-bu…
ramonpetgrave64 Oct 24, 2024
6bf118c
1.23.1 in generator_generic
ramonpetgrave64 Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generator_generic_slsa3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
with:
repository: "${{ needs.detect-env.outputs.repository }}"
ref: "${{ needs.detect-env.outputs.ref }}"
go-version: "1.21"
go-version: "1.22"
binary: "${{ env.BUILDER_BINARY }}"
compile-builder: "${{ inputs.compile-generator }}"
directory: "${{ env.BUILDER_DIR }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-submit.lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ jobs:
with:
go-version-file: "go.mod"
- env:
GOLANGCI_LINT_VERSION: "1.57.0"
GOLANGCI_LINT_CHECKSUM: "fc7a9f73d2e3de6aa0ef8d8586906e0067fed577f704b3b0bc29cdd6ad0b74d8"
GOLANGCI_LINT_VERSION: "1.60.3"
GOLANGCI_LINT_CHECKSUM: "4037af8122871f401ed874852a471e54f147ff8ce80f5a304e020503bdb806ef"
run: |
set -euo pipefail

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- toc -->

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

## Unreleased

### Unreleased: Sigstore Bundles for Generic Generator and Go Builder

The workflows `generator_generic_slsa3.yml` and `builder_go_slsa3.yml`
have been updated to produce signed Sigstore Bundles, just like all the other builders
that use the BYOB framework.

The workflow logs will now print a LogIndex, rather than a LogUUID. Both are equally searchanble on
https://search.sigstore.dev/.

### Unreleased: Vars context recorded in provenance

- **Updated**: GitHub `vars` context is now recorded in provenance for the generic and
Expand Down
9 changes: 7 additions & 2 deletions github/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const (

// OIDCToken represents the contents of a GitHub OIDC JWT token.
type OIDCToken struct {
// Expiry is the expiration date of the token.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint: reordering fields by type.

Expiry time.Time

// Issuer is the token issuer.
Issuer string

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

// Expiry is the expiration date of the token.
Expiry time.Time
// RawToken is the unparsed oidc token.
RawToken string

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

token.RawToken = tokenPayload

return token, nil
}

Expand Down
84 changes: 45 additions & 39 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module github.com/slsa-framework/slsa-github-generator

go 1.21
go 1.22.5

toolchain go1.23.0

require (
github.com/coreos/go-oidc/v3 v3.10.0
github.com/coreos/go-oidc/v3 v3.11.0
github.com/go-openapi/strfmt v0.23.0
github.com/go-openapi/swag v0.23.0
github.com/google/go-cmp v0.6.0
Expand All @@ -13,9 +15,10 @@ require (
github.com/secure-systems-lab/go-securesystemslib v0.8.0
github.com/sigstore/cosign/v2 v2.2.4
github.com/sigstore/rekor v1.3.6
github.com/sigstore/sigstore v1.8.3
github.com/spf13/cobra v1.8.0
golang.org/x/oauth2 v0.20.0
github.com/sigstore/sigstore v1.8.8
github.com/sigstore/sigstore-go v0.6.0
github.com/spf13/cobra v1.8.1
golang.org/x/oauth2 v0.22.0
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v3 v3.0.1
)
Expand Down Expand Up @@ -43,26 +46,26 @@ require (
github.com/alibabacloud-go/debug v1.0.0 // indirect
github.com/alibabacloud-go/endpoint-util v1.1.1 // indirect
github.com/alibabacloud-go/openapi-util v0.1.0 // indirect
github.com/alibabacloud-go/tea v1.2.1 // indirect
github.com/alibabacloud-go/tea v1.2.2 // indirect
github.com/alibabacloud-go/tea-utils v1.4.5 // indirect
github.com/alibabacloud-go/tea-xml v1.1.3 // indirect
github.com/aliyun/credentials-go v1.3.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2 v1.26.0 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.9 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.9 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.4 // indirect
github.com/aws/aws-sdk-go-v2 v1.27.2 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.18 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.18 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.20.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.6 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.5 // indirect
github.com/aws/smithy-go v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.11 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.11 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.12 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231024185945-8841054dbdb8 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/buildkite/agent/v3 v3.62.0 // indirect
Expand All @@ -88,7 +91,7 @@ require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-chi/chi v4.1.2+incompatible // indirect
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.23.0 // indirect
Expand All @@ -105,9 +108,9 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/certificate-transparency-go v1.1.8 // indirect
github.com/google/certificate-transparency-go v1.2.1 // indirect
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
github.com/google/go-containerregistry v0.19.1 // indirect
github.com/google/go-containerregistry v0.20.1 // indirect
github.com/google/go-github/v55 v55.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
Expand All @@ -118,13 +121,14 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/in-toto/attestation v1.1.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // indirect
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
Expand All @@ -149,6 +153,7 @@ require (
github.com/segmentio/ksuid v1.0.4 // indirect
github.com/shibumi/go-pathspec v1.3.0 // indirect
github.com/sigstore/fulcio v1.4.5 // indirect
github.com/sigstore/protobuf-specs v0.3.2 // indirect
github.com/sigstore/timestamp-authority v1.2.2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect
Expand All @@ -162,6 +167,7 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/thales-e-security/pool v0.0.2 // indirect
github.com/theupdateframework/go-tuf v0.7.0 // indirect
github.com/theupdateframework/go-tuf/v2 v2.0.0 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/tjfoc/gmsm v1.4.1 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect
Expand All @@ -170,28 +176,28 @@ require (
github.com/zeebo/errs v1.3.0 // indirect
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
go.step.sm/crypto v0.44.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/exp v0.0.0-20231108232855-2478ac86f678 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.19.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/api v0.172.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading
Loading