Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 7845832

Browse files
committed
Add SignatureFormat field to Authority
Signed-off-by: Cody Soyland <[email protected]>
1 parent e58d7f5 commit 7845832

File tree

7 files changed

+21
-0
lines changed

7 files changed

+21
-0
lines changed

config/300-clusterimagepolicy.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ spec:
209209
trustRootRef:
210210
description: Use the Certificate Chain from the referred TrustRoot.TimeStampAuthorities
211211
type: string
212+
signatureFormat:
213+
description: SignatureFormat specifies the format the authority expects. Supported formats are "legacy" and "bundle". If not specified, the default is "legacy" (cosign's default).
214+
type: string
212215
source:
213216
description: Sources sets the configuration to specify the sources from where to consume the signatures.
214217
type: array
@@ -545,6 +548,9 @@ spec:
545548
trustRootRef:
546549
description: Use the Certificate Chain from the referred TrustRoot.TimeStampAuthorities
547550
type: string
551+
signatureFormat:
552+
description: SignatureFormat specifies the format the authority expects. Supported formats are "legacy" and "bundle". If not specified, the default is "legacy" (cosign's default).
553+
type: string
548554
source:
549555
description: Sources sets the configuration to specify the sources from where to consume the signatures.
550556
type: array

docs/api-types/index-v1alpha1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Attestation defines the type of attestation to validate and optionally apply a p
172172
| ctlog | CTLog sets the configuration to verify the authority against a Rekor instance. | [TLog](#tlog) | false |
173173
| attestations | Attestations is a list of individual attestations for this authority, once the signature for this authority has been verified. | [][Attestation](#attestation) | false |
174174
| rfc3161timestamp | RFC3161Timestamp sets the configuration to verify the signature timestamp against a RFC3161 time-stamping instance. | [RFC3161Timestamp](#rfc3161timestamp) | false |
175+
| signatureFormat | SignatureFormat specifies the format the authority expects. Supported formats are \"legacy\" and \"bundle\". If not specified, the default is \"legacy\" (cosign's default). | string | false |
175176

176177
[Back to TOC](#table-of-contents)
177178

docs/api-types/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The authorities block defines the rules for discovering and validating signature
4949
| ctlog | CTLog sets the configuration to verify the authority against a Rekor instance. | [TLog](#tlog) | false |
5050
| attestations | Attestations is a list of individual attestations for this authority, once the signature for this authority has been verified. | [][Attestation](#attestation) | false |
5151
| rfc3161timestamp | RFC3161Timestamp sets the configuration to verify the signature timestamp against a RFC3161 time-stamping instance. | [RFC3161Timestamp](#rfc3161timestamp) | false |
52+
| signatureFormat | SignatureFormat specifies the format the authority expects. Supported formats are \"legacy\" and \"bundle\". If not specified, the default is \"legacy\" (cosign's default). | string | false |
5253

5354
[Back to TOC](#table-of-contents)
5455

pkg/apis/policy/v1alpha1/clusterimagepolicy_conversion.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func (matchResource *MatchResource) ConvertTo(_ context.Context, sink *v1beta1.M
8989

9090
func (authority *Authority) ConvertTo(ctx context.Context, sink *v1beta1.Authority) error {
9191
sink.Name = authority.Name
92+
sink.SignatureFormat = authority.SignatureFormat
9293
if authority.CTLog != nil && authority.CTLog.URL != nil {
9394
sink.CTLog = &v1beta1.TLog{
9495
URL: authority.CTLog.URL.DeepCopy(),
@@ -244,6 +245,7 @@ func (spec *ClusterImagePolicySpec) ConvertFrom(ctx context.Context, source *v1b
244245

245246
func (authority *Authority) ConvertFrom(ctx context.Context, source *v1beta1.Authority) error {
246247
authority.Name = source.Name
248+
authority.SignatureFormat = source.SignatureFormat
247249
if source.CTLog != nil && source.CTLog.URL != nil {
248250
authority.CTLog = &TLog{
249251
URL: source.CTLog.URL.DeepCopy(),

pkg/apis/policy/v1alpha1/clusterimagepolicy_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ type Authority struct {
144144
// RFC3161Timestamp sets the configuration to verify the signature timestamp against a RFC3161 time-stamping instance.
145145
// +optional
146146
RFC3161Timestamp *RFC3161Timestamp `json:"rfc3161timestamp,omitempty"`
147+
// SignatureFormat specifies the format the authority expects. Supported
148+
// formats are "legacy" and "bundle". If not specified, the default
149+
// is "legacy" (cosign's default).
150+
SignatureFormat string `json:"signatureFormat,omitempty"`
147151
}
148152

149153
// This references a public verification key stored in

pkg/apis/policy/v1beta1/clusterimagepolicy_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ type Authority struct {
143143
// RFC3161Timestamp sets the configuration to verify the signature timestamp against a RFC3161 time-stamping instance.
144144
// +optional
145145
RFC3161Timestamp *RFC3161Timestamp `json:"rfc3161timestamp,omitempty"`
146+
// SignatureFormat specifies the format the authority expects. Supported
147+
// formats are "legacy" and "bundle". If not specified, the default
148+
// is "legacy" (cosign's default).
149+
SignatureFormat string `json:"signatureFormat,omitempty"`
146150
}
147151

148152
// This references a public verification key stored in

pkg/webhook/clusterimagepolicy/clusterimagepolicy_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ type Authority struct {
8686
Attestations []AttestationPolicy `json:"attestations,omitempty"`
8787
// +optional
8888
RFC3161Timestamp *RFC3161Timestamp `json:"rfc3161timestamp,omitempty"`
89+
// +optional
90+
SignatureFormat string `json:"signatureFormat,omitempty"`
8991
}
9092

9193
// This references a public verification key stored in
@@ -325,6 +327,7 @@ func convertAuthorityV1Alpha1ToWebhook(in v1alpha1.Authority) *Authority {
325327
CTLog: in.CTLog,
326328
RFC3161Timestamp: rfc3161Timestamp,
327329
Attestations: attestations,
330+
SignatureFormat: in.SignatureFormat,
328331
}
329332
}
330333

0 commit comments

Comments
 (0)