Skip to content

Commit 09cae78

Browse files
authored
Merge pull request #925 from souleb/cosign-verify-helm
implement Cosign verification for HelmCharts
2 parents d372531 + 06a5559 commit 09cae78

22 files changed

+805
-115
lines changed

api/v1beta2/helmchart_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ type HelmChartSpec struct {
8686
// NOTE: Not implemented, provisional as of https://github.com/fluxcd/flux2/pull/2092
8787
// +optional
8888
AccessFrom *acl.AccessFrom `json:"accessFrom,omitempty"`
89+
90+
// Verify contains the secret name containing the trusted public keys
91+
// used to verify the signature and specifies which provider to use to check
92+
// whether OCI image is authentic.
93+
// This field is only supported when using HelmRepository source with spec.type 'oci'.
94+
// Chart dependencies, which are not bundled in the umbrella chart artifact, are not verified.
95+
// +optional
96+
Verify *OCIRepositoryVerification `json:"verify,omitempty"`
8997
}
9098

9199
const (

api/v1beta2/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,34 @@ spec:
403403
items:
404404
type: string
405405
type: array
406+
verify:
407+
description: Verify contains the secret name containing the trusted
408+
public keys used to verify the signature and specifies which provider
409+
to use to check whether OCI image is authentic. This field is only
410+
supported when using HelmRepository source with spec.type 'oci'.
411+
Chart dependencies, which are not bundled in the umbrella chart
412+
artifact, are not verified.
413+
properties:
414+
provider:
415+
default: cosign
416+
description: Provider specifies the technology used to sign the
417+
OCI Artifact.
418+
enum:
419+
- cosign
420+
type: string
421+
secretRef:
422+
description: SecretRef specifies the Kubernetes Secret containing
423+
the trusted public keys.
424+
properties:
425+
name:
426+
description: Name of the referent.
427+
type: string
428+
required:
429+
- name
430+
type: object
431+
required:
432+
- provider
433+
type: object
406434
version:
407435
default: '*'
408436
description: Version is the chart version semver expression, ignored

config/testdata/helmchart-from-oci/source.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ spec:
1919
name: podinfo
2020
version: '6.1.*'
2121
interval: 1m
22+
---
23+
apiVersion: source.toolkit.fluxcd.io/v1beta2
24+
kind: HelmChart
25+
metadata:
26+
name: podinfo-keyless
27+
spec:
28+
chart: podinfo
29+
sourceRef:
30+
kind: HelmRepository
31+
name: podinfo
32+
version: '6.2.1'
33+
interval: 1m
34+
verify:
35+
provider: cosign

0 commit comments

Comments
 (0)