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
This will indirectly add support for signing with Rekor v2, since
signing will be handled by sigstore-go rather than Cosign.
This also brings sign/attest up to par with sign-blob/attest-blob with
respect to signing with a key and providing a trusted root when
providing a signing config.
This feature is gated behind one of two signing config flags, which in a
later version of Cosign will be flipped to on by default.
Signed-off-by: Hayden <[email protected]>
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
119
+
}
120
+
ko.TrustedMaterial=trustedMaterial
121
+
}
122
+
}
123
+
124
+
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.NewBundleFormat {
125
+
returnfmt.Errorf("must provide --new-bundle-format with --signing-config or --use-signing-config")
126
+
}
127
+
ifo.UseSigningConfig {
128
+
signingConfig, err:=cosign.SigningConfig()
106
129
iferr!=nil {
107
-
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
130
+
returnfmt.Errorf("error getting signing config from TUF: %w", err)
"whether to use a TUF-provided signing config for the service URLs. Must set --new-bundle-format, which will store verification material in the new format")
Copy file name to clipboardExpand all lines: cmd/cosign/cli/options/sign.go
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,9 @@ type SignOptions struct {
43
43
SignContainerIdentitystring
44
44
RecordCreationTimestampbool
45
45
NewBundleFormatbool
46
+
UseSigningConfigbool
47
+
SigningConfigPathstring
48
+
TrustedRootPathstring
46
49
47
50
RekorRekorOptions
48
51
FulcioFulcioOptions
@@ -139,5 +142,16 @@ func (o *SignOptions) AddFlags(cmd *cobra.Command) {
139
142
140
143
cmd.Flags().BoolVar(&o.RecordCreationTimestamp, "record-creation-timestamp", false, "set the createdAt timestamp in the signature artifact to the time it was created; by default, cosign sets this to the zero value")
141
144
145
+
// TODO: have this default to true as a breaking change
142
146
cmd.Flags().BoolVar(&o.NewBundleFormat, "new-bundle-format", false, "expect the signature/attestation to be packaged in a Sigstore bundle")
147
+
148
+
// TODO: have this default to true as a breaking change
"whether to use a TUF-provided signing config for the service URLs. Must set --new-bundle-format, which will store verification material in the new format")
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
149
+
}
150
+
ko.TrustedMaterial=trustedMaterial
151
+
}
152
+
}
153
+
154
+
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.NewBundleFormat {
155
+
returnfmt.Errorf("must provide --new-bundle-format with --signing-config or --use-signing-config")
156
+
}
157
+
ifo.UseSigningConfig {
158
+
signingConfig, err:=cosign.SigningConfig()
136
159
iferr!=nil {
137
-
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
160
+
returnfmt.Errorf("error getting signing config from TUF: %w", err)
0 commit comments