@@ -409,6 +409,81 @@ list](#default-exclusions), and may overrule the [`.sourceignore` file
409
409
exclusions](#sourceignore-file). See [excluding files](#excluding-files)
410
410
for more information.
411
411
412
+ # ## Verification
413
+
414
+ ` .spec.verify` is an optional field to enable the verification of [Cosign](https://github.com/sigstore/cosign)
415
+ signatures. The field offers two subfields :
416
+
417
+ - ` .provider` , to specify the verification provider. Only supports `cosign` at present.
418
+ - ` .secretRef.name` , to specify a reference to a Secret in the same namespace as
419
+ the OCIRepository, containing the Cosign public keys of trusted authors.
420
+
421
+ ` ` ` yaml
422
+ ---
423
+ apiVersion: source.toolkit.fluxcd.io/v1beta2
424
+ kind: OCIRepository
425
+ metadata:
426
+ name: <repository-name>
427
+ spec:
428
+ verify:
429
+ provider: cosign
430
+ secretRef:
431
+ name: cosign-public-keys
432
+ ` ` `
433
+
434
+ When the verification succeeds, the controller adds a Condition with the
435
+ following attributes to the OCIRepository's `.status.conditions` :
436
+
437
+ - `type : SourceVerified`
438
+ - `status : " True" `
439
+ - ` reason: Succeeded`
440
+
441
+ # ### Public keys verification
442
+
443
+ To verify the authenticity of an OCI artifact, create a Kubernetes secret
444
+ with the Cosign public keys :
445
+
446
+ ` ` ` yaml
447
+ ---
448
+ apiVersion: v1
449
+ kind: Secret
450
+ metadata:
451
+ name: cosign-public-keys
452
+ type: Opaque
453
+ data:
454
+ key1.pub: <BASE64>
455
+ key2.pub: <BASE64>
456
+ ` ` `
457
+
458
+ Note that the keys must have the `.pub` extension for Flux to make user of them.
459
+
460
+ # ### Keyless verification
461
+
462
+ For publicly available OCI artifacts, which are signed using the
463
+ [Cosign Keyless](https://github.com/sigstore/cosign/blob/main/KEYLESS.md) procedure,
464
+ you can enable the verification by omitting the `.verify.secretRef` field.
465
+
466
+ Example of verifying artifacts signed by the
467
+ [Cosign GitHub Action](https://github.com/sigstore/cosign-installer) with GitHub OIDC Token :
468
+
469
+ ` ` ` yaml
470
+ apiVersion: source.toolkit.fluxcd.io/v1beta2
471
+ kind: OCIRepository
472
+ metadata:
473
+ name: podinfo
474
+ spec:
475
+ interval: 5m
476
+ url: oci://ghcr.io/stefanprodan/manifests/podinfo
477
+ verify:
478
+ provider: cosign
479
+ ` ` `
480
+
481
+ The controller verifies the signatures using the Fulcio root CA and the Rekor
482
+ instance hosted at [rekor.sigstore.dev](https://rekor.sigstore.dev/).
483
+
484
+ Note that keyless verification is an **experimental feature**, using
485
+ custom root CAs or self-hosted Rekor instances are not currency supported.
486
+
412
487
# ## Suspend
413
488
414
489
` .spec.suspend` is an optional field to suspend the reconciliation of a
0 commit comments